CLI options
codeanalyzer [OPTIONS]Static analysis on Python source code using Jedi, CodeQL, and Tree-sitter. The only required option is --input. With no --output, the artifact is printed to stdout as compact JSON.
Options
Section titled “Options”| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
--input | -i | PATH | required | Path to the project root directory. |
--output | -o | PATH | None | Output directory for artifacts. If unset, JSON is printed to stdout. |
--format | -f | json | msgpack | json | Output serialization format. |
--codeql / --no-codeql | flag | --no-codeql | Enable CodeQL-based resolution in addition to Jedi. | |
--ray / --no-ray | flag | --no-ray | Use Ray to build the symbol table in parallel. | |
--eager / --lazy | flag | --lazy | Rebuild the analysis (and venv) from scratch vs. reuse cache. | |
--skip-tests / --include-tests | flag | --skip-tests | Exclude or include test files in the analysis. | |
--file-name | PATH | None | Analyze only this file (relative to --input; must be .py). | |
--cache-dir | -c | PATH | None | Where to store the cache. Defaults to .codeanalyzer in the input dir. |
--clear-cache / --keep-cache | flag | --keep-cache | Delete the cache on exit vs. retain it. | |
-v | count | 0 | Increase verbosity: -v (info), -vv (debug), -vvv (trace). | |
--help | Show the help message and exit. |
Notes on defaults
Section titled “Notes on defaults”- Lazy by default. Analysis reuses cached results for unchanged files. Use
--eagerto force a full rebuild. - Cache is kept by default. The cache survives between runs. Use
--clear-cacheto discard it on exit. - Tests excluded by default. Files under
test/testsdirectories, or namedtest_*.py/*_test.py, are skipped unless you pass--include-tests. - CodeQL off by default. Jedi resolves the call graph alone unless
--codeqlis set.
Output files
Section titled “Output files”| Format | File | Notes |
|---|---|---|
json | analysis.json | Compact JSON. Also the stdout format when --output is omitted. |
msgpack | analysis.msgpack | gzip-compressed MessagePack; the CLI logs the compression ratio vs. JSON. |
Both encode the same PyApplication schema — see Output schema.
Examples
Section titled “Examples”# Symbol table + call graph to stdoutcodeanalyzer --input ./proj
# Write JSON to a directorycodeanalyzer --input ./proj --output ./out
# msgpack + CodeQL, eager rebuild, cache discardedcodeanalyzer --input ./proj --output ./out --format msgpack --codeql --eager --clear-cache
# One file onlycodeanalyzer --input ./proj --file-name src/app/routes.py
# Custom cache location, debug loggingcodeanalyzer --input ./proj --cache-dir /tmp/ca -vvWhere to go next
Section titled “Where to go next” CLI usage Worked examples and the reasoning behind each flag.
Output schema The PyApplication artifact, field by field.