Skip to main content
The SELAT CLI is the terminal operator surface for SELAT agent payments: bootstrap a wallet, fund a Gateway balance, and discover, rank, and pay x402 services from a terminal or scripted workflow. This guide covers the selat command only; it does not install or configure the Router SDK for application code. 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, and selat init checks for the rest and tells you how to fix anything missing.

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.
For a TypeScript application integration, use the separate SELAT Router SDK documentation. Do not combine its package installation or signer setup with this terminal workflow.

Install

Verify the install:

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 discovery skill (@selat-ai/selat-discovery) — the federated catalog and intent ranking that powers selat search and selat run. Ships as a dependency of the CLI; init verifies it.

Get started

The canonical first-run flow is init → fund → run, with selat search as the free preview of what run would pick.
1

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 points you to selat fund.
2

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.
3

Discover and rank — for free

Describe what you want in plain language. search runs the same discovery and ranking as run, but stops before payment — no wallet, no spend.
4

Pay for the best match

run discovers matching x402 services, ranks them, and pays for the best one in a single pipe.
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

selat init

Bootstraps an agent-payment setup in one flow.

selat search "<intent>"

Runs the free front half of selat run: discovers matching endpoints across the federated catalogs and ranks them for the intent, without touching a wallet. No payment path exists in this command.

selat run "<intent>"

Takes a natural-language intent and runs the discovery skill’s ranking + payment plan against it, paying for the top match.

selat fund

Tops up your Gateway balance. Shows the plan locally, then requires you to confirm before depositing.
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.

selat spend

Prints a unified, read-only spend report: settled spend from the local selat-pay ledger plus Apify prepaid-token utilization from the token store.

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. Also sets the local quarantine period — how many days of recent charged 5xx failures (with nothing settled) keep an endpoint excluded from ranking picks. --quarantine-days <n> (whole days, 1–90; default 30) saves it to the selat config with no Circle write and no emailed code, so it works non-interactively too — given alone, the command saves it and exits without touching Circle. See First-Party Transactability for how the quarantine clock relates to the 90-day evidence window.

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).

Configuration

selat init writes your config to $XDG_CONFIG_HOME/selat-pay/.env. You can also set these in the environment to override defaults: