Skip to content

feat(cli): generate command reference from Clap - #712

Open
jeremi wants to merge 6 commits into
mainfrom
x/relayctl-introspection
Open

feat(cli): generate command reference from Clap#712
jeremi wants to merge 6 commits into
mainfrom
x/relayctl-introspection

Conversation

@jeremi

@jeremi jeremi commented Aug 11, 2026

Copy link
Copy Markdown
Member

Pull Request

Summary

Add reusable Clap command-tree introspection for every released Evidence and Relay CLI: relay, relayctl, evidence, evidencectl, mint, and evidence-oid4vci.

A new docs-only registry-cli-docs collector serializes those command trees to a deterministic, validated JSON contract. The docs generator uses that contract to produce the command-line reference overview and 66 command pages, with exact usage, arguments, options, defaults, values, environment variables, and nested-command links.

The docs drift gate and CI change routing now keep the generated reference aligned with CLI changes. Hidden implementation seams and Clap's built-in help subcommands are excluded.

Checks

  • cargo fmt --all -- --check
  • cargo check --locked --workspace --all-targets
  • package-scoped Clippy for the collector and all six CLI packages with -D warnings
  • package test matrix for registry-cli-docs, Relay V2, Relayctl, Evidence, Evidencectl, Mint, and Evidence OID4VCI
  • cargo deny check
  • python3 .github/scripts/test_ci_changes.py
  • products/identifiers/scripts/check.sh
  • products/relay-v2/scripts/check-contracts.sh
  • products/evidence/scripts/check-contracts.sh
  • products/evidence/scripts/check-source-neutrality.sh
  • npm test and npm run check in docs/site
  • node docs/site/scripts/generate-cli-reference.mjs --check
  • git diff --check

Focused coverage verifies the exact released-binary set, complete usage/about metadata, hidden-command exclusion, deterministic regeneration, generated-file drift, MDX-safe provenance, and CLI/CI routing contracts.

Notes

This changes adopter tooling and generated documentation only. It does not change Relay or Evidence HTTP contracts, authorization, evaluation, signing, or release artifacts.

Existing non-blocking warnings remain in Redocly, Astro, Rhai syntax highlighting, Vale, and cargo-deny. No new warning or functional risk was found.

DCO

  • Every commit includes a Signed-off-by trailer.
  • I reviewed the submitted changes and am responsible for the contribution.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2898b9e8a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/ci_changes.py
