Skip to content

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.

OptionAliasTypeDefaultDescription
--input-iPATHrequiredPath to the project root directory.
--output-oPATHNoneOutput directory for artifacts. If unset, JSON is printed to stdout.
--format-fjson | msgpackjsonOutput serialization format.
--codeql / --no-codeqlflag--no-codeqlEnable CodeQL-based resolution in addition to Jedi.
--ray / --no-rayflag--no-rayUse Ray to build the symbol table in parallel.
--eager / --lazyflag--lazyRebuild the analysis (and venv) from scratch vs. reuse cache.
--skip-tests / --include-testsflag--skip-testsExclude or include test files in the analysis.
--file-namePATHNoneAnalyze only this file (relative to --input; must be .py).
--cache-dir-cPATHNoneWhere to store the cache. Defaults to .codeanalyzer in the input dir.
--clear-cache / --keep-cacheflag--keep-cacheDelete the cache on exit vs. retain it.
-vcount0Increase verbosity: -v (info), -vv (debug), -vvv (trace).
--helpShow the help message and exit.
  • Lazy by default. Analysis reuses cached results for unchanged files. Use --eager to force a full rebuild.
  • Cache is kept by default. The cache survives between runs. Use --clear-cache to discard it on exit.
  • Tests excluded by default. Files under test/tests directories, or named test_*.py / *_test.py, are skipped unless you pass --include-tests.
  • CodeQL off by default. Jedi resolves the call graph alone unless --codeql is set.
FormatFileNotes
jsonanalysis.jsonCompact JSON. Also the stdout format when --output is omitted.
msgpackanalysis.msgpackgzip-compressed MessagePack; the CLI logs the compression ratio vs. JSON.

Both encode the same PyApplication schema — see Output schema.

Terminal window
# Symbol table + call graph to stdout
codeanalyzer --input ./proj
# Write JSON to a directory
codeanalyzer --input ./proj --output ./out
# msgpack + CodeQL, eager rebuild, cache discarded
codeanalyzer --input ./proj --output ./out --format msgpack --codeql --eager --clear-cache
# One file only
codeanalyzer --input ./proj --file-name src/app/routes.py
# Custom cache location, debug logging
codeanalyzer --input ./proj --cache-dir /tmp/ca -vv