CLI reference
Find the fallow commands, the bare fallow run, the output formats and the rules for scripts and agents.
The fallow program runs each analysis as a command. Without a command, it runs the main analyses together.
For a first run, read First run.
Synopsis
fallow [OPTIONS] [PATH] [COMMAND]
Subcommands
| Subcommand | Description |
|---|---|
dead-code | Analyze project for unused code and dependency hygiene |
guard | Show which architecture rules apply to files before changing them |
architecture | Check import cycles, boundaries and policy rules after editing |
dupes | Find code duplication / clones across the project |
health | Analyze function complexity (cyclomatic + cognitive) |
flags | Detect feature flag patterns in the codebase |
security | Surface local security candidates for downstream agent verification (opt-in) |
similar-code | Find semantically similar functions with a pinned local model (opt-in) |
mutation | Measure how well the tests detect changes in the code (opt-in) |
audit | Audit changed files for dead code, complexity, duplication, and styling |
watch | Watch for changes and re-run analysis |
fix | Auto-fix issues: remove unused exports, dependencies, and enum members; add duplicate-export rules to a fallow config file |
list | List discovered entry points, files, plugins, boundaries, workspaces, and the startup import weight |
inspect | Inspect one file or exported symbol as a bundled evidence query |
trace | Trace a symbol's call chain, or the shortest import path between two modules (best-effort, syntactic; not part of the ranked brief) |
trace-error | Resolve a runtime stack trace's frames to the definitions they name (best-effort, syntactic; OFF the ranked path) |
decision-surface | Surface the consequential structural decisions a change embeds (the apex of the review brief), each framed as a judgment question with the routed expert to ask |
workspaces | Show monorepo workspaces and any workspace-discovery diagnostics |
explain | Explain one fallow issue type without running an analysis |
suppressions | List active fallow-ignore suppression markers (read-only inventory) |
impact | Show what fallow has done for you: how many issues it is surfacing, the trend since the last recorded run, and how many commits it contained at the pre-commit gate |
viz | Generate an interactive HTML map of the codebase |
doctor | Diagnose project readiness without analysis or mutation |
init | Initialize a .fallowrc.json configuration file, AGENTS.md guide, or git pre-commit hook. |
agent | Wire fallow into the coding-agent harnesses used by this project in one pass (AGENTS.md task map, skill, MCP server, commit/push gate), or show and remove what was installed. |
audit-cache | Maintain reusable audit base-snapshot caches |
baselines | Maintain the committed baseline files that the config points at |
recommend | Recommend a project-tailored config for an agent to author |
migrate | Migrate configuration from knip, jscpd, or stylelint to fallow |
config | Show the resolved config and which config file was loaded |
config-schema | Print the JSON Schema for fallow configuration files |
plugin-schema | Print the JSON Schema for external plugin files |
plugin-check | Dry-run external plugins: report what each activated and seeded |
rule-pack | Manage declarative rule packs (policy-as-code) |
rule-pack-schema | Print the JSON Schema for rule pack files |
type-aware | Inspect the optional type-aware companion for TypeScript semantic analysis |
ci | CI helpers for PR/MR feedback envelopes |
ci-template | Print or vendor CI integration templates |
report | Render a saved --format json results file in another format without re-running analysis (analyze once, then render every CI surface from the same file). |
hooks | Install or remove fallow-managed Git and agent hooks |
setup-hooks | Deprecated: install or remove a Claude Code PreToolUse hook that gates git commit / git push on fallow audit, so the agent cleans findings before the command runs |
coverage | Runtime coverage workflow |
cloud | Connect this machine to Fallow Cloud |
license | Manage the license for continuous/cloud runtime monitoring |
telemetry | Manage opt-in product telemetry |
schema | Dump fallow's capability manifest (CLI commands and flags, issue types, MCP tools, framework plugins, env vars) as machine-readable JSON for agent introspection. |
fallow review is an alias of fallow audit --brief. It prints the review brief and always exits with code 0.
fallow setup-hooks is deprecated. To install the commit gate, use fallow agent install or fallow hooks install --target agent.
Options
fallow without a command is the bare run. It runs three analyses on the project: dead code, duplication and health. The architecture findings (import cycles, boundary violations and rule-pack violations) are part of the dead code analysis, and show as an Architecture group in its section. --only and --skip select the analyses. The value architecture selects only that group of the dead code analysis. These options apply only to the bare run:
| Argument | Description |
|---|---|
[PATH] | Scope reported findings to this file or directory (default: whole project). The full project graph is still built; only reported items are narrowed |
| Option | Description |
|---|---|
-v, --version (alias -V) | Print version. Accepts -v, -V, and --version |
Scope
| Option | Description |
|---|---|
--production-dead-code | Run dead-code analysis in production mode when using bare combined mode |
--production-health | Run health analysis in production mode when using bare combined mode |
--production-dupes | Run duplication analysis in production mode when using bare combined mode |
--only <ONLY> | Run only specific analyses when no subcommand is given. Values: dead-code (alias check), dupes, health, architecture. |
--skip <SKIP> | Skip specific analyses when no subcommand is given. Values: dead-code (alias check), dupes, health, architecture. |
Health
| Option | Description |
|---|---|
--score | Compute health score in combined mode |
--trend | Compare current health metrics against the most recent saved snapshot |
--trend-from <PATH> | Compare current health metrics against this snapshot file in combined mode. Implies --trend and --score |
--save-snapshot <PATH> | Save a vital signs snapshot for trend tracking in combined mode. Provide a path or omit for the default .fallow/snapshots/ location. |
--coverage <PATH> | Path to Istanbul or raw V8 coverage data for measured CRAP scores in combined mode. Also settable via FALLOW_COVERAGE or health.coverage |
--coverage-root <PATH> | Absolute prefix to strip from Istanbul file paths in combined mode. Also settable via FALLOW_COVERAGE_ROOT or health.coverageRoot |
Baselines
| Option | Description |
|---|---|
--dupes-baseline <PATH> | Compare duplication clone groups against a saved baseline in combined mode (produced by fallow dupes --save-baseline) |
--health-baseline <PATH> | Compare health findings against a saved baseline in combined mode (produced by fallow health --save-baseline) |
The global options are in these groups: Project, Output, Scope, Baselines, Gates, Duplication, Type-aware, Performance.
The bare run also accepts the --dupes-* options and each other option of Global options, for example --format, --quiet and --changed-since.
Output
The human output of the bare run has one section for each analysis: ── Dead Code ──, ── Duplication ── and ── Complexity ──. The last line, Failed:, names each analysis that has findings.
With --format json, the output has the kind "combined" and one object for each analysis: check, dupes and health. The JSON output reference has each field. With --format json, an error prints {"error": true, "message": "...", "exit_code": 2} on stdout. Agents has the rules for scripts and agents that read the output.
Output formats
--format selects the output. Not every command accepts every format.
| Format | Use |
|---|---|
human | The default. A report for the terminal. |
json | The full result for scripts and agents. Add --pretty to indent it. |
sarif | SARIF 2.1.0, for GitHub code scanning and other SARIF readers. |
compact | One line for each finding, for grep and editors. |
markdown (alias md) | A Markdown report. |
codeclimate (alias gitlab-codequality, gitlab-code-quality) | A Code Climate report, for GitLab Code Quality. |
pr-comment-github, pr-comment-gitlab | The body of one pull request or merge request comment. |
review-github, review-gitlab | A JSON document with inline review comments on the changed lines. |
github-annotations | GitHub workflow-command annotations. They show on pull requests from a fork without a write token. |
github-summary | Markdown for the GitHub Actions job summary (>> "$GITHUB_STEP_SUMMARY"). |
badge | An SVG badge with the health score. fallow health only. |
CI integration shows these formats in a pipeline.
Exit codes
| Code | Meaning |
|---|---|
0 | No enforced gate failed. |
1 | An enforced gate failed, for example a finding at error severity. |
2 | Invalid input or an execution error. |
In json, sarif, codeclimate, the GitHub formats and the comment and review formats, the bare run does not enforce findings and exits with code 0. Pass --fail-on-issues to exit with code 1, or read gate_outcomes: a gate with "status": "fail" and "enforced": false failed without an effect on the exit code. Exit codes lists each code, also the codes of one command.
Examples
Run every analysis with the human report:
fallow
Run only dead code and duplication:
fallow --only dead-code,dupes
Run every analysis except health:
fallow --skip health
Fail a script on findings, with JSON output:
fallow --format json --quiet --fail-on-issues
Related
- Global options: the options that the commands share.
- Exit codes: each exit code and its meaning.
- JSON output: the fields of the JSON output.