Skip to content

fix(cli): make the documented invocation the real one; regenerate CLI reference; release 0.6.0 - #238

Merged
imran-siddique merged 3 commits into
mainfrom
fix/cli-flat-commands
Jul 27, 2026
Merged

fix(cli): make the documented invocation the real one; regenerate CLI reference; release 0.6.0#238
imran-siddique merged 3 commits into
mainfrom
fix/cli-flat-commands

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

Stacked on #237. Merge that one first; this branch contains its two commits and the diff collapses once it lands.

The bug

Every CLI command was attached to a redundant second manifest group. The real invocation was:

manifest manifest verify signed.json

while the README, the docs site, the PyPI long description, and cli.py's own module docstring all printed:

manifest verify signed.json

Anyone following the published quickstart hit Error: No such command 'keygen' on step one. tests/test_cli.py invoked the nested form, which is why CI stayed green over a CLI nobody could drive as documented.

What changed

Commands are top level, as documented. The nested spelling still resolves, is hidden from --help, and prints a deprecation warning (removal in 1.0), so any script written against 0.5.0 keeps working. test_documented_commands_are_top_level and test_deprecated_nested_invocation_still_works pin both halves.

The CLI reference is generated, not written. docs/api-reference/cli.md had drifted into fiction: it documented keygen --out/--print-pub, verify --revocation-url/--min-slsa-level, create --agent-id/--issuer/--model/--ttl-hours, and revoke --crl-file/--key-file, none of which exist, while omitting the options that do. It now renders from click's own help via scripts/gen_cli_reference.py, following the same committed-generated-file pattern as tests/vectors. test_cli_reference.py fails if the committed page drifts from the code.

Help output is readable. \b markers stop click rewrapping the example blocks onto a single line, and -o/--output, --enforce-hitl, --enforce-attestation have help text instead of appearing bare.

Two more examples that could not have worked. docs/operations/key-rotation.md used the non-existent manifest keygen --out ... --print-pub. docs/index.md and python/README.md printed manifest verify without --public-key next to a # VALID comment, but with no trusted key the verifier fails closed as UNVERIFIABLE and exits 1.

Release

Version bumped to 0.6.0. Minor rather than patch: the crypto-profile check from #237 can turn a previously VALID manifest into MISMATCH (a post-quantum profile carrying a classical-only signature), and the command surface moved.

Publishing is tag-driven (python-v* -> OIDC trusted publish), so after merge: git tag python-v0.6.0 && git push origin python-v0.6.0.

Verification

Not argued from reading the code. The documented quickstart was run verbatim against a clean venv with the built 0.6.0 wheel installed from dist/:

manifest --version                  -> manifest, version 0.6.0
manifest keygen -d ./keys/          -> Generated key pair in keys/
manifest create config.json -o draft.json
manifest sign draft.json --key keys/private.hex -o signed.json
manifest verify signed.json --public-key keys/public.hex   -> "result": "VALID", exit 0

manifest revoke, manifest attest, and manifest keygen -d keys/new/ were run the same way.

  • pytest: 617 passed, 18 skipped; coverage 84.55% (gate 80%)
  • mypy src/agent_manifest: clean, 20 files
  • ruff check src/ tests/ --select E,F,W --ignore E501: clean
  • bandit: 0 findings
  • python -m build + twine check dist/*: both artifacts PASSED

imran-siddique and others added 3 commits July 26, 2026 17:24
Every command was attached to a redundant second `manifest` group, so the
real invocation was `manifest manifest verify signed.json` while the
README, the docs site, the PyPI description, and this module's own
docstring all printed `manifest verify signed.json`. Anyone following the
published quickstart hit `Error: No such command 'keygen'` on the first
step. tests/test_cli.py invoked the nested form, which is why CI stayed
green over a CLI nobody could drive as documented.

Attach the commands to the top-level group. The nested spelling still
resolves, is hidden from --help, and prints a deprecation warning; it goes
away in 1.0.

Also makes help output readable: \b markers stop click rewrapping the
example blocks onto one line, and -o/--output, --enforce-hitl and
--enforce-attestation carry help text instead of appearing bare.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The hand-written reference had drifted into fiction. It documented
`manifest keygen --out/--print-pub`, `manifest verify
--revocation-url/--min-slsa-level`, `manifest create
--agent-id/--issuer/--model/--ttl-hours` and `manifest revoke
--crl-file/--key-file`, none of which exist, while omitting the options
that do.

Render the page from click's own help text, following the same
committed-generated-file pattern as tests/vectors. test_cli_reference.py
regenerates it in memory and fails if the committed copy drifts, so a
change to a command cannot land with stale docs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
key-rotation.md used `manifest keygen --out ... --print-pub`, neither flag
of which exists. index.md and python/README.md printed `manifest verify`
without --public-key next to a `# VALID` comment, but with no trusted key
the verifier fails closed as UNVERIFIABLE and exits 1.

Every CLI invocation in the docs has now been executed against a clean
install of the 0.6.0 wheel.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@imran-siddique
imran-siddique force-pushed the fix/cli-flat-commands branch from 1e7072b to 2ce5d29 Compare July 27, 2026 00:24
@imran-siddique
imran-siddique merged commit 5bf5009 into main Jul 27, 2026
13 checks passed
@imran-siddique
imran-siddique deleted the fix/cli-flat-commands branch July 27, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant