Skip to content
Fallow home
All docs pages

Docs home

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

SubcommandDescription
dead-codeAnalyze project for unused code and dependency hygiene
guardShow which architecture rules apply to files before changing them
architectureCheck import cycles, boundaries and policy rules after editing
dupesFind code duplication / clones across the project
healthAnalyze function complexity (cyclomatic + cognitive)
flagsDetect feature flag patterns in the codebase
securitySurface local security candidates for downstream agent verification (opt-in)
similar-codeFind semantically similar functions with a pinned local model (opt-in)
mutationMeasure how well the tests detect changes in the code (opt-in)
auditAudit changed files for dead code, complexity, duplication, and styling
watchWatch for changes and re-run analysis
fixAuto-fix issues: remove unused exports, dependencies, and enum members; add duplicate-export rules to a fallow config file
listList discovered entry points, files, plugins, boundaries, workspaces, and the startup import weight
inspectInspect one file or exported symbol as a bundled evidence query
traceTrace a symbol's call chain, or the shortest import path between two modules (best-effort, syntactic; not part of the ranked brief)
trace-errorResolve a runtime stack trace's frames to the definitions they name (best-effort, syntactic; OFF the ranked path)
decision-surfaceSurface 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
workspacesShow monorepo workspaces and any workspace-discovery diagnostics
explainExplain one fallow issue type without running an analysis
suppressionsList active fallow-ignore suppression markers (read-only inventory)
impactShow 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
vizGenerate an interactive HTML map of the codebase
doctorDiagnose project readiness without analysis or mutation
initInitialize a .fallowrc.json configuration file, AGENTS.md guide, or git pre-commit hook.
agentWire 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-cacheMaintain reusable audit base-snapshot caches
baselinesMaintain the committed baseline files that the config points at
recommendRecommend a project-tailored config for an agent to author
migrateMigrate configuration from knip, jscpd, or stylelint to fallow
configShow the resolved config and which config file was loaded
config-schemaPrint the JSON Schema for fallow configuration files
plugin-schemaPrint the JSON Schema for external plugin files
plugin-checkDry-run external plugins: report what each activated and seeded
rule-packManage declarative rule packs (policy-as-code)
rule-pack-schemaPrint the JSON Schema for rule pack files
type-awareInspect the optional type-aware companion for TypeScript semantic analysis
ciCI helpers for PR/MR feedback envelopes
ci-templatePrint or vendor CI integration templates
reportRender a saved --format json results file in another format without re-running analysis (analyze once, then render every CI surface from the same file).
hooksInstall or remove fallow-managed Git and agent hooks
setup-hooksDeprecated: 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
coverageRuntime coverage workflow
cloudConnect this machine to Fallow Cloud
licenseManage the license for continuous/cloud runtime monitoring
telemetryManage opt-in product telemetry
schemaDump 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:

ArgumentDescription
[PATH]Scope reported findings to this file or directory (default: whole project). The full project graph is still built; only reported items are narrowed
OptionDescription
-v, --version (alias -V)Print version. Accepts -v, -V, and --version

Scope

OptionDescription
--production-dead-codeRun dead-code analysis in production mode when using bare combined mode
--production-healthRun health analysis in production mode when using bare combined mode
--production-dupesRun 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

OptionDescription
--scoreCompute health score in combined mode
--trendCompare 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

OptionDescription
--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.

FormatUse
humanThe default. A report for the terminal.
jsonThe full result for scripts and agents. Add --pretty to indent it.
sarifSARIF 2.1.0, for GitHub code scanning and other SARIF readers.
compactOne 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-gitlabThe body of one pull request or merge request comment.
review-github, review-gitlabA JSON document with inline review comments on the changed lines.
github-annotationsGitHub workflow-command annotations. They show on pull requests from a fork without a write token.
github-summaryMarkdown for the GitHub Actions job summary (>> "$GITHUB_STEP_SUMMARY").
badgeAn SVG badge with the health score. fallow health only.

CI integration shows these formats in a pipeline.

Exit codes

CodeMeaning
0No enforced gate failed.
1An enforced gate failed, for example a finding at error severity.
2Invalid 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