Comment thread crates/registry-cli-docs/src/lib.rs Outdated
.map(ToString::to_string)
.map(|value| normalized(&value))
.unwrap_or_default(),
required: argument.is_required_set(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Clap constraints in the generated reference

Deriving required only from Arg::is_required_set() discards requirements imposed by groups and relationships. For example, evidencectl audit show requires the singleton view group, so bare show is rejected, while its generated table labels --last-operation as not required; similarly, the requires relationships among relayctl inspect options are absent. This makes the published Required column inaccurate for valid command scenarios, so the catalog should represent effective group and conditional constraints rather than only the per-argument flag.

Useful? React with 👍 / 👎.

@jeremi
jeremi force-pushed the x/relayctl-introspection branch from 2898b9e to 6a4ad08 Compare August 11, 2026 11:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a4ad0810a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


| Option | Always required | Default | Values | Environment | Description |
| --- | --- | --- | --- | --- | --- |
| `--config <CONFIG>` | Yes | n/a | n/a | `MINT_CONFIG` | n/a |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark environment-backed options as optional

When MINT_CONFIG is set, Clap accepts mint check without --config—an invocation with the variable set reaches configuration loading rather than producing a missing-argument error—yet this row says the option is always required. The same incorrect classification is generated for EVIDENCE_OID4VCI_CONFIG and RELAY_RUNTIME; derive requiredness from the effective CLI/environment alternatives rather than only Arg::is_required_set().

AGENTS.md reference: docs/site/AGENTS.md:L25-L28

Useful? React with 👍 / 👎.

Comment on lines +38 to +40
| `--openapi <OPENAPI>` | No | n/a | n/a | n/a | OpenAPI 3.0 or 3.1 document: a local path or an HTTPS URL |
| `--transport <TRANSPORT>` | No | n/a | `sqlite-extract` | n/a | Source transport to author without an API description |
| `--profile <PROFILE>` | No | n/a | `local` | n/a | Explicit development profile for local authoring |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish the required evidencectl new choices

Every evidencectl new invocation is rejected by scaffold::run unless --profile local is present and exactly one of --openapi or --transport is supplied, but this new reference marks all three options as optional and emits no Constraints section. These checks remain outside the Clap metadata even after the new group/relationship extraction, so encode them in the command tree or otherwise include the runtime validation in the generated catalog.

AGENTS.md reference: docs/site/AGENTS.md:L25-L28

Useful? React with 👍 / 👎.

Comment thread docs/site/package.json Outdated
"check:tutorial:evidence:dry-run": "bash scripts/check-evidence-tutorials.sh --dry-run",
"check:links": "npm run build && npm run check:links:built",
"check": "npm run generate && npm run check:evidence-links && npm run check:research-banners && npm run check:docset && npm run check:release-manifests && npm run check:archive-lock && npm run check:content && npm run check:cutover && npm run check:notary-surface && npm run check:markdown && npm run check:style && npm run check:style:fixtures && npm run check:openapi && npm run check:config-vocabulary && npm run check:tutorial:dry-run && npm run check:tutorial:evidence:dry-run && npm run check:svg && npm run build && npm run check:accessibility:built && npm run check:llms:built && npm run check:seo:current && npm run check:links:current",
"check": "npm run generate && npm run check:cli-reference && npm run check:evidence-links && npm run check:research-banners && npm run check:docset && npm run check:release-manifests && npm run check:archive-lock && npm run check:content && npm run check:cutover && npm run check:notary-surface && npm run check:markdown && npm run check:style && npm run check:style:fixtures && npm run check:openapi && npm run check:config-vocabulary && npm run check:tutorial:dry-run && npm run check:tutorial:evidence:dry-run && npm run check:svg && npm run build && npm run check:accessibility:built && npm run check:llms:built && npm run check:seo:current && npm run check:links:current",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check generated CLI drift before rewriting files

In the inspected .github/workflows/ci.yml docs job, the only build check is npm run check, but this script runs npm run generate before check:cli-reference; generation overwrites the committed CLI pages and JSON, so the later comparison always sees freshly generated files. A PR containing stale or hand-edited CLI output can therefore pass the docs job; run the drift check before generation or assert that generation leaves the checkout clean.

AGENTS.md reference: AGENTS.md:L289-L291

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb31796b95

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/site/package.json
## Usage

```text
evidencectl source suggest [OPTIONS]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish the required source choice

For evidencectl source suggest, this usage implies that a bare invocation is valid and the page emits no Constraints section, but suggest::load_spec rejects both the no-source case and the case where --openapi and --project are supplied together (suggest/mod.rs:288-292). Encode this required mutually exclusive choice in the Clap tree or otherwise include the runtime condition, so adopters following the generated syntax do not receive an immediate error.

AGENTS.md reference: docs/site/AGENTS.md:L25-L28

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8d3fa1888

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/site/scripts/build-archives.mjs
Comment thread crates/registry-cli-docs/src/lib.rs
@jeremi
jeremi enabled auto-merge (squash) August 11, 2026 14:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d6015be35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

label: 'Command-line interfaces',
collapsed: true,
items: [
{ label: 'Overview', slug: 'reference/cli' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate CLI sidebar links for pinned archives

When check:archives --bootstrap rebuilds v0.18.0 or another tag predating this generator, stagePinnedGeneratedArtifacts removes reference/cli/** because the pinned tree has no such files, but buildDocsetArchive still evaluates this current, unconditional sidebar. Archived pages therefore gain links to absent routes, changing the locked archive bytes and causing link or digest verification to fail; make this sidebar docset-aware or stage its definition from the same source ref.

AGENTS.md reference: AGENTS.md:L289-L291

Useful? React with 👍 / 👎.

## Usage

```text
evidencectl dev [OPTIONS] [COMMAND]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish the conditional dev syntax

When starting the local pair without a subcommand, crates/registry-evidencectl/src/dev.rs:310-312 rejects the bare form unless --detach is present, while lines 298-306 reject --detach with stop or clean. This usage and its options table advertise [COMMAND] and --detach as independently optional, so users following the generated syntax can hit an immediate runtime error; represent this conditional requirement and conflict in Clap or another catalog constraint.

AGENTS.md reference: docs/site/AGENTS.md:L25-L28

Useful? React with 👍 / 👎.

| `--client-id <CLIENT_ID>` | Yes | n/a | n/a | n/a | The `clientId` this caller is registered under |
| `--key <KEY>` | Yes | n/a | n/a | n/a | The caller's private JWK. Must be owner-only and not a symlink |
| `--audience <AUDIENCE>` | No | n/a | n/a | n/a | The endpoint's configured `clientAssertion.audience`. Defaults to `--url`, which is the usual configuration |
| `--actor <ACTOR>` | No | n/a | n/a | n/a | Request a delegated token for this actor. Requires `--subject-file` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Encode Mint's paired delegation options

When either delegation option is supplied alone, sign_client_assertion rejects it in crates/registry-mint/src/caller.rs:105-125, but this page has no Constraints section and only the --actor prose mentions one direction, leaving --subject-file alone advertised as valid syntax. Both options use plain #[arg(long)] definitions, so encode their mutual requirement in Clap or another catalog constraint.

AGENTS.md reference: docs/site/AGENTS.md:L25-L28

Useful? React with 👍 / 👎.

jeremi added 6 commits August 11, 2026 23:50
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@jeremi
jeremi force-pushed the x/relayctl-introspection branch from 7d6015b to 71f531f Compare August 11, 2026 16:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 71f531feec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

## Usage

```text
evidencectl request prepare [OPTIONS] --purpose <PURPOSE> --subject <SUBJECT> --name <NAME> <QUESTION>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the owner-only subjects-file alternative

For requests whose subject selectors are supplied in an owner-only file, this syntax is inaccurate: load_subject_inputs requires exactly one of --subject or --subjects-file (request.rs:368-375), while this page requires --subject and omits --subjects-file from the options table entirely. Readers therefore cannot discover the supported path that keeps identifying selector values out of process arguments; encode the pair as a required exclusive Clap group so regeneration publishes both forms.

AGENTS.md reference: docs/site/AGENTS.md:L25-L28

Useful? React with 👍 / 👎.

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