The SELAT CLI is the operator-friendly path to SELAT agent payments: bootstrap a wallet, fund a Gateway balance, and discover, rank, and pay x402 services straight from the terminal or a scripted workflow.
It ships as the @selat-ai/selat-cli package, which installs the selat command.
selat is the high-level CLI. Under the hood it shells out to the lower-level @selat-ai/selat-pay payer and the Circle CLI — you install only @selat-ai/selat-cli.
When to use it
- You want to test a paid endpoint manually.
- You want a shell-based flow for operators or CI.
- You want an agent-friendly command layer without writing a custom client first.
If you’re building an application, use the SELAT Router SDK instead.
Install
npm install -g @selat-ai/selat-cli
Verify the install:
selat --version # 0.6.3
selat --help
Prerequisites
selat init checks these for you and tells you how to fix anything missing, but for reference the CLI needs:
- Node.js 18 or newer
- The Circle CLI (
@circle-fin/cli) — wallet creation, MPC-backed signing, and Gateway deposits
- The agent-payment discovery skill (
selat-agent-payments) — the federated catalog and intent ranking that powers selat run
Get started
The canonical first-run flow is init → fund → run.
Bootstrap your setup
selat init is idempotent — safe to re-run. It checks prerequisites, walks you through Circle Agent Wallet login (one email + one OTP), ensures agent wallets exist, and writes your config.If you have no spendable USDC, init offers a small welcome drip or points you to selat fund.Fund your Gateway balance
Top up the Gateway balance your payments draw from. fund previews the deposit and requires an explicit confirmation before moving anything.selat fund --chain base --amount 2
Discover, rank, and pay
Describe what you want in plain language. run discovers matching x402 services, ranks them, and pays for the best one in a single pipe.selat run "summarize the latest news on gold prices"
Before depositing more than ~$20, set spending caps with selat setup-policy. If anything looks off, selat doctor diagnoses your setup in one pass.
Commands
| Command | Description |
|---|
selat init | Full bootstrap: skill, Circle auth, Agent Wallet, selat-pay, and config. Idempotent. |
selat run "<intent>" | Discover + rank + pay for an x402 service in one pipe. |
selat skill <subcommand> | List, install, run, and author agent skills (see below). |
selat fund | Top up your Gateway balance. Dry-runs first; requires explicit confirmation. |
selat history | Show locally recorded Gateway micropayments. |
selat setup-policy | Set Circle spending limits on your Agent Wallet (requires an email OTP). |
selat doctor | Diagnose setup problems (skill, PATH, auth, wallet, config). |
selat --help, selat --version | Show help (-h) or version (-v). |
selat init
Bootstraps an agent-payment setup in one flow.
| Flag | Description |
|---|
--force | Re-create / ensure wallets non-interactively (skips the reuse-or-create prompt). |
--no-drip | Skip the welcome-drip step. |
--router-url=<url> | Override the router URL for this run (default https://router.selat.ai). Must be https://. |
selat run "<intent>"
Takes a natural-language intent (everything not starting with --) and runs the discovery skill’s ranking + payment plan against it.
selat run "find USDC price news and summarize"
selat fund
Tops up your Gateway balance. Shows the plan locally, then requires you to confirm before depositing.
| Flag | Default | Description |
|---|
--chain <key> | base | Chain to deposit from (e.g. base, optimism, arbitrum, arc). |
--amount <usd> | 2 | USDC amount to deposit. Must be a positive number. |
--method <direct|eco> | direct | direct deposits on the chain you fund from (settles on that same chain). eco performs a gasless Eco deposit from Base, Optimism, or Arbitrum — no native gas needed in the wallet — and always settles into Circle Gateway on Polygon. eco is not supported on Arc. |
selat fund --chain base --amount 2 # direct: settles on Base
selat fund --chain optimism --amount 2 --method eco # eco: gasless, settles on Polygon
Settlement chain depends on the method: a direct deposit lands in Gateway on the chain you deposited from, while an eco deposit always lands in Gateway on Polygon regardless of the source chain.
selat history
Shows locally recorded Gateway micropayments.
| Flag | Default | Description |
|---|
--address <addr> | SELAT_AGENT_WALLET_ADDRESS | Wallet to filter by. |
--chain <key> | — | Chain key to filter by (e.g. base). |
--limit <n> | 20 | Number of records to show (positive integer). |
--json | — | Emit structured JSON. |
selat setup-policy
Interactively sets Circle spending caps (per-transaction, daily, weekly, monthly) on your Agent Wallet. Requires an email OTP — Circle gates policy writes for security. Recommended before any deposit over ~$20.
selat doctor
Runs a one-pass diagnosis of common setup problems (skill install, PATH, Circle auth, wallet, config). Run it whenever something looks off. Takes no flags.
Agent skills
Beyond ad-hoc selat run, the CLI can install and run agent skills — named, reusable payment recipes from the public selat-skills registry (or a local path).
selat skill list --available # browse the catalog (with reliability badges)
selat skill install market-snapshot # install a skill by name (or ./path)
selat skill run market-snapshot # run it
selat skill run token-price --symbols ETH,USDC
| Subcommand | Description |
|---|
skill list [--available] | List installed skills, or available ones (with reliability) to install. |
skill install <name|path> [--force] | Install a skill by name (from the registry) or a local path. |
skill run <name> [--p value ...] | Run an installed skill, passing its params as --flags. Payment overrides: --chain <c>, --max-amount <usd>, --raw-key. |
skill new <name> [--dir <dir>] [--force] | Scaffold a new skill folder (SOP layout) to contribute. |
skill verify <path> [--pay] [--p value ...] | Live-check each endpoint (real 402 price/rail); --pay makes a capped paid call. Also accepts --chain / --max-amount. |
skill register <path> [--index <path>] | Add or update the skill’s entry in index.json. |
skill submit <path> [--dry-run] | Open a PR to the selat-skills repo (gated on a passing verify receipt). |
selat skill run web-search --query "USDC news" --chain arc --raw-key # pay from an Arc EOA Gateway balance
selat skill verify ./skills/token-price --symbols ETH --pay # capped real call
Configuration
selat init writes your config to $XDG_CONFIG_HOME/selat-pay/.env. You can also set these in the environment to override defaults:
| Variable | Purpose |
|---|
SELAT_AGENT_WALLET_ADDRESS | Default wallet address (used by history and payments). |
SELAT_PRIVATE_KEY | Signing key for the payer, when not using a Circle Agent Wallet. |
SELAT_ROUTER_URL | Router URL used at runtime (must be https://). |
SELAT_DEFAULT_ROUTER_URL | Default router URL used by selat init. |
SELAT_PAY_BIN | Path to the selat-pay binary, if not auto-resolved. |
SELAT_SKILLS_DIR, SELAT_SKILLS_REPO, SELAT_SKILLS_REF, SELAT_SKILLS_RAW_BASE | Override the skills registry source. |
SELAT_DEBUG=1 | Print stack traces on fatal errors. |