@stablecoin.xyz/cli
v0.3.0
Published
Official CLI for the SBC Agent Stack — auth, balance, payments, agents, seller endpoints, and SBC/cfUSD tokens
Maintainers
Readme
SBC Agent Stack CLI
Official terminal interface for SBC Agent Payments — authenticate agents and users, check balances, pay x402 / MPP seller URLs, send SBC or cfUSD, and manage seller endpoints from the command line.
Package: @stablecoin.xyz/cli · Binary: sbc · Node.js: 20+
Install
npm install -g @stablecoin.xyz/cliOr from source:
git clone https://github.com/stablecoinxyz/sbc-cli.git
cd sbc-cli
npm install && npm run build && npm linkQuickstart
1. Log in as a user
Generate a user key in the dashboard → Settings → CLI access → Generate key.
sbc auth user login --user-key sk_user_YOUR_KEY
sbc user whoami2. Log in as an agent
Create an agent and generate an API key on the agent detail page → API Keys → + New Key.
sbc agent login --agent-key sk_live_YOUR_KEY
sbc whoamiAgent login resolves the agent ID, chain, wallet, and token from the API key automatically via
GET /api/agents/me.
3. Pay, send, manage
# Check balances (SBC / cfUSD / USDC / USDGLO by chain; SOL on Solana)
sbc balance
sbc balance --token USDC
# Pay a seller URL (x402 or MPP — amount and token set by the seller)
sbc pay --url "https://api.example.com/data"
# Send tokens (0x on EVM; base58 on Solana)
sbc send --to 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0 --amount 1.5
sbc send --to 2n8raTjTnhoqsXUJ7xWv6jgE7SP2wtktMumGuXaNonay --amount 1 --token SBC
# Same-chain or Base↔Solana swap
sbc swap --from USDC --to SBC --amount 10
sbc swap --from SBC --to cfUSD --amount 5 --from-chain base --to-chain solana
# Dual-VM home switch (Para Base↔Solana agents)
sbc agent set-home --chain solana
# Fetch platform manifest
sbc manifest
# List your agents
sbc agent list
# List your seller endpoints
sbc endpoint listSupported tokens: SBC on all chains; cfUSD and USDC on Base and Solana; USDGLO on Base (balance / same-chain swap in). Send is SBC/cfUSD. Swap pairs match AgentPayments; use --from-chain / --to-chain for companion same-chain or Base↔Solana cross-chain. Radius swap stays disabled until the platform enables it.
Add --output json to any command for machine-readable output.
Commands
Authentication
Login/logout are user-scoped by default. Agent auth lives under an explicit agent path.
User (saves/removes sk_user_…):
| Command | Description |
|---------|-------------|
| sbc login | Log in as a user (save user key) |
| sbc logout | Log out the user. Add --all to also remove the agent key (full sign out) |
| sbc auth login / sbc auth logout | Same as above |
| sbc user login / sbc user logout | Same as above |
| sbc user auth login / sbc user auth logout | Same as above |
| sbc auth user login / sbc auth user logout | Same as above |
Agent (saves/removes sk_live_… + agent ID):
| Command | Description |
|---------|-------------|
| sbc agent login / sbc agent logout | Log in / out as an agent |
| sbc agent auth login / sbc agent auth logout | Same as above |
| sbc auth agent login / sbc auth agent logout | Same as above |
| sbc user agent login / sbc user agent logout | Same as above |
Whoami:
| Command | Description |
|---------|-------------|
| sbc whoami | Show all active keys and user info (summary) |
| sbc auth whoami | Same summary |
| sbc user whoami / sbc auth user whoami | Show authenticated user info via API |
| sbc agent whoami / sbc auth agent whoami | Show active agent key and agent ID |
Manage agents
All sbc agent commands require a user key (sk_user_…).
| Command | Description |
|---------|-------------|
| sbc agent list | List your agents |
| sbc agent show <id> | Show agent details, dual wallets, limits, recent transactions |
| sbc agent create | Create a new agent (--chain, --wallet-provider para|self) |
| sbc agent set-home --chain <slug> | Switch home Base↔Solana (Para dual-wallet) |
| sbc agent archive <id> | Archive an agent |
| sbc agent whoami | Show active agent key and agent ID |
| sbc agent send | Alias for sbc send |
| sbc agent pay | Alias for sbc pay |
| sbc agent swap | Alias for sbc swap |
Manage seller endpoints
All sbc endpoint commands require a user key (sk_user_…).
| Command | Description |
|---------|-------------|
| sbc endpoint list | List your seller endpoints |
| sbc endpoint show <id> | Show endpoint details |
| sbc endpoint create | Create a new endpoint with a managed wallet |
| sbc endpoint create … --tokens SBC,cfUSD | Restrict which tokens the endpoint accepts (default: all for that chain; cfUSD only on Base) |
| sbc endpoint archive <id> | Archive an endpoint |
| sbc endpoint balance <id> | Check endpoint wallet balance |
| sbc endpoint payments <id> | List payments received |
| sbc endpoint keys list <id> | List API keys for an endpoint |
| sbc endpoint keys generate <id> | Generate a new seller API key |
| sbc endpoint keys revoke <endpointId> --key-id <id> | Revoke a seller API key |
Day-to-day agent usage
| Command | Description |
|---------|-------------|
| sbc balance | Check agent balances (SBC / cfUSD / USDC / USDGLO; SOL on Solana) |
| sbc balance --token USDC | Check a single token balance |
| sbc pay --url <url> | Pay a seller URL (x402 or MPP; amount/token from 402 response) |
| sbc send --to <addr> --amount <n> | Send SBC (0x or Solana base58) |
| sbc send --to <addr> --amount <n> --token cfUSD | Send cfUSD (Base / Solana) |
| sbc swap --from USDC --to SBC --amount <n> | Same-chain swap |
| sbc swap … --from-chain base --to-chain solana | Base↔Solana cross-chain (or companion same-chain) |
| sbc transactions | List agent transaction history (requires user key — run sbc login first) |
Other
| Command | Description |
|---------|-------------|
| sbc manifest | Fetch platform /.well-known/agent.json |
Global flags
| Flag | Description |
|------|-------------|
| --output json | JSON output (pipe-friendly) |
| --output text | Human-readable text (default) |
Environment variables
| Variable | Description |
|----------|-------------|
| SBC_API_URL | Platform base URL (default: https://agents.stablecoin.xyz) |
| SBC_AGENT_KEY | Agent API key — overrides config file |
| SBC_AGENT_ID | Default agent UUID — overrides config file |
| SBC_USER_KEY | User API key — overrides config file |
Local development:
export SBC_API_URL=http://localhost:3000
sbc agent login --agent-key sk_live_...How it works
Payments (sbc pay)
sbc pay sends the seller URL to the SBC platform. The seller responds with HTTP 402 and the price; the platform signs and settles the payment (x402 permit or MPP transfer). You never pass the amount on the CLI.
Gasless send (sbc send on Base)
On Base and Base Sepolia, sbc send uses ERC-4337 account abstraction with the SBC AA proxy (api.aa.stablecoin.xyz) as both bundler and paymaster. Gas is sponsored — the agent wallet needs zero ETH. Pass --token cfUSD to send cfUSD instead of SBC (default). On Radius and Tempo, direct transfer is used (gas handled natively; SBC only). On Solana, SPL transfers require a little SOL for fees; recipient addresses are base58.
Same-chain and cross-chain swap (sbc swap)
sbc swap calls POST /api/agents/:id/swap. Same-chain pairs match AgentPayments (Base includes USDGLO→SBC/cfUSD; Solana has USDC→SBC/cfUSD and SBC↔cfUSD). Pass --from-chain / --to-chain for companion same-chain or Base↔Solana cross-chain (returns orderId). Hub redeem (*→USDC) and Radius swap are not supported yet.
Cloudflare Monetization Gateway
sbc pay is compatible with Cloudflare's Monetization Gateway, which implements x402 natively at the edge. Any Cloudflare-protected API that returns HTTP 402 can be paid directly with sbc pay --url <cloudflare-api-url>. No extra configuration needed.
Config file
Credentials are stored in ~/.sbc/config.json with permissions 0600 (owner read/write only). Use environment variables instead of the config file in CI/CD or shared environments.
Security
API key storage
- Agent keys (
sk_live_…) and user keys (sk_user_…) are stored in~/.sbc/config.jsonwith0600permissions. - Never commit your config file or keys to version control. Add
~/.sbc/to your global.gitignore. - In automated environments, pass keys via environment variables (
SBC_AGENT_KEY,SBC_USER_KEY) rather than the config file.
Key generation (platform side)
All API keys (agent, user, seller) are generated using crypto.randomBytes(32) (256 bits of entropy) and stored as SHA-256 hashes. The plaintext key is shown only once at generation time.
Reporting vulnerabilities
Please report security issues privately to [email protected]. Do not open a public GitHub issue for vulnerabilities.
Thread: common usage patterns
# --- First-time setup ---
sbc login --user-key sk_user_...
sbc agent login --agent-key sk_live_...
sbc whoami
# --- Create agents ---
sbc agent create --name "Dual Bot" --chain base --wallet-provider para
sbc agent create --name "Sol Bot" --chain solana --wallet-provider para
sbc agent list
sbc agent show <id>
# Switch home Base ↔ Solana (Para dual-wallet only)
sbc agent set-home --chain solana
sbc agent set-home --chain base
# --- Day-to-day ---
sbc balance
sbc balance --token USDC
sbc balance --token USDGLO
sbc pay --url https://api.mine.com
# Send (EVM 0x or Solana base58)
sbc send --to 0x... --amount 5
sbc send --to 0x... --amount 5 --token cfUSD
sbc send --to 2n8r... --amount 1 --token SBC
# Same-chain swap (Base)
sbc swap --from USDC --to SBC --amount 10
sbc swap --from USDGLO --to cfUSD --amount 5
sbc swap --from SBC --to cfUSD --amount 5
# Same-chain swap (Solana home)
sbc swap --from USDC --to SBC --amount 10
sbc swap --from cfUSD --to SBC --amount 5
# Companion / Base↔Solana cross-chain
sbc swap --from SBC --to cfUSD --amount 5 --from-chain base --to-chain solana
sbc swap --from USDC --to SBC --amount 10 --from-chain solana --to-chain solana
# --- Seller endpoints ---
sbc endpoint create --name "My API" --url https://api.mine.com --price 0.5 --chain base-sepolia
sbc endpoint create --name "SBC only" --url https://api.mine.com --chain base-sepolia --tokens SBC
sbc endpoint keys generate <id> --label "production"
sbc endpoint balance <id>
sbc endpoint payments <id>
# --- Switch accounts ---
sbc logout
sbc logout --all
sbc agent logout
sbc agent login --agent-key sk_live_...Contributing
See CONTRIBUTING.md
License
MIT — see LICENSE for details.
Related
- SBC Agent Payments — platform API and dashboard
- Agent manifest — capabilities descriptor
- Cloudflare Monetization Gateway — x402 at the edge, compatible with
sbc pay
Disclaimer
By using this CLI, you acknowledge that any output generated in connection with the CLI may contain errors, omissions, or outdated information, and you are solely responsible for reviewing and validating all outputs before taking any action. This CLI is provided "as is," and StableCoin disclaims liability for losses or damages arising from use of or reliance on output generated in connection with this CLI.
