Commands
| Command | Does |
|---|---|
rulecast init |
Set rulecast up: config, catalog rules, your existing git hooks as rules, agent hooks |
rulecast install / uninstall |
Add (or upgrade) or remove the agent hooks |
rulecast run |
Check staged files (the default), changed files, or everything |
rulecast baseline |
Record today’s findings, so full-repo runs fail only on new ones |
rulecast fix |
Apply regex and ast-grep rules’ fixes; --dry-run prints the diff |
rulecast list |
Show every configured rule: where it comes from, what it matches, what it cites |
rulecast test |
Run each rule’s good/bad examples; --against says how much it would flag |
rulecast stats |
Per-rule outcomes from agent sessions: fired, fixed, ignored, noisy |
rulecast validate |
Check the config (and a rules manifest) and print diagnostics |
rulecast doctor |
Compile, check the environment and hooks, dry-run every rule; --ci fails on a setup that would run degraded |
rulecast autoupdate |
Move pinned rule repos to their latest tag |
rulecast try-repo |
Run a rule repo against your project without configuring it |
rulecast clean |
Delete the cache |
rulecast warm |
Build detector caches ahead of time |
rulecast hook <adapter> |
Answer an agent hook on stdin (the agent runs this, not you) |
rulecast <command> --help prints a command’s flags; rulecast --version prints the version.
Exit codes
Section titled “Exit codes”rulecast run, rulecast try-repo and rulecast fix (after its fixes) exit with:
| Code | Meaning |
|---|---|
0 |
Every rule ran; no new error-severity findings (warnings and pre-existing findings allowed) |
1 |
Every rule ran; at least one new error-severity finding |
2 |
rulecast could not run: usage, a config file that does not load, git, or an internal error |
3 |
Incomplete: a rule failed to compile, a rule repo could not be fetched, a detector failed or timed out. Findings that were produced are still reported. Wins over 1 |
On 2 nothing is printed to stdout. try-repo also exits 2 when the repo it tries cannot be fetched. Other commands use 2 for the problems they find. --format json and --format sarif are a stable contract, with an id per finding that survives code moving around: see agents/reference/output.md.