Skip to content

feat(cli): accept --wallet as the wallet a wallet command acts on - #93

Merged
thebrandonlucas merged 1 commit into
fix/cli-transport-error-causefrom
feat/cli-wallet-flag-as-id
Oct 22, 2026
Merged

thebrandonlucas merged 1 commit into
fix/cli-transport-error-causefrom
feat/cli-wallet-flag-as-id

Conversation

@thebrandonlucas

@thebrandonlucas thebrandonlucas commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

A command that acts on one wallet, such as wallets get, wallets delete or wallets policies get, now also takes the wallet as --wallet ID:

$ voltage wallets get --wallet WALLET_ID      # before: error: required argument <WALLET_ID|--id <ID>>
Given Result
WALLET_ID or --id unchanged
--wallet ID only acts on that wallet
both, the same wallet acts on it
both, different wallets usage error: WALLET_ID A and --wallet B name different wallets, hint Pass the wallet once, as WALLET_ID or --wallet.
neither usage error: wallets get needs a wallet ID, hint showing both forms and voltage wallets list

Only an explicit --wallet counts. A profile's or VOLTAGE_WALLET_ID's wallet never selects the target, so a delete always names its wallet on the command line. Commands that act on something else, such as payments get, still require their own ID. Because the ID is now optional in clap, the usage line shows [WALLET_ID]; the long help says that --wallet ID names the wallet.

In the CLI benchmark, agents made this call in 3 of 12 CLI runs, and each one cost a retry. Closes #80.

Stack: 4 of 6, on #90. It doesn't depend on the PRs below it.

  • User-visible change: CHANGELOG.md (Unreleased) and docs/guides/login-and-profiles.md are updated.
  • The verification gate passes: fmt, clippy, machete, cargo test (258 tests) and check-coverage.py.
  • Reviewed against fix(cli): say why a request got no response, and what to check #90. Unit tests cover --wallet alone, both forms with the same wallet, wallets delete --wallet, differing wallets (message and hint), neither (message and hint), and payments get --wallet still requiring PAYMENT_ID.
  • CRAP on 13c62f7: 0 functions at or above 20. The highest is wait_for_payment at 19.60. The target-argument setup moved into target_args (2.0), so endpoint stays at 18.0; target_id is 3.0.
  • Checks not run: none.

@thebrandonlucas
thebrandonlucas added this pull request to stack #89 October 22, 2026 19:34
@thebrandonlucas
thebrandonlucas marked this pull request as ready for review October 22, 2026 19:37
@thebrandonlucas
thebrandonlucas force-pushed the feat/cli-wallet-flag-as-id branch from 13c62f7 to 7b29bb0 Compare October 22, 2026 20:33
tee8z
tee8z previously approved these changes Oct 22, 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.

Approved 7b29bb0 against fix/cli-transport-error-cause (#90 134f858). This change does not depend on #90, which has changes requested.

  • target_id reads only an explicit --wallet. The global --wallet flag has no clap env, and VOLTAGE_WALLET_ID and profiles are resolved later in sourced_scope, so neither can select the wallet that a wallets delete acts on. That is the right safety property.
  • Only the operations where targets_wallet() is true relax the required TargetFlags group. payments get --wallet still requires PAYMENT_ID, and a test covers it.
  • An ID and --wallet that differ, or that are both missing, are usage errors with hints, and both are tested.

Validation on this head, in nix develop: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata and python3 scripts/check-coverage.py passed. In cargo test --locked, all 138 unit tests passed. One integration test from #75, a_profile_saved_after_login_keeps_changes_made_while_its_prompt_was_open, failed once at the harness's 10-second prompt wait while other builds were running. It passed in the CRAP run's full suite and in 2 of 2 isolated reruns, and this PR does not touch it. CRAP: 626 measured functions, none at or above 20, highest wait_for_payment at 19.60; 176 functions were unmeasured. CI is green.

@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.

Re-approved b3df4d0, a rebase onto #90 e4f73a8. The patch is the one I approved as 7b29bb0, and only the CHANGELOG context differs. Validation on this head, in nix develop: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata, cargo test --locked (140 unit, 122 integration) and python3 scripts/check-coverage.py passed. CRAP: 628 measured functions, none at or above 20, highest wait_for_payment at 19.60. CI is green.

@thebrandonlucas
thebrandonlucas merged commit ef39b71 into master Oct 22, 2026
8 of 14 checks passed
@thebrandonlucas
thebrandonlucas deleted the feat/cli-wallet-flag-as-id branch October 22, 2026 21:53
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.

wallets get: accept --wallet as the wallet ID

2 participants