Chock.sh Build your plugin

CLI reference

chock gate-log

Ask the user before running chock gate-log: what it takes and prints, from the engine at the pinned commit.

Alias of: status --only log

Syntax

This is the usage line argparse builds from this command's parser.

chock gate-log [-h] [--repo REPO] [--policy POLICY] [--since DAYS] [--route {sync,plugin}]
               [--level {info,debug}] [--verdict {allow,block,ask,warn,off}]
               [--plugin PLUGIN] [--follow] [--json] [--by {policy,rule,agent,event}]
               [--format {text,md}]

Arguments and options

The table lists every argument the parser declares, except -h, --help, written as argparse prints it. Default is the value the parser uses when you leave the option out. It is empty for a flag or when the parser sets none.

ArgumentDefaultHelp
--repo REPO.Repository root (default: cwd)
--policy POLICYRestrict the report to one policy id
--since DAYSOnly records from the last N days
--route one of: sync, pluginOnly the sync route (this repo) or the plugin route (~/.chock)
--level one of: info, debugInfo: only decisions a policy made; debug: allows too
--verdict one of: allow, block, ask, warn, offOnly records with this verdict
--plugin PLUGINOnly records from this plugin (plugin route)
--followPrint new records as they are written (Ctrl-C stops)
--jsonEmit machine-readable results
--by one of: policy, rule, agent, eventGroup counts by policy, rule, agent or event
--format one of: text, mdtextMd prints a paste-able markdown summary

Exit codes

  • 2: argparse rejected the arguments, for example an option this command does not have. The site's tests run every command with an unknown option and check that it exits 2.
  • Chock documents no other exit codes. Each example below shows the code its run returned.

Examples

Real runs, recorded by python -m sitegen.cliexamples with the engine at the pinned commit. The steps of data/cli-examples.yaml ran in order, offline, in one fresh git repository at /work/demo (made with git init -b main), with HOME at /home/demo. Those paths stand for the throwaway folders the runs used, and <time> stands for a timestamp. Output is stdout and stderr together.

Step 21 of 21, exit code 0.

$ chock gate-log
policy      surface       events  allow  block    ask   warn  last block
chock-stop  unknown            1      1      0      0      0  never

Never recorded (1): my-block-marker
Advisory policies emit no runtime event, so absence here is not evidence of a gap.

Help as printed

This is what --help prints, from the same parser. The usage line names the program as the engine's parser does.

usage: chock status --only log [-h] [--repo REPO] [--policy POLICY] [--since DAYS]
                               [--route {sync,plugin}] [--level {info,debug}]
                               [--verdict {allow,block,ask,warn,off}] [--plugin PLUGIN] [--follow]
                               [--json] [--by {policy,rule,agent,event}] [--format {text,md}]

Read the decision log, both routes

options:
  -h, --help            show this help message and exit
  --repo REPO           Repository root (default: cwd)
  --policy POLICY       Restrict the report to one policy id
  --since DAYS          Only records from the last N days
  --route {sync,plugin}
                        Only the sync route (this repo) or the plugin route (~/.chock)
  --level {info,debug}  info: only decisions a policy made; debug: allows too
  --verdict {allow,block,ask,warn,off}
                        Only records with this verdict
  --plugin PLUGIN       Only records from this plugin (plugin route)
  --follow              Print new records as they are written (Ctrl-C stops)
  --json                Emit machine-readable results
  --by {policy,rule,agent,event}
                        Group counts by policy, rule, agent or event
  --format {text,md}    md prints a paste-able markdown summary

Built from engine 5a4b6287a46e and catalog 1e60d211c1bb.