CLI command

critiq check

Scan a repository, directory, or single file with the active Critiq catalog.

#Syntax

bash
critiq check [target] [--base <git-ref>] [--head <git-ref>] [--format pretty|json]

#Arguments

  • target: Repository, directory, or file to scan. Defaults to ..

#Flags

  • --base <git-ref>: Base ref for a diff-scoped run.
  • --head <git-ref>: Head ref for a diff-scoped run.
  • --format pretty|json: Output format. Defaults to pretty.

#Examples

bash
npx critiq check .
npx critiq check src/api --format json
npx critiq check . --base origin/main --head HEAD

#Defaults

  • target defaults to ..
  • .critiq/config.yaml is loaded when present.
  • Diff mode requires both --base and --head.
  • Legacy critiq check "<rules-glob>" . usage is rejected.

#JSON output

json
{
  "command": "check",
  "format": "json",
  "exitCode": 1,
  "findings": [],
  "diagnostics": []
}

#Exit behavior

  • 0: scan completed without findings or user errors.
  • 1: findings, user/input errors, or validation diagnostics.
  • 2: internal/runtime errors.

#Notes

  • TypeScript and JavaScript have the deepest support today.
  • Go, Java, PHP, Python, Ruby, and Rust have narrower phase-one adapter coverage.