Wingbox
v0.19.2Local code graph: what a change breaks, who uses a symbol, architecture layers.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
build_graph
Builds or refreshes the code graph of the repository and returns the build log: the files found per language, the number of modules and dependencies, and where the graph was written. Use it first in a repository and again after large edits: every other tool reads the graph it writes, and says so when the graph is missing. It is not needed before each question: every tool first brings the graph up to date with the files changed since the build. Only changed files are parsed again; `full: true` parses every file, and `exclude_dirs` names folders to leave out, by folder name. It writes the folder…
| Parameter | Type | Description |
|---|---|---|
exclude_dirs | array | Directory names to skip, e.g. ["generated"]. |
full | boolean | Reparse every file instead of only changed ones. |
analyze_impact
Lists what a change to one file reaches: the files that depend on it, grouped by depth, each with its reason, then the files to read first. Use it before editing a file. For one function or type use `find_usages`; for the bare import tree of a module use `list_dependencies`. Input: `target` for one file, or `targets` for several; each is a path relative to the repository root or a module ID, `depth` is how many hops to follow (2 by default), `only` set to `tests` keeps the test files, and `summary` true gives counts and the first twenty files instead. Output: S-expression lines; with `targets`…
| Parameter | Type | Description |
|---|---|---|
all | boolean | Accepted for callers written for earlier versions; the answer lists every dependent either way. |
depth | integer | How many hops to follow. |
only | string | `tests` lists only the dependents that are test files: the tests to run for the change. Where the CMake files state build targets and tests, the answer then also names the affected targets and tests. |
summary | boolean | True answers in a few lines per file: how many files depend on it by depth and by kind (generated, tests, entry points, others), the folders with the most of them, the first twenty files and the call… |
target | string | File path relative to the repository root, or a module ID. |
targets | array | Several file paths or module IDs; one answer each, in this order, after a fact that says when the graph was built and how many changed files it misses. |
describe_module
Describes one module in full: what it defines (functions, types and constants with their lines), what it imports, who depends on it and its architecture layer. Use it to understand a module before reading its file, or to find where a feature lives: `module` is a module ID or a file path, and given a keyword instead it describes the best matching module. For what a change reaches use `analyze_impact`; for the text of the file use `read_source`. Returns one line per fact. A long list stops at 200 items unless `all` is true. A name the graph does not hold is answered with an error line, with sugg…
| Parameter | Type | Description |
|---|---|---|
module * | string | Module ID, file path, or a word from a module path, file name or entity name. |
all | boolean | List everything instead of stopping at 200 items. |
list_files
Lists the source files the graph holds, sorted by path: one line per file with its module ID, language and architecture layer, then a count. Use it to see what the repository contains, or to find a file by a part of its path: `pattern` is literal text with optional `.*` wildcards, matched anywhere in the path (`tests/.*pricing`); without it every file is listed. Only source files of the supported languages are in the graph. For what one file defines use `describe_module`; for its text use `read_source`. A long list stops at 200 items unless `all` is true.
| Parameter | Type | Description |
|---|---|---|
all | boolean | List everything instead of stopping at 200 items. |
pattern | string | Part of a path; literal text with optional .* wildcards. Without it every file is listed. |
read_source
Reads the text of one source file of the graph, or of one definition in it, and returns the lines numbered. Use it when the facts are not enough and the code itself is needed, above all when the repository is on another machine. `target` is a file path or module ID, a name (`total`), or `<file>::Name` when several files define the name; for a name the answer is that definition, from its line to the next definition. `first` and `last` are line numbers of the file. One call returns at most 400 lines and says how many are left and where to go on; a very long line is cut and says its length. It re…
| Parameter | Type | Description |
|---|---|---|
target * | string | File path or module ID, a name, or <file>::Name. |
first | integer | First line to return (default: the first line of the file or of the definition). |
last | integer | Last line to return (default: the end of the file or of the definition). |
search_source
Searches the text of the source files of the graph and returns one line per matching line: file, line number and text, then a count. Use it for what is not a name in the graph: a string, a message, a comment, a configuration key. `pattern` is literal text, letter case ignored, matched inside one line; special are only `.*` (any characters), `^` first and `$` last (the ends of the line) and a backslash before a character meant literally. `path` narrows the search to files whose path matches (`tests/.*`). For where a name is defined use `find_definitions`; for who uses a symbol use `find_usages`…
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Text to search for, as it is written in the code; .* stands for any characters, letter case is ignored. |
first | integer | Number of the first match to return (default 1); a cut answer names the next one as :next. |
path | string | Part of a file path, literal text with optional .* wildcards: only matching files are searched. |
find_definitions
Finds where a function, type or constant is defined and returns one line per definition, with its file and line. Use it to locate a symbol, or to search names by pattern: `name` may hold `.*` wildcards, so `parse_.*` lists every matching name. `kind` narrows the search to functions or to types; without it constants are found too. For the places that use a name use `find_usages`; for a text that is no name use `search_source`. A long list stops at 200 items unless `all` is true. A name the graph does not hold is answered with an error line, with suggestions when similar names exist.
| Parameter | Type | Description |
|---|---|---|
name * | string | Name; literal text with optional .* wildcards. |
all | boolean | List everything instead of stopping at 200 items. |
kind | string | function: functions and methods; type: classes, interfaces, structs, enums; any: all, constants included. |
find_usages
Lists every place that uses one function, class, type or constant, followed through re-exports and aliases: grouped by file, each use with its line:column and kind (import, re-export, call, type, extends, reference). Use it before changing a symbol, and to see which tests reach it. A method call whose receiver type cannot be seen is marked unresolved. For where a name is defined use `find_definitions`; for the reach of a whole file use `analyze_impact`; for the call graph alone use `trace_calls`. `symbol` is a bare name when one file defines it; when several do, or for a method, write `<file>:…
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Name, <file>::Name or <file>::Class.method (a file path or module ID). |
all | boolean | List everything instead of stopping at 200 items. |
list_dependencies
Lists the import tree of one module, hop by hop: `direction` out is what the module uses, in is who uses it. Use it to see how modules are wired together. It gives no reasons and no reading order: before an edit use `analyze_impact` instead. `module` is a module ID or a file path as the other tools print it; `depth` is how many hops to follow, 2 by default and 0 for the module alone. Returns one line per edge, `(dep A B :via imports :depth N)` or `(rdep A B ...)`. A long list stops at 200 items unless `all` is true. A name the graph does not hold is answered with an error line, with suggestion…
| Parameter | Type | Description |
|---|---|---|
module * | string | Module ID or file path, as printed by other tools (e.g. src/billing/invoice). |
all | boolean | List everything instead of stopping at 200 items. |
depth | integer | How many hops to follow. |
direction | string | out: what the module uses; in: who uses the module. |
trace_calls
Traces the call graph around one function, hop by hop: `function` is a function or method name, `direction` in lists who calls it, out lists what it calls; with `to` it returns a call path from the function to that other one. Use it for questions about calls only: for every kind of use of a name (imports, types, references and calls) use `find_usages`. When the graph holds no call edge for the function, the answer gives the links between the modules instead and says so. `depth` is 2 hops by default, 5 for a path. Returns one line per caller, callee or step. A long list stops at 200 items unles…
| Parameter | Type | Description |
|---|---|---|
function * | string | Function or method name; literal text with optional .* wildcards. |
all | boolean | List everything instead of stopping at 200 items. |
depth | integer | How many hops to follow (default 2; 5 for a path with `to`). |
direction | string | in: who calls the function; out: what the function calls. Not used with `to`. |
to | string | Another function: the answer is a call path from `function` to it. |
list_layers
Lists the modules of the repository grouped by architecture layer, each with the rule that put it there. Use it to see how the code is organized, or where new code belongs. To check the imports between the layers use `check_boundaries`; for the plain list of files use `list_files`. Returns one line per layer, then one line per module of that layer with its language and the rule. It takes no name: its one parameter is `all`. A repository with more than about 200 modules needs `all: true`: without it the answer stops after 200 lines, in the middle of a layer, and its last line says how many line…
| Parameter | Type | Description |
|---|---|---|
all | boolean | List everything instead of stopping at 200 items. |
check_boundaries
Checks the architecture rules and lists the imports that cross one (for example domain importing infrastructure), for one module or for all, then the parts of the repository that could not be checked, with the reason. Use it before a review, or after moving code between layers. A part that was not checked is reported as not checked, never as passing. `scope` is one module ID to check that module alone; left out, or `all`, it checks every part. It judges rules only: to see the layers themselves use `list_layers`, for who depends on a module use `list_dependencies`, for what an edit reaches use…
| Parameter | Type | Description |
|---|---|---|
all | boolean | List everything instead of stopping at 200 items. |
scope | string | Module ID or "all". |
list_changes
Lists the functions changed in the working files against a git ref (HEAD by default): one line per changed file and one per changed function, with its line. Use it before a review or a commit, to see what a diff really touches; then use `find_usages` on a changed function to see who uses it. `ref` is any git ref (a branch, a tag, a commit, HEAD~3); the files on disk are compared with it, uncommitted edits included. It does not compare two commits with each other, and it lists functions, not other lines. Needs a git repository; when nothing changed it says so in one line. A long list stops at 2…
| Parameter | Type | Description |
|---|---|---|
all | boolean | List everything instead of stopping at 200 items. |
ref | string | Git ref, e.g. HEAD~3 or main. |
query_graph
Evaluates one expression of the query language over the graph and returns the modules, the files or the count it selects. Use it only to combine sets, which no other tool does: the modules that A uses within two hops and that use B directly are (files (intersect (deps "A" 2) (rdeps "B" 1))), where each number is how many hops to follow. For one plain question use `list_dependencies` (what a module uses, who uses it), `find_definitions` (a name), `trace_calls` (callers), `analyze_impact` (the reach of a change) or `search_source` (a text). `expression` is one expression; (help) returns the func…
| Parameter | Type | Description |
|---|---|---|
expression * | string | A Scheme expression; (help) lists the functions. |
all | boolean | List everything instead of stopping at 200 items. |