镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat(cli): show examples and a guide link in every command's help - #27

Merged
thebrandonlucas merged 1 commit into
masterfrom
feat/cli-help-examples
Oct 20, 2026
Merged

thebrandonlucas merged 1 commit into
masterfrom
feat/cli-help-examples

Conversation

@thebrandonlucas

@thebrandonlucas thebrandonlucas commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Stack: master ← #26 ← #27 ← #28 ← #29 ← #30 ← #55 ← #60. #20, #22, #57, #24 and #19 are merged.

Help Before After
Examples payments send, payments receive, wallets create Every command that changes something and every alias, plus login, auth import-key, profiles create, context, convert, payments get --wait, checkout events watch; each under a # comment
-h Usage, options, and all notes Usage and options only
--help Same as -h Adds notes, examples, and Learn more:
Guide link None Learn more: https://github.com/voltagecloud/voltage-cli/blob/<ref>/docs/<guide>
Root help Commands and options Adds common commands, the --execute rule, and a docs link

Docs ref: build.rs makes one decision for --version and the links. A clean build of a release tag links v<version>; any other build, including one without a git checkout, links master. The root docs link and every Learn more link use the same ref.

Examples live in one table keyed by OperationId (endpoint_examples) plus local_examples for the CLI's own commands, so the parse test and help share one source. -h no longer shows the friendly-flag requirements; they appear under --help.

Tests:

  • Every non-GET operation and payment alias has at least one commented example in --help.
  • Every command's Learn more link names a page that exists under docs/, and the ref is master or v<version>, the same for the root link.
  • -h shows no notes.
  • The existing parse test reads commented, multi-line examples and drops redirections, so every help example still parses and every change passes --execute or --dry-run. feat(cli)!: remove --dry-run, and describe every help example offline #30 also runs every help example offline.

Changes after review

  • checkout sessions create: the example read @session.json and wrote --output-file session.json, so it always failed with "File exists". It now reads @session-request.json.
  • wallets policies: the round trip sent the CLI's output envelope back as the policy body. It now saves only the policies: voltage wallets policies get WALLET_ID --profile prod --json | jq .data > policies.json. The wallets guide says the same.
  • Links: before, every build linked blob/v0.1.0, a tag that has no guides, so every link failed. See "Docs ref" above.
  • The arms use OperationId:: paths instead of a function-scope glob import.
  • Wording: "without creating a payment", and CREDIT_LINE_ID as in the other examples.

Checks

On 37b663d:

  • cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata: pass.
  • cargo test --locked: 99 unit and 86 integration tests pass. VOLTAGE_BLESS=1 cargo test --locked leaves the tree clean.
  • python3 scripts/check-coverage.py: pass.
  • CRAP (scripts/crap-report.sh): no function at or above 20. Highest is api::wait_for_payment at 19.24, unchanged from or lower than master (19.66).
  • Skill review: voltage-pr-review and the voltage-backend-engineering Rust checklist, against the stack base. Findings are fixed in this commit.

Not run: the staging and live tutorials, which need credentials.

@thebrandonlucas
thebrandonlucas added this pull request to stack #25 October 13, 2026 19:03
@thebrandonlucas
thebrandonlucas force-pushed the feat/cli-help-examples branch 2 times, most recently from 15a2ea8 to 8ba12a3 Compare October 19, 2026 18:25
@thebrandonlucas
thebrandonlucas force-pushed the feat/cli-help-examples branch 2 times, most recently from 5fe8242 to cbe2165 Compare October 19, 2026 19:11
@thebrandonlucas
thebrandonlucas removed this pull request from stack #25 October 20, 2026 11:59
@thebrandonlucas
thebrandonlucas added this pull request to stack #58 October 20, 2026 11:59
tee8z
tee8z previously approved these changes Oct 20, 2026

@tee8z tee8z left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Two suggestions below, neither blocking. CRAP on 2d41d78: no function at or above 20, highest api::wait_for_payment at 19.24; the full test suite passed in the same run.

Comment thread src/cli.rs Resolved
Comment thread src/cli.rs Resolved
@thebrandonlucas
thebrandonlucas dismissed tee8z’s stale review October 20, 2026 16:12

The merge-base changed after approval.

@tee8z
tee8z self-requested a review October 20, 2026 16:13
tee8z
tee8z previously approved these changes Oct 20, 2026
tee8z
tee8z previously approved these changes Oct 20, 2026
Base automatically changed from docs/cli-guides to master October 20, 2026 16:51
Every command that changes something now has examples in --help, each
under a # comment that says what it does, as do login, auth import-key,
profiles create, context, convert, payments get --wait, and checkout
events watch.

-h stays short: usage and options. --help adds the notes (request body,
friendly flags, scope, feature requirement, examples) and a Learn more link
to the command's guide in the docs of the running release. The root help
lists common commands and links the documentation.

Tests require an example for every change command and every alias, a
Learn more link on every command that names an existing docs page, and no
notes under -h.
@thebrandonlucas
thebrandonlucas dismissed tee8z’s stale review October 20, 2026 16:51

The merge-base changed after approval.

@tee8z
tee8z self-requested a review October 20, 2026 16:52
@thebrandonlucas
thebrandonlucas merged commit e6e3bb4 into master Oct 20, 2026
6 checks passed
@thebrandonlucas
thebrandonlucas deleted the feat/cli-help-examples branch October 20, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human review wanted CI passes; ready for a human reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants