Skip to content

CLI Reference

Anvil v1 operates on the current working directory. There is no --target-dir flag; run Anvil from the repository or project directory you want to scaffold. This keeps agent-assisted adoption explicit: the agent must inspect where it is before writing files.

CommandPurpose
`anvil init —lang <typescriptgolang
anvil init --dry-run --lang <language>Preview generated changes without writing.
anvil init --non-interactive --lang <language>Run without prompts; explicit opt-in only. Conflicts exit non-zero without writing.
anvil doctorCheck generated tooling health and apply safe fixes.
anvil --versionPrint the installed Anvil version.
anvil -VCommander short form for --version.

init requires --lang and accepts exactly typescript, golang, or python.

Use --dry-run before adopting an existing repository to preview creates and updates without writing to disk. Dry-run uses the same render path as a real scaffold, so it is a meaningful preview rather than a separate approximation.

Use --non-interactive only when you intentionally want headless behavior. If conflicts are found, Anvil reports them and exits without writing any files. That is the safe mode for automation and coding agents: no silent prompt defaults, no blind overwrites.

doctor verifies generated lint and quality configuration. It applies non-destructive fixes and reports issues that need manual review. Use it when .anvil.lock, generated hooks, lint configuration, or validation targets appear to have drifted.

CommandCodeMeaning
anvil init0Scaffold succeeded, including no-op or skipped files.
anvil init1Scaffold failed, including conflicts in non-interactive mode.
anvil init --dry-run0Preview printed without writing.
anvil doctor0Checks passed, possibly after safe fixes.
anvil doctor1Unresolved generated-tooling issues remain.
anvil --version0Version printed.