big-code-analysis-cli
bca analyzes source code and emits per-file structured metrics,
aggregated reports, AST dumps, node lookups, and more.
Migrating from the flag-style CLI? The CLI is now subcommand-driven. See the migration guide for old-form -> new-form mappings of every flag.
Installation
From PyPI (pip)
The fastest path on Linux, macOS, and Windows — no Rust toolchain required:
pip install big-code-analysis-cli # installs the `bca` command on PATH
bca --version
Note the deliberate split between the distribution name and the
command name: you pip install big-code-analysis-cli, but the
installed executable is bca. The bca name on PyPI belongs to an
unrelated project, and big-code-analysis is this project's importable
library bindings (pip install big-code-analysis — a different
deliverable). The wheel ships the full all-languages grammar set; a
single py3-none-<platform> wheel covers every CPython 3.x (and PyPy)
on that platform. Prebuilt wheels are published for Linux
(manylinux_2_28 x86_64 / aarch64), macOS (x86_64 / arm64), and
Windows (x86_64); other platforms fall back to a source build.
From crates.io (cargo)
cargo install big-code-analysis-cli
From source
cd big-code-analysis-cli/
cargo build --release
Usage
bca [OPTIONS] <COMMAND> [COMMAND OPTIONS]
The command picks what to do; its options describe both what to walk
(paths, includes/excludes, parallelism, language overrides) and how to
format the result. Input-selection and walker-tuning flags are scoped to
the subcommand that consumes them and must be written after the
subcommand token — only -w / --warnings and --report-skipped are
universal and accepted in any position.
Commands
| Command | Purpose |
|---|---|
metrics |
Per-file metric output (-O cbor/csv/json/toml/yaml, --output-dir DIR). |
ops |
Per-file operand/operator output (same formats as metrics). |
report <FORMAT> |
Aggregated report (markdown or html). |
check |
Check per-function metrics against thresholds; exits 2 on threshold violations. |
dump |
AST dump to stdout (--line-start/--line-end to scope a range). |
find <NODE>... |
Find nodes of one or more types (--line-start/--line-end to scope a range). |
count <NODE>... |
Count nodes of one or more types. |
functions |
List functions/methods and their spans. |
strip-comments |
Remove comments from source files (--in-place). |
preproc |
Build preprocessor-data JSON for C/C++ analysis. |
list-metrics [names|descriptions] |
List computable metrics. |
Run bca <COMMAND> --help for command-specific options.
Walking options
These input-selection and walker-tuning flags are accepted by the walking
subcommands (metrics, ops, report, check, dump, find, count,
functions, strip-comments) and must be written after the
subcommand. A flag passed to a subcommand that never consumes it is a hard
usage error (exit 1), not a silent no-op.
-p, --paths <FILE>...— input files or directories. The walking subcommands also accept paths positionally (bca metrics src/).-I, --include <GLOB>— include files matching pattern (repeatable).-X, --exclude <GLOB>— exclude files matching pattern (repeatable).-j, --jobs <N>— worker threads (--num-jobsis a deprecated alias).-l, --language <LANG>— force a language instead of inferring. Accepts a language name (rust) or extension (rs); unknown values error out.-w, --warnings— print warnings (skipped files, unrecognized languages).--warningis a deprecated alias.--no-skip-generated— disable auto-skip of files marked as generated (see Skipping generated code).--report-skipped— log askipped (generated): <path>line to stderr for every file the generated-code detector excludes.--preproc-data <FILE>— consume an existing preproc JSON during C/C++ analysis. Build one withbca preproc.
-w / --warnings and --report-skipped are the only universal options;
they are accepted in any position, before or after the subcommand.
Building with a subset of languages
The shipped bca binary compiles every supported tree-sitter grammar
in. The big-code-analysis-cli crate pins the library's
all-languages feature set explicitly, so passing
--no-default-features or a custom --features list to
cargo build -p big-code-analysis-cli does not drop grammars
from the resulting binary — feature selection on the CLI crate is
not honoured (see #252 for the rationale: dropping a
grammar silently from a user-facing binary would surface as
"language X stopped working" rather than a build error).
Consumers who need a reduced feature set should embed the
big-code-analysis library in their own Rust code and control
feature selection in their own Cargo.toml. See the library's
per-language Cargo features chapter for the full
list of features and a worked example.
Examples
Per-file JSON metrics:
bca metrics --paths ./src -O json --output-dir ./out/
Aggregated markdown quality report:
bca report markdown --paths "$PWD" --jobs $(nproc) \
--top 20 --strip-prefix "$PWD/"
AST dump for one file:
bca dump ./file.rs
List all metrics with one-line descriptions:
bca list-metrics descriptions
Skipping generated code
Generated bindings (protobuf stubs, OpenAPI clients, lex/yacc output,
build-system plumbing) inflate metrics for code no human will refactor.
By default, bca scans the first ~50 lines / 5 KiB of each file for a
generated-code marker and skips matches before parsing.
Recognized markers (case-insensitive):
@generated— Facebook / Meta convention; also emitted by buck2, rustfmt, prettier, and many code generators.DO NOT EDIT— Go's// Code generated by … DO NOT EDIT.is the canonical form; the bare phrase is also widely copied (Bazel, protoc, OpenAPI clients).GENERATED CODE— Lizard's marker, recognized for compatibility.
A marker phrase that appears only deep in the file body (past the scan window) does not trigger the skip.
To restore the previous behavior and analyze everything, pass
--no-skip-generated. To audit which files were excluded, pass
--report-skipped; the CLI logs skipped (generated): <path> to stderr
for each file.
Metadata
Release files for big-code-analysis-cli 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| big_code_analysis_cli-2.3.0.tar.gz | 4.7 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| big_code_analysis_cli-2.3.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| big_code_analysis_cli-2.3.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details |
| big_code_analysis_cli-2.3.0-py3-none-manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64 | Details |
| big_code_analysis_cli-2.3.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| big_code_analysis_cli-2.3.0-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details |
Total release size: 44.9 MB
Release files / big_code_analysis_cli-2.3.0.tar.gz
| Download URL | big_code_analysis_cli-2.3.0.tar.gz |
|---|---|
| Size | 4.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ba0c5b1982edbac68516f02d4eb4d033a256081f1342979200da25c7fd68b1d
|
|
BLAKE2b-256 checksum How to use checksums |
d93d639d5f48c59388874fb4fc48fd905bcf69d277ff5c26ff91d498c24b5b22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / big_code_analysis_cli-2.3.0-py3-none-win_amd64.whl
| Download URL | big_code_analysis_cli-2.3.0-py3-none-win_amd64.whl |
|---|---|
| Size | 8.3 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8e32b3cc2027652f583901af2a3819f1fe681db89aa01fa2373493a2aa1208bc
|
|
BLAKE2b-256 checksum How to use checksums |
c44de8ef5ceec6c5e93da47fc82ff29f1ba15c6f7344c9b37499917e115a6756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / big_code_analysis_cli-2.3.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | big_code_analysis_cli-2.3.0-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 8.1 MB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
ad2a171d428a0f7216ac28c8e748f83661255091472aa363ffe0adfc3e14e18f
|
|
BLAKE2b-256 checksum How to use checksums |
7c05128e68fa89fe6fc477d77e8682920b8d14eab3530451e2ac4d2255dfca71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / big_code_analysis_cli-2.3.0-py3-none-manylinux_2_28_aarch64.whl
| Download URL | big_code_analysis_cli-2.3.0-py3-none-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 7.8 MB |
| Tags | Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
bc44c6ee22ca1be14a964a2896373a98c407b8ccd13d23e83c8566b574a793f9
|
|
BLAKE2b-256 checksum How to use checksums |
becf510b4947d63202a370e60a9b0c3c0f20356ad3f77182ab650d8b2e47f95b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / big_code_analysis_cli-2.3.0-py3-none-macosx_11_0_arm64.whl
| Download URL | big_code_analysis_cli-2.3.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.0 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
df17bb86e8ce180b4dbb4ac8e59bc682f74b218d2bc07dacd82d1e487bf39d0e
|
|
BLAKE2b-256 checksum How to use checksums |
17e95b917fbfa361efe202332192c55efeefd090281be0cead4483a86772a938
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / big_code_analysis_cli-2.3.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | big_code_analysis_cli-2.3.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 8.0 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
5c37a88223e600dd40bdd50c4de7e0214f893c7e6c7440bf22481757d6488c4b
|
|
BLAKE2b-256 checksum How to use checksums |
ec2bff23482c3033f2a25de681c9d81886640f0a0558fccbe57992e472af0d56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency log