Skip to content

fix(cli): add --execute to help examples and test documented examples - #20

Open
thebrandonlucas wants to merge 1 commit into
masterfrom
docs/help-examples-execute
Open

thebrandonlucas wants to merge 1 commit into
masterfrom
docs/help-examples-execute

Conversation

@thebrandonlucas

@thebrandonlucas thebrandonlucas commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Stack: this PR ← #22 ← #24 ← #19 ← #26 ← #27 ← #28 ← #29 (bottom; targets master).

Summary

  • The payments receive and wallets create help examples now pass --execute. Before, copying them only described the request and exited 6.
  • A new unit test parses every voltage example through the real command tree. It reads the README's shell blocks and every Examples: line in each command's long help. A non-GET example must pass --execute or --dry-run. Placeholder IDs (WALLET_ID, ORG_ID, …) stand in for UUIDs.

Stack: master ← #15 ← this PR ← README landing page (#21). Part of docs/plans/07-cli-docs PR 1.

Verification

  • cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked, python3 scripts/check-coverage.py
  • The test fails when --execute is removed from the receive example, and when a README example has a misspelled flag (--dyr-run).

tee8z
tee8z previously approved these changes Oct 9, 2026
The payments receive and wallets create help examples left out --execute,
so copying them only described the request and exited 6. Both now pass
--execute.

A unit test now parses every voltage line in the user docs' shell blocks
and every Examples line in each command's long help through the real
command tree. Placeholder IDs stand in for UUIDs. An example that is not a
GET must pass --execute or --dry-run, so a documented change cannot
silently stop at a description again. It covers every user doc and the
development guide, in sh, bash, shell, and console fences at any indent.

The README was a 240-line manual. It is now a 92-line landing page: the
Voltage logo (light and dark variants from the brand guide), a one-line
pitch, three reasons to use it, install, a quick start that ends in a
payment, a scripting example with the key exit codes, and a table of docs.
Everything else moves, mostly verbatim, into docs/ by kind: guides
(install, login and profiles, payments, requests, checkout, scripting),
reference (output, exit codes), and concepts (the safety model), with an
index at docs/README.md. The note on docs/plans moves to AGENTS.md.

A new test checks that each relative link and HTML image path reaches an
existing file, and each anchor an existing heading outside code fences.
The development guide's staging receive example now passes --execute.
@thebrandonlucas
thebrandonlucas force-pushed the docs/help-examples-execute branch from 8857782 to 38915c6 Compare October 19, 2026 19:19

@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, just some minor suggestions/questions

Comment thread docs/concepts/safety-model.md
Comment thread docs/guides/payments.md
## Receive and send

```sh
voltage payments receive --profile prod --wallet WALLET_ID \

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.

can we default "unit" and "currency" to be in the given wallet's currency and base unit when they are not set?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, the only awkwardness is the need to make two calls when you don't explicitly pass --currency because the currency isn't on the wallet but on the LoC: #55

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.

2 participants