CLI reference
The Critiq CLI exposes repository checks and rule-authoring commands with pretty terminal output and automation-safe JSON.
#Usage
#Commands
| Command | Purpose |
|---|---|
| critiq check | Scan a repository, directory, or single file with the active Critiq catalog. Also runs an advisory secret-pattern scan whose output does not change the check exit code. |
| critiq audit | Parent command for dedicated audits. Use a subcommand such as `audit secrets` to run an audit with its own exit code; on its own, prints help. |
| critiq audit secrets | Run only the text-based secret-pattern scanner and exit non-zero when secret findings exist. |
| critiq rules validate | Validate rule YAML contract and semantic checks before relying on rules in automation. |
| critiq rules test | Run fixture-backed rule specs to prove expected rule behavior. |
| critiq rules normalize | Print the canonical normalized form of one concrete rule file. |
| critiq rules explain | Show parsed summary, semantic status, normalized rule, and inferred template variables. |
critiq help | Print the current help message and command syntax. |
#Exit codes
0success.1findings, user/input errors, or validation diagnostics.2internal/runtime errors.- The advisory secret scan emitted by
critiq checkdoes not affect its exit code. Usecritiq audit secretswhen you want secret findings to fail the run.