Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

Reference

CLI reference

The Critiq CLI exposes repository checks and rule-authoring commands with pretty terminal output and automation-safe JSON.

#Usage

bash
critiq check [target] [--base <git-ref>] [--head <git-ref>] [--staged] [--format pretty|json|sarif|html]
critiq audit secrets [target] [--base <git-ref>] [--head <git-ref>] [--staged] [--format pretty|json]
critiq audit --help
critiq rules validate <glob> [--format pretty|json]
critiq rules test [glob] [--format pretty|json]
critiq rules normalize <file> [--format pretty|json]
critiq rules explain <file> [--format pretty|json]
critiq help

#Commands

CommandPurpose
critiq checkScan 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 auditParent 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 secretsRun only the text-based secret-pattern scanner and exit non-zero when secret findings exist.
critiq rules validateValidate rule YAML contract and semantic checks before relying on rules in automation.
critiq rules testRun fixture-backed rule specs to prove expected rule behavior.
critiq rules normalizePrint the canonical normalized form of one concrete rule file.
critiq rules explainShow parsed summary, semantic status, normalized rule, and inferred template variables.
critiq helpPrint the current help message and command syntax.

#Exit codes

  • 0 success.
  • 1 findings, user/input errors, or validation diagnostics.
  • 2 internal/runtime errors.
  • The advisory secret scan emitted by critiq check does not affect its exit code. Use critiq audit secrets when you want secret findings to fail the run.