Skip to content

Convert x402 sign command to use positional argument#69

Merged
jancurn merged 3 commits intomainfrom
claude/remove-x402-r-flag-KVPqu
Mar 15, 2026
Merged

Convert x402 sign command to use positional argument#69
jancurn merged 3 commits intomainfrom
claude/remove-x402-r-flag-KVPqu

Conversation

@jancurn
Copy link
Member

@jancurn jancurn commented Mar 13, 2026

Summary

Refactored the x402 sign command to accept the PAYMENT-REQUIRED header as a positional argument instead of a required -r flag, improving the command's usability and consistency with CLI conventions.

Key Changes

  • Changed x402 sign command signature from sign -r <base64> to sign <payment-required>
  • Converted the -r, --payment-required required option to a positional argument parameter
  • Updated the action handler to receive paymentRequired as the first parameter instead of accessing it from opts
  • Removed -r and --payment-required from the OPTIONS_WITH_VALUES parser configuration
  • Updated test cases to reflect the new positional argument syntax
  • Updated CLI help text and documentation to show the new command format

Implementation Details

  • The positional argument is now passed directly to the action handler as paymentRequired, eliminating the need for the -r flag
  • All other options (--amount, --expiry) remain as optional flags
  • Parser validation tests were updated to verify the new syntax works correctly
  • The change is documented in CHANGELOG.md as a breaking change in the command interface

https://claude.ai/code/session_018NNkSjHsJrLhG1cAgdmdvY

claude and others added 3 commits March 12, 2026 23:45
The PAYMENT-REQUIRED header is the only required input for the sign
command, so a positional argument is simpler and less redundant than
a required option flag.

https://claude.ai/code/session_018NNkSjHsJrLhG1cAgdmdvY
@jancurn jancurn merged commit ee4d140 into main Mar 15, 2026
6 checks passed
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.

3 participants