Skip to content

Implement x402-config CLI tool#4

Merged
juntao merged 3 commits intomainfrom
feat/x402-config
Jan 31, 2026
Merged

Implement x402-config CLI tool#4
juntao merged 3 commits intomainfrom
feat/x402-config

Conversation

@juntao
Copy link
Member

@juntao juntao commented Jan 31, 2026

Summary

Implement the x402-config CLI tool for managing x402 configuration.

Commands

  • show - Display all current configuration
  • get <KEY> - Get specific config value
  • set <KEY> <VALUE> [...] - Set one or more config values
  • use-network <PROFILE> - Apply predefined network profile (base-sepolia, base-mainnet, etc.)
  • list-networks - List available network profiles
  • list-keys - List all valid config keys

x402-common additions

  • Config::get() and Config::set() for key-path access (e.g., "network.rpc_url")
  • Config::valid_keys() listing all valid config keys
  • Config::check_network_config() for detecting missing required config
  • MissingConfigPrompt struct for JSON error output to stderr

Test plan

  • cargo build --release -p x402-config
  • cargo test --all
  • cargo clippy --all -- -D warnings
  • cargo fmt --all -- --check
  • x402-config --help shows usage
  • x402-config list-networks shows all profiles
  • x402-config use-network base-sepolia applies profile
  • x402-config show displays config
  • x402-config get network.rpc_url returns value

Generated with Claude Code

Juntao Yuan and others added 3 commits January 31, 2026 04:43
Features:
- show: Display all current configuration
- get <KEY>: Get specific config value
- set <KEY> <VALUE> [...]: Set one or more config values
- use-network <PROFILE>: Apply predefined network profile
- list-networks: List available network profiles
- list-keys: List all valid config keys

Also adds to x402-common:
- Config::get() and Config::set() for key-path access
- Config::valid_keys() listing all config keys
- Config::check_network_config() for missing config detection
- MissingConfigPrompt struct for JSON error output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Load wallet.path and wallet.password_file from config
- Add --config/-c flag for custom config path
- Use x402_common::Result instead of anyhow
- Remove anyhow dependency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Guides agent through:
1. Check if configuration exists
2. Ask user which network to use
3. Apply network profile with x402-config
4. Verify configuration
5. Get wallet address and inform user to fund it

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@juntao juntao merged commit b999590 into main Jan 31, 2026
11 checks passed
@juntao juntao deleted the feat/x402-config branch January 31, 2026 06:11
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