Docs
CLI reference
CLI reference
The govai command is shipped with the aigov-py Python package in this repository (python/pyproject.toml, implementation python/aigov_py/cli.py). Install from PyPI (pin the version in CI to match your action pin):
Run govai --help and govai <command> --help for the exact flags for your installed version.
CLI command catalog
Search commands — click copy to use in your terminal.
CI gates
Commands used in release and compliance pipelines.
govai checkGET /compliance-summary — exit 0 only on VALID.govai verify-evidence-packDigest + optional export cross-check against hosted ledger.govai submit-evidence-packReplay CI evidence JSON to POST /evidence.
Evidence packs
govai evidence-pack initStarter run JSON + digest manifest.govai preflightLocal validation before submit.
Read APIs via CLI
govai compliance-summaryPrint authoritative verdict JSON.govai export-runExport run artefacts for audit review.
Global flags (root parser)#
| Flag | Env / config | Purpose |
|---|---|---|
--version / -V | — | Print package version and exit. |
--config | .govai/config.json or GOVAI_CONFIG | Path to JSON config. |
--audit-base-url | GOVAI_AUDIT_BASE_URL (and config) | Audit HTTP base URL. |
--api-key | GOVAI_API_KEY (and config) | Bearer token for gated audit routes. |
--project | GOVAI_PROJECT / X_GOVAI_PROJECT | Sets X-GovAI-Project header (metadata only; does not select tenant). |
--timeout | GOVAI_TIMEOUT_SEC (default 30) | HTTP timeout in seconds. |
--compact-json | — | Single-line JSON for selected commands (for example compliance-summary). |
Exit codes (python/aigov_py/cli_exit.py)#
| Code | Constant | Meaning |
|---|---|---|
| 0 | EX_OK | Success. For govai check / verify-evidence-pack, success implies VALID verdict when checking verdict. |
| 1 | EX_ERR | Transport, HTTP failure, parse failure, digest/export mismatch, or unexpected error. |
| 2 | EX_INVALID | Compliance verdict INVALID. |
| 3 | EX_BLOCKED | Compliance verdict BLOCKED. |
| 4 | EX_USAGE | CLI usage error (including argparse errors). |
Note: govai check help text documents exit 4 as “usage”; infrastructure failures use exit 1 (see parser docstrings in cli.py).
govai check#
Queries GET /compliance-summary for the run and exits 0 only if the verdict is VALID.
- Positional or
--run-id: run UUID (alsoGOVAI_RUN_ID/RUN_ID). --verify-artifacts <dir>: After verdict check, requireevidence_digest_manifest.jsonunderdirto match hostedGET /bundle-hash(artefact continuity).
Does not alone prove full CI artefact binding; for release gates prefer verify-evidence-pack (and the composite GitHub Action). See github-action.md.
govai verify-evidence-pack#
Hosted gate for CI artefacts:
- Requires
--path <dir>withevidence_digest_manifest.jsonand<run_id>.json. - Compares manifest digest to hosted
GET /bundle-hash(events_content_sha256). --require-export: fail ifGET /api/export/:run_idcross-check cannot be performed or disagrees with/bundle-hash.--artifact-file: optional on-disk promoted model file; verifies SHA256 against bundle payload when provided.
Evidence pack generation#
| Command | Purpose |
|---|---|
govai evidence-pack init | Writes <run_id>.json and evidence_digest_manifest.json under --out (default evidence_pack/). --run-id optional (CI-deterministic on GitHub Actions; else UUID). --force to overwrite. |
Related:
govai submit-evidence-pack— POST every event from<dir>/<run_id>.jsontoPOST /evidence.govai preflight— Local validation and optional--with-submitagainst the audit service (see--help).
Report generation#
| Command | Purpose |
|---|---|
govai report | Renders docs/reports/<run_id>.md from evidence / bundle inputs (see govai report --help). |
Other documented customer paths (non-exhaustive)#
The CLI exposes additional subcommands (init, export-run, compliance-summary, usage, discovery, policy, standards, …). Only document commands you use; this page lists those explicitly tied to public docs and CI gates in this repository.
CI integration#
- Composite action and pins:
github-action.md - Artefact-bound gate:
submit-evidence-packthenverify-evidence-packwith--require-exportby default in the published action.
Related#
- Quickstart:
customer-quickstart.md,quickstart-5min.md - Hosted deployment:
hosted-backend-deployment.md - HTTP contract:
api-reference.md