Skip to content

CLI reference

Every codeweb subcommand and flag, verified against the –help output of the current release.

Every project-scoped command accepts -p, --project <DIR> (default .), plus the global options below. This page documents codeweb v0.9.11 with all features enabled.

Global options

OptionValuesMeaning
--langzh-CN, en (default zh-CN)Output language
--threadsintegerWorker threads for parallel parsing. Default: max(4, logical_cpus - 2). Also honors RAYON_NUM_THREADS; the flag wins
-V, --version—Print version (currently 0.9.11)

Without a subcommand, codeweb runs in legacy mode: codeweb [INPUT] --format <dot&#124;json&#124;mermaid&#124;ndjson> --output <FILE> [--include-unresolved] [--sql-only] parses a file or directory directly and prints an export.

Project lifecycle

CommandKey optionsPurpose
codeweb init <NAME>-d, --dir <DIR> (repeatable), --root <DIR>, --forceCreate codeweb.toml + .codeweb/, register analysis paths, and immediately run the first analysis (the MCP codeweb_init tool, in contrast, inits without analyzing). A non-empty --root without codeweb.toml needs --force
codeweb analyze-p, --projectFull or incremental analysis (fingerprint-based)
codeweb diff-p, --projectFiles changed since the last analysis
codeweb stats-p, --projectNode/edge counts by type
codeweb files-p, --projectAnalyzed files with node counts

Tracing and inspection

CommandKey optionsPurpose
codeweb trace <FROM>-s, --style tree&#124;path, --exact, --regex, --all-matches, --fail-on-multiple, --builtfuncCallers and callees of a node
codeweb detail [NAMES]...-s, --style tree&#124;path, -d, --depth 1&#124;0&#124;-1, -f, --files, --related-ddl, -v, --verbose, --summarize-tables, --exact, --regex, --all-matches, --fail-on-multiple, --builtfuncPer-node callers/callees with optional source context
codeweb inspect [NODES]...-m, --max-depth (default 15), --max-paths (default 10), -s, --style summary&#124;paths&#124;both&#124;tree, --unreachable, --exact, --regex, --all-matches, --fail-on-multipleDirected paths connecting two or more nodes
codeweb impact--file <FILE> (repeatable) or --node <NODE> (mutually exclusive), -f, --format json&#124;text (default json), -d, --depth (default 1), -e, --edge-types (default all), --exact, --regexUpstream/downstream impact for a file’s nodes or one symbol
codeweb trace-sql [SQL]-f, --file <FILE> or positional SQL / - for stdinSearch mapper/sql nodes by SQL fragment, trace back to Java methods

Analysis

CommandKey optionsPurpose
codeweb lineage <TARGET>--direction upstream&#124;downstream&#124;both (default both), --depth (default 5), --format tree&#124;json&#124;dot&#124;mermaid, --view tree&#124;entity&#124;relation&#124;grouped, --flow-onlyTable/column lineage. See Lineage
codeweb columns--procedure <NAME> or --package <NAME> (required, one only), --table <NAME>, --format json&#124;seed-hints (default json), --discriminator <COL> (repeatable)Aggregated column analysis. See Column analysis
codeweb predicates--procedure <NAME> (required), --format jsonPL IF/CASE predicates resolved to columns
codeweb conflicts--severity high&#124;medium (default high), -f, --format json&#124;text (default json), --table <NAME>Cross-procedure table-lock conflicts (static analysis)
codeweb partition-k, --k <K>, --auto, --gamma <GAMMA>, --max-iterations <N>, --min-delta-q <Q>, --min-component-size <N> (default 1), --table-projection [<tau:lambda:k>], -o, --output <FILE>Cluster nodes for system decomposition; exports DOT with cluster_* blocks
codeweb mark-n, --node <NODE> (repeatable), -c, --csv <CSV> (required), -o, --output <FILE>Mark WDR SQL detail CSV rows by relation to graph nodes

Query and export

CommandKey optionsPurpose
codeweb query-f, --file <FILE> (- for stdin) or -s, --spec <JSON>Execute a declarative QuerySpec
codeweb export-f, --format dot&#124;json&#124;mermaid&#124;ndjson (default dot), -o, --output <FILE> (stdout if omitted), --filter <SUBSTR>Export the graph or the subgraph around matching seeds
codeweb dedup-o, --output <FILE> (default in-place), --dry-runMerge duplicate nodes and edges
codeweb import-f, --file <FILE>, -o, --output <FILE>, -p, --prefix <PREFIX>, -n, --name <NAME>, --forceImport a CGEF JSON file. See CGEF
codeweb merge-o, --output <FILE> (required), --name <NAME> (default merged), [STORES]...Merge multiple stores with dedup

Interactive and server

CommandFeatureKey optionsPurpose
codeweb tuitui-p, --projectTerminal explorer with search and node detail
codeweb serveserve-a, --addr (default 127.0.0.1:3000), --open, --log-level info&#124;debugHTTP server with browser UI. See HTTP API
codeweb mcpmcp-p, --projectMCP server over stdio. See MCP tools

Subcommands that need a feature flag are absent from binaries built without it; codeweb serve on a default build exits with an unrecognized-command error.