CLI command

critiq rules explain

Show parsed summary, semantic status, normalized rule, and inferred template variables.

#Syntax

bash
critiq rules explain <file> [--format pretty|json]

#Arguments

  • file: Exactly one rule YAML file. Globs are not accepted.

#Flags

  • --format pretty|json: Output format. Defaults to pretty.

#Examples

bash
npx critiq rules explain .critiq/rules/security.rule.yaml
npx critiq rules explain .critiq/rules/security.rule.yaml --format json

#Defaults

  • The command requires one concrete rule file.

#JSON output

json
{
  "command": "rules explain",
  "format": "json",
  "exitCode": 0,
  "parsedSummary": {},
  "semanticStatus": {},
  "normalizedRule": {},
  "templateVariables": {},
  "diagnostics": []
}

#Exit behavior

  • 0: the rule loaded and explanation data was produced.
  • 1: invalid arguments or rule diagnostics.
  • 2: internal/runtime errors.

#Notes

  • Use this to debug how Critiq interprets message templates and captures.