CLI Reference
This page is generated from the --help output of the codeknife 0.2.0 binary. It lists 27 top-level commands and 32 commands in total, counting subcommands. The text in each block is the binary’s own help text.
Help text describes intent. Where a command behaves differently from its help text, the feature page for that command says so. See Output Formats & Exit Codes for the exit code contract.
Global options
Section titled “Global options”Every command accepts these options. They are left out of the per-command listings below.
Usage: codeknife [OPTIONS] <COMMAND>
--path <PATH> Repository root path (defaults to current working directory) [default: .] --format <FORMAT> Output format (auto switches between TTY Human and non-TTY Agent) [default: auto] [possible values: auto, human, agent, json, sarif, markdown] --strict Enable strict Uncle Bob / greenfield thresholds --changed Scope findings to files or functions modified in git working tree / since base ref --since <SINCE> Base git ref for `--changed`, loosening checks, and Diff-CRAP (e.g., HEAD, origin/main) --no-cache Do not write or update `.codeknife/` cache/IR files (read-only analysis) --max-items <MAX_ITEMS> Maximum items shown in `--format agent` output -h, --help Print help -V, --version Print versioncodeknife check
Section titled “codeknife check”Run the unified quality gate (Tier 0+1 static checks + ratchet + loosening guard)
Usage: codeknife check [OPTIONS]
Options: --tier <TIER> Run Tier-2 dynamic checks (mutation + HTML map) alongside static checks [default: standard] [possible values: standard, full] --deep Fuse findings from installed native compiler/linters (clippy, ruff, tsc, go vet) --coverage <COVERAGE> Coverage file path (auto-discovered when omitted) --map-out <MAP_OUT> Optional path to write HTML map when running `--tier full`codeknife plan
Section titled “codeknife plan”Emit ranked, token-budgeted agent refactor work orders
Usage: codeknife plan [OPTIONS]
Options: --top <TOP> Maximum number of top refactor tickets to emit [default: 10] --grouped Group findings into cross-blade root-cause work orders --coverage <COVERAGE> Optional coverage report pathcodeknife comments
Section titled “codeknife comments”Blade 1: Deterministic Comment & Suppression Reaper
Usage: codeknife comments [OPTIONS]
Options: --strip Preview or apply safe comment stripping (narration, banners, corpses, AI residue) --write Actually write stripped edits to disk (defaults to dry-run preview without --write) --strip-pub-docs Include public docstrings when stripping (defaults to preserving pub docs)codeknife arch
Section titled “codeknife arch”Blade 2: Ousterhout depth, complexity, LCOM4 cohesion, arch.toml layers & anti-gaming
Usage: codeknife arch [OPTIONS]
Options: --layers <LAYERS> Optional Clean Architecture / layer specification file (defaults to arch.toml) --infer Automatically infer `[[layers]]` and `[[deny]]` rules from existing dependencies --write Write inferred `arch.toml` (or `--layers` target) to disk instead of stdout onlycodeknife clones
Section titled “codeknife clones”Blade 3: AST structural clone detector, duplicate DTO shapes & reinvented helper check
Usage: codeknife clones [OPTIONS]
Options: --threshold <THRESHOLD> Minimum Jaccard similarity threshold (0.0..=1.0)codeknife dead
Section titled “codeknife dead”Blade 4: Whole-repo reachability, dead symbols/files, 1-caller wrappers & single-impl traits
Usage: codeknife dead [OPTIONS]
Options: --fix Preview or remove strictly private dead functions/imports --write Write dead-code removals to disk (dry-run preview without --write)codeknife slop
Section titled “codeknife slop”Blade 5: Swallowed errors, type escapes, guard scatter, async leaks & hygiene
Usage: codeknife slop [OPTIONS]codeknife sec
Section titled “codeknife sec”Blade 6: AI-amplified OWASP security footguns & sibling route auth parity
Usage: codeknife sec [OPTIONS]codeknife tests
Section titled “codeknife tests”Blade 7: Test Theater auditor (scrap) + CRAP & Diff-CRAP over coverage reports
Usage: codeknife tests [OPTIONS]
Options: --coverage <COVERAGE> Coverage report path (lcov, llvm-cov json, go coverprofile, istanbul, cobertura)codeknife mutate
Section titled “codeknife mutate”Blade 8: Surgical diff-scoped, coverage-gated, CoW-parallel mutation tester
Usage: codeknife mutate [OPTIONS]
Options: --scan List candidate mutation sites without executing tests --top <TOP> Mutate top N highest-CRAP functions (in addition to or instead of --changed) --test-command <TEST_COMMAND> Custom test command override --coverage <COVERAGE> Optional coverage report path used to skip uncovered lines --jobs <JOBS> Maximum parallel worker count --mutate-all Ignore mutation cache and re-run all selected mutants --no-schemata Disable compile-once mutant schemata and use isolated workers for every mutantcodeknife churn
Section titled “codeknife churn”Blade 9: Pure-Rust git forensics (Complexity x Churn hotspots, temporal coupling, thrash)
Usage: codeknife churn [OPTIONS]
Options: --days <DAYS> History lookback window in days [default: 90]codeknife blast
Section titled “codeknife blast”Blade 10: Transitive caller cone & cross-boundary SQL/HTTP/env contract blast radius
Usage: codeknife blast [OPTIONS]
Options: --symbol <SYMBOL> Target symbol name to trace (defaults to all `--changed` symbols)codeknife deps
Section titled “codeknife deps”Blade 11: Manifest/lockfile bloat & opt-in registry slopsquatting verifier
Usage: codeknife deps [OPTIONS]
Options: --verify-registry Query live package registries (crates.io, npm, PyPI, Go proxy) for slopsquatting riskcodeknife docs
Section titled “codeknife docs”Blade 12: README, AGENTS.md & docstring drift against real files, symbols & CLI flags
Usage: codeknife docs [OPTIONS]codeknife map
Section titled “codeknife map”Blade 13: Generate self-contained offline interactive HTML Garden Map
Usage: codeknife map [OPTIONS]
Options: --out <OUT> Output HTML file path [default: codeknife-map.html] --proposal <PROPOSAL> Optional proposed arch.toml to visualize resolved/new layer violationscodeknife init
Section titled “codeknife init”Initialize starter `codeknife.toml`, git hook integration, and agent rules
Usage: codeknife init [OPTIONS]
Options: --force Overwrite existing starter files if presentcodeknife baseline
Section titled “codeknife baseline”Manage the shrink-only ratcheting `codeknife.baseline`
Usage: codeknife baseline [OPTIONS] <COMMAND>codeknife baseline update
Section titled “codeknife baseline update”Capture current findings into `codeknife.baseline`
Usage: codeknife baseline update [OPTIONS]codeknife baseline prune
Section titled “codeknife baseline prune”Shrink-only prune of resolved/improved entries from `codeknife.baseline`
Usage: codeknife baseline prune [OPTIONS]codeknife baseline merge-driver
Section titled “codeknife baseline merge-driver”Three-way git merge driver (`%O %A %B`)
Usage: codeknife baseline merge-driver [OPTIONS] <BASE> <OURS> <THEIRS>
Arguments: <BASE> <OURS> <THEIRS>codeknife hook
Section titled “codeknife hook”AI coding agent PreToolUse anti-tamper hook (`claude` or `cursor`)
Usage: codeknife hook [OPTIONS] <COMMAND>codeknife hook claude
Section titled “codeknife hook claude”Handle Claude Code PreToolUse JSON event on stdin
Usage: codeknife hook claude [OPTIONS]codeknife hook cursor
Section titled “codeknife hook cursor”Handle Cursor PreToolUse JSON event on stdin
Usage: codeknife hook cursor [OPTIONS]codeknife skill
Section titled “codeknife skill”Print bundled `SKILL.md` for Claude Code, Cursor, Codex, and Antigravity
Usage: codeknife skill [OPTIONS]codeknife usage
Section titled “codeknife usage”Print the Usage specification (`usage.jdx.dev`) generated from clap metadata
Usage: codeknife usage [OPTIONS]codeknife fix
Section titled “codeknife fix”Deterministic zero-LLM cascading autofix engine (dry-run by default)
Usage: codeknife fix [OPTIONS]
Options: --write Write deterministic fixes to disk (defaults to dry-run preview without --write) --verify Run compiler/test verification command after writing and bisect-rollback breaking patches --verify-cmd <VERIFY_CMD> Custom shell verification command used by `--verify` --aggressive Enable aggressive fixes (1-caller wrapper inlining, HTTP timeouts, unused dep removal) --toolchains Also run available native ecosystem formatters/fixers (`cargo fmt`, `ruff`, `biome`, `gofmt`) --max-passes <MAX_PASSES> Maximum cascading fix passes when `--write` is enabled [default: 3]codeknife test
Section titled “codeknife test”Blast-scoped smart test selector and runner targeting only affected tests
Usage: codeknife test [OPTIONS]
Options: --dry-run Print targeted tests and commands without executing subprocesses --test-cmd <TEST_CMD> Override test command directly instead of inferred per-ecosystem commandscodeknife dossier
Section titled “codeknife dossier”Focused, token-budgeted repository or target dossier for LLM reasoning
Usage: codeknife dossier [OPTIONS]
Options: --target <TARGET> Focus target: relative file path, suffix, function name, or qualified symbol --top <TOP> Maximum root-cause work orders to include [default: 8] --budget <BUDGET> Character budget ceiling for code excerpts [default: 12000] --coverage <COVERAGE> Optional coverage report pathcodeknife reuse
Section titled “codeknife reuse”Pre-write Reuse Oracle: find existing functions/types matching an intent or snippet
Usage: codeknife reuse [OPTIONS] <QUERY>
Arguments: <QUERY> Natural-language intent or keyword query describing what you need
Options: --lang <LANG> Optional language filter (rust, ts, js, python, go) --snippet <SNIPPET> Optional code snippet for structural similarity matching --top <TOP> Maximum number of candidates to return [default: 8]codeknife verify
Section titled “codeknife verify”Single-call end-to-end verification pipeline (optional fix -> strict check -> smart test)
Usage: codeknife verify [OPTIONS]
Options: --fix Apply deterministic zero-LLM fixes (`codeknife fix --write --verify`) before checking --aggressive Include aggressive fixes when `--fix` is enabled --toolchains Also invoke native ecosystem formatters/fixers when `--fix` is enabled --skip-tests Skip running scoped test commands after static checks --test-cmd <TEST_CMD> Explicit test command override for smart test verification --coverage <COVERAGE> Optional coverage report pathcodeknife mcp
Section titled “codeknife mcp”Start native stdio JSON-RPC 2.0 Model Context Protocol (MCP) server
Usage: codeknife mcp [OPTIONS]codeknife score
Section titled “codeknife score”Compute 0–100 repository health scorecard and track `.codeknife/history.jsonl` trends
Usage: codeknife score [OPTIONS]
Options: --record Record this scorecard snapshot into `.codeknife/history.jsonl` --history <HISTORY> Number of recent history snapshots to load for delta and sparkline trend [default: 10] --coverage <COVERAGE> Optional coverage report path