Documentation Index
Fetch the complete documentation index at: https://docs.anyway.sh/llms.txt
Use this file to discover all available pages before exploring further.
@anyway-sh/cli on npm
View package on npm
Installation
Quick Start
Authentication
The CLI uses three auth modes, depending on the command:- Merchant auth (
anyway login) — JWT-based; required by most commands (products, orders, wallets, dashboard, developer, traces, and the merchant-side agent-wallet operations likecreate/list/reset). - Agent key (
ANYWAY_AGENT_WALLET_KEYenv var or a local record fromwallets agents import) — P-256 keypair-based; used by the agent-runtime commands underwallets agents(whoami/history/policies/pay/sign), bysuperapi call, and byimportitself. These do NOT needanyway login. - Local — file-only operations on
~/.anyway/agents/*, used bydefaultandforget.
Merchant login
~/.anyway/credentials.json and auto-refreshed.
For environments without a browser, the login page will display a token you can paste back into the terminal.
Agent runtime auth (for AI agents)
If you’re running the CLI as an AI agent that already owns an Agent Wallet, set the key bundle from the dashboard’s reveal dialog as an env var — noanyway login needed:
/v1/agent-wallet/*):
--format json for machine-parseable output. See wallets agents below for the full surface (including merchant-only operations like create).
Commands
products
orders
wallets
wallets agents
Manage Agent Wallets and operate as an agent runtime. Eleven subcommands across three independent auth paths — pick the column that matches what you have.
| Command | Description | Auth |
|---|---|---|
create [--name <n>] [--non-interactive] | Create a new agent wallet (browser callback flow — opens dashboard for Privy signing, then saves the verified key locally when interactive) | merchant |
list [--local] [--offline] [--format=table|json] | Without --local: org-wide merchant view of every agent wallet. With --local: only the agent records you’ve imported locally; each row is refreshed by hitting the agent-runtime endpoint with that agent’s key. Add --offline to skip the network and show file state only. | merchant (default) / agent key (--local) / local (--local --offline) |
reset <agentId> [--non-interactive] | Rotate this agent’s signing key in place (browser callback flow; same agentId, refreshed key) | merchant |
import --token <bundle> (alias: adopt) | Verify an Agent Wallet Key bundle and save/replace the local record in ~/.anyway/agents/ | agent key |
whoami [<agentId>] | Server’s view of this agent (id, name, wallet id, wallet address, public key) | agent key |
history [<agentId>] [--limit N] | Activity log for the agent (default 50, max 200) | agent key |
policies [<agentId>] | Spending policies attached to the agent’s wallet | agent key |
pay --to <0x> --amount <usdc> | Sign a USDC payment authorization for x402 PAYMENT-SIGNATURE | agent key |
sign --typed-data-file <path> | Sign arbitrary EIP-712 typed data | agent key |
default <agentId> (alias: use) | Set the default local agent record | local |
forget <agentId> [--yes] | Delete the local agent record | local |
- merchant — needs
anyway login. These commands manage the wallet itself (create/list(default) /reset) and require browser interaction forcreate/reset(they cannot be completed by an AI agent alone — share the printed URL with the wallet owner).list --localdoes not need merchant auth — see below. - agent key — needs
ANYWAY_AGENT_WALLET_KEYenv var or a record imported viaimport.importverifies the bundle throughGET /v1/agent-wallet, saves it locally, and replaces a stale local key after dashboard reset. Use this in agent runtimes (Claude / Codex / CI). Does NOT needanyway login. - local — touches only
~/.anyway/agents/*. No network, no auth.
superapi
superapi call is the wrapped x402 purchase path for agent runtimes. It sends the initial request, decodes the PAYMENT-REQUIRED challenge, shows the quote, signs with the selected Agent Wallet after confirmation, retries with PAYMENT-SIGNATURE, and prints the API result. Use --yes or -y to skip the prompt in CI/agent runtimes. It uses agent-key auth and does not need anyway login. Agent Wallet is the default payment source; --pay-with agent-wallet is accepted for compatibility but is not required.
Each command’s --help prints its full flag list, examples, and auth requirement — e.g. anyway wallets agents pay --help shows the lower-level --format json output used as inputs when manually assembling an x402 PAYMENT-SIGNATURE envelope. For the end-to-end CLI purchase path, see SuperAPI → By Anyway CLI.
dashboard
traces
developer
chat
Global Options
| Option | Values | Default | Description |
|---|---|---|---|
--format | table, json, csv | table | Output format |
Scripting & Automation
All commands support--format json for machine-readable output and return non-zero exit codes on failure. This applies to both merchant-mode and agent-mode commands.