Skip to main content
The CLI is the npm package @conto_finance/create-conto-agent. It provides the create-conto-agent and conto commands. Run it with npx to start the setup wizard:
Or install it globally:
The examples on this page use conto, which the global install provides. Without a global install, run npx @conto_finance/create-conto-agent <command>, or npx conto <command> inside a project the CLI set up. The unscoped npm package named conto is not the Conto CLI.

Init wizard

--chain expects the chain ID returned by GET /api/chains, for example 42431, 4217, 8453, or solana-mainnet. If it is omitted in a headless run, setup uses Tempo Testnet (42431). --api-key is also accepted, but CONTO_ORG_API_KEY avoids placing the key in process arguments.
The interactive wizard needs a terminal and a browser. For CI, scripts, and autonomous agents, use a noninteractive mode instead. The wizard runs these steps:
1

Configure your agent

Choose your agent name, type, daily spending limit, and network.
2

Authenticate in the browser

The CLI opens a browser window to conto.finance/cli-auth. Sign in with your Conto account (or create one). The browser sends the token and its expiration time back to the CLI automatically. Browser-issued organization credentials expire after seven days. Run conto login again to renew one.
3

Create the agent and wallet

The wizard creates a wallet on your chosen chain, registers the agent, links the wallet with spend limits, creates a default spending policy, and generates an SDK key.
4

Save your project files

The wizard writes or updates four files in your current directory:
  • .env.local: SDK key and configuration (owner-only permissions)
  • .gitignore: updated to ignore .env.local
  • conto.config.json: agent metadata
  • example.mjs: runnable payment example
It also adds @conto_finance/create-conto-agent as a dev dependency, creating a minimal package.json if the directory has none. Pass --no-install to skip this.

Supported networks

The wizard lists every chain returned by /api/chains, including Ethereum, Arbitrum, Polygon, Base Sepolia, and Solana Devnet. The first run defaults to Tempo Testnet, so evaluation cannot move real funds.
Choosing any mainnet prompts for confirmation. Headless setup must include --confirm-mainnet together with an explicit mainnet --chain, for example --chain 4217 --confirm-mainnet.

Run the example

The example prints your agent, key scopes, and wallet from GET /api/sdk/setup, then requests a $0.01 payment through the policy engine. Without --execute it stops after the policy decision. Use --resume REQUEST_ID to continue that request, or --execute on the first run to request and execute a new payment together.

Headless and agent runs

For CI, scripts, and autonomous agents, use a noninteractive mode:
Both modes write the same files as the wizard. Sandbox mode also writes the sandbox setup key, which configures that sandbox’s policies and spend limits, to .conto/sandbox-setup.env. Keep that file out of the agent’s runtime. --json prints a machine-readable result to stdout with credential file and environment-variable names, never the credential values. Without a TTY and without one of these modes, the CLI exits with an error that lists them instead of hanging on a prompt. --help and --version work in any terminal, TTY or not. After a headless run:

Resume and exit codes

Organization setup records each step in .conto/init-checkpoint.json before it creates anything. The record holds resource IDs and the requested configuration, never a key. When a step fails, setup stops with "status": "partial", the failed step, the IDs it created, and a resume command. It writes no agent credentials until every step succeeds. --resume checks each recorded resource and creates only what is missing. It refuses a different base URL, organization, or configuration. --restart discards the record. Resources the old setup created stay in the organization.

Global options

All commands support these flags:

Agent and status

conto doctor calls GET /api/sdk/setup with your SDK key and reports each check, including whether the key has payments:request and payments:execute and whether the wallet can execute real transfers. When the server returns setup diagnostics, those decide the result, and each issue says whether the agent or an owner acts next.For anonymous sandbox setups created with create-conto-agent --sandbox, conto doctor treats simulated execution as healthy and reports the sandbox expiry instead of warning that the wallet is manual-only.
conto doctor --json prints exactly one JSON document with ok, exitCode, baseUrl, diagnosticsSource (server or cli), checks, issues, diagnostics, and setup.

Sandbox handoff

Hand an anonymous sandbox to the person who will own it, from a remote or headless shell:
sandbox claim uses only the sandbox organization key, CONTO_SANDBOX_API_KEY, from the environment or .env.local. It returns a verificationUrl. Send that URL only to the person who will own the sandbox, because it holds a temporary secret. The polling token stays in the owner-only .conto/sandbox-claim.json and is never printed. Running sandbox claim again reuses a pending link. claim-status never prints the link. A claim makes that person the owner and revokes the sandbox setup key. The sandbox stays in test mode. A claim does not fund a wallet, change spending limits, grant scopes, or enable live payments. See hand off to a person.

Payments

--dry-run makes no API calls. It checks the address, amount, purpose, and category locally against the same rules the server uses, then prints the POST /api/sdk/payments/request it would send. It runs no policy evaluation, so a valid dry run does not mean the payment will be approved. Run conto limits to see the agent’s current limits.

Transactions

Add --json for the full record, including source wallet, authorization decision, and block details.

Wallets

Spending limits

Alerts

Policies

Run policy commands from a project the CLI set up. They use the organization API key saved during setup. Lists show [organization] for mandatory baselines and the effective assignment path, such as [agent] or [wallet], for assigned policies.
conto policies all lists every policy in the organization, not only your agent’s, with each policy’s ID, type, priority, rules, and active status.
Organization policies cannot be assigned or unassigned because they already apply to every payment. To stop one, deactivate or delete it. Assigned policies do nothing until linked to an agent, wallet, or card.
All policy commands support --json:

Create a policy

conto policies create walks you through each step with descriptions. It prompts for:
  1. Policy name. A descriptive label.
  2. Policy type. One of the types below, each with an explanation.
  3. Scope. Apply to the entire organization or only explicitly assigned targets.
  4. Priority. Higher numbers are evaluated first. Use 0-100. Default is 50.
  5. Rules. Optionally add the first rule immediately.
  6. Assignment. Assigned policies can be linked to the current agent.
The type only sets which rules the builder offers. Conto evaluates each rule by its rule type, so an allow list works the same under Counterparty, Merchant, or Whitelist.

Add rules

conto policies add-rule <policy-id> prompts for:
  • Rule type: context-aware options based on the policy type
  • Operator: <=, >=, in list, not in list, between, etc.
  • Value: with placeholders that show the format (dollar amounts for limits, JSON arrays for lists, country codes for geographic rules)
  • Action: Allow, Deny, or Require Approval
A bare number for Velocity Limit is a dollar amount per hour, not a transaction count. Use maxCount to limit the number of transactions or maxAmount to limit spend. period is HOUR, DAY, WEEK, or MONTH.

Authentication

MCP server

Documentation

JSON mode

Every command supports --json for machine-readable output:

Configuration files

Configuration precedence is process environment, project .env.local, project conto.config.json, then global ~/.conto/config.json. Generated credential files use owner-only permissions, and init adds .env.local to the project .gitignore. The CLI creates .conto/ with owner-only permissions and adds it to .gitignore when it first writes a file there.

Local webhook testing

Set CONTO_WEBHOOK_SECRET to your local handler’s signing secret. The CLI sends a synthetic signed payment event, reports response status and latency, and exits nonzero if delivery fails. This command requires no Conto credentials and accepts only loopback destinations. See webhook testing.

Continue a generated payment example

Save the request ID printed by example.mjs. After owner review or an interrupted run, check or resume that same request instead of starting another payment:
Resume checks the current status and executes only an approved request. A completed, declined, or pending-review request is reported without another execution. Running the example without either option starts a new payment intent.