@clawallex/cli
v1.0.9
Published
CLI for Clawallex payment infrastructure
Downloads
245
Readme
Clawallex CLI
Command-line interface for Clawallex payment infrastructure. Manage wallets, virtual cards, and transactions for AI Agents.
Install
npm install -g @clawallex/cliQuick Start
# Configure credentials
clawallex config set --api-key <key> --api-secret <secret> --base-url https://api.clawallex.com
# Verify identity
clawallex whoami
# Check wallet balance
clawallex wallet detail
# List cards
clawallex card listCommands
Configuration
# Interactive setup (prompts for each field)
clawallex config set
# Set individual values
clawallex config set --api-key <key>
clawallex config set --api-secret <secret>
clawallex config set --base-url https://api.clawallex.com
clawallex config set --client-id <id>
# Switch output format
clawallex config set --output json # default to JSON
clawallex config set --output human # default to human-readable
# Show current config (secrets masked, shows value source)
clawallex config showIdentity
clawallex whoamiWallet
# Wallet details (balance, currency, status)
clawallex wallet detail
# Recharge addresses (wallet_id auto-fetched if omitted)
clawallex wallet recharge-addresses
clawallex wallet recharge-addresses <wallet_id>Cards
# Create card — Mode A (wallet-funded)
clawallex card create --amount 50 --card-type flash
clawallex card create --amount 200 --card-type stream
# Create card with risk controls
clawallex card create --amount 50 --card-type flash --tx-limit 10
clawallex card create --amount 50 --card-type flash --allowed-mcc "5411,5812"
# Note: --allowed-mcc and --blocked-mcc cannot be used together
# Create card — Mode B (x402 on-chain USDC), see Mode B section below
clawallex card create --mode b --amount 50 --card-type flash --token-code USDC
# List cards
clawallex card list
clawallex card list --page 1 --page-size 10
# Card balance
clawallex card balance <card_id>
# Batch card balances
clawallex card batch-balances <card_id_1> <card_id_2> <card_id_3>
# Card details (decrypts PAN/CVV)
clawallex card details <card_id>
# Update card risk controls
clawallex card update <card_id> --tx-limit 50
clawallex card update <card_id> --allowed-mcc "5411,5812"
clawallex card update <card_id> --blocked-mcc "7995,5933,5816"
# Note: --allowed-mcc and --blocked-mcc cannot be used together
# Refill card (Mode A)
clawallex card refill <card_id> --amount 30
# Submit Mode B payment (Stage 2)
clawallex card pay --payment-file <template>.jsonTransactions
# List all transactions
clawallex tx list
# Filter by card
clawallex tx list --card-id <id>
# Filter by transaction ID
clawallex tx list --card-tx-id <id>
clawallex tx list --issuer-tx-id <id>
# Pagination
clawallex tx list --page 1 --page-size 20X402 Addresses
# Payee address (for Mode B payments)
clawallex x402 payee-address --token-code USDC
clawallex x402 payee-address --token-code USDC --chain-code BASE
# Asset contract address
clawallex x402 asset-address --token-code USDCUpgrade
# Check and upgrade to latest version
clawallex upgradeThe CLI automatically checks for new versions in the background and shows a notice when an update is available.
Output Format
Default output is human-readable. Use --json for JSON output, or change the default:
# Human-readable (default)
clawallex card list
# Cards (3 total)
# ────────────────────────────────────────
# Card ID Type Status Balance
# abc-123 Flash Active 50.0000
# One-time JSON output
clawallex card list --json
# {"total":3,"page":1,"page_size":20,"data":[...]}
# Change default output format permanently
clawallex config set --output json
clawallex config set --output humanMode B: x402 On-Chain Payment
For agents with their own wallet and private key. Uses EIP-3009 transferWithAuthorization to pay USDC on-chain.
Interactive flow — the CLI generates the signing data, you just provide your wallet address and signature:
$ clawallex card create --mode b --amount 50 --token-code USDC --card-type flash
Mode B Quote (402 Payment Required)
────────────────────────────────────────
Card Amount: 50.0000
Total Fee: 1.0000
Payable: 51.0000 USDC
Payee: 0xDb79...
Asset: 0x1c7D...
Confirm? (y/n): y
Wallet address: 0x850E...
EIP-3009 Authorization (sign this with your wallet):
────────────────────────────────────────
{
"from": "0x850E...",
"to": "0xDb79...",
"value": "51000000",
"validAfter": "0",
"validBefore": "1774200000",
"nonce": "0x69794613..."
}
EIP-712 Domain:
name: USDC, version: 2, chain: ETH, verifyingContract: 0x1c7D...
Signature (0x...): 0x0c6dbe42...
Submitting payment...
Card Created (Mode B)
────────────────────────────────────────
Order ID: be057922-...
Card ID: (pending)
Status: 120Mode B refill is also interactive:
clawallex card refill <card_id> --amount 30 --mode b --token-code USDCConfiguration
Config File
Stored at ~/.clawallex/config.json (permissions 0600):
{
"apiKey": "sk_key_...",
"apiSecret": "sk_secret_...",
"baseUrl": "https://api.clawallex.com",
"clientId": "ca_...",
"outputFormat": "human"
}Environment Variables
Override config file values (higher priority):
| Variable | Field |
|----------|-------|
| CLAWALLEX_API_KEY | apiKey |
| CLAWALLEX_API_SECRET | apiSecret |
| CLAWALLEX_BASE_URL | baseUrl |
| CLAWALLEX_CLIENT_ID | clientId |
Global Options
--json JSON output (override config for this invocation)
--server <url> Override base URL for this invocation
--version Show versionDevelopment
git clone [email protected]:clawallex-group/clawallex-cli.git
cd clawallex-cli
npm install
npm run build # Compile TypeScript
npm run dev # Run directly with tsx
npm start # Run compiled version