> ## Documentation Index
> Fetch the complete documentation index at: https://conto.finance/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Quickstart

> Set up an agent with wallet, policies, and SDK key in one command

## Install & Run

Run with `npx`:

```bash theme={null}
npx @conto_finance/create-conto-agent
```

Or install globally:

```bash theme={null}
npm install -g @conto_finance/create-conto-agent
create-conto-agent
```

The wizard provisions everything your agent needs: a wallet (custody chosen by the server, Privy on the hosted instance), a spending policy, and an SDK key. No manual dashboard steps required.

The package exposes both the `create-conto-agent` and `conto` bins. The wizard installs itself
into your project as a dev dependency, so `npx conto <command>` resolves to the real Conto CLI
from inside the project directory. Outside a project with that dependency, use the full package
name (`npx @conto_finance/create-conto-agent <command>`) or a global install; a bare `npx conto`
would fetch an unrelated npm package that happens to own that name.

## Headless And Agent Runs

The wizard needs an interactive terminal and a browser. For CI, scripts, and autonomous agents,
use one of the noninteractive modes instead:

```bash theme={null}
# Anonymous test-mode sandbox: no account, no browser, no prompts.
# Expires after 7 days. Payments execute in simulated mode.
npx @conto_finance/create-conto-agent --sandbox --json

# Existing organization: authenticate with an org API key instead of the browser.
npx @conto_finance/create-conto-agent --api-key conto_xxx --name my-agent --json
```

Both modes write the same `.env.local`, `conto.config.json`, and `example.ts` files as the
wizard. `--json` prints a machine-readable result to stdout. Without a TTY and without one of
these flags, 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.

## What Happens

<Steps>
  <Step title="Configure your agent">
    Choose your agent name, type, daily spending limit, and network.
  </Step>

  <Step title="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 redirects the token back to the CLI automatically.
  </Step>

  <Step title="Resources are provisioned">
    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.
  </Step>

  <Step title="Files are written">
    Three files are written to your current directory:

    * `.env.local`: SDK key and configuration
    * `conto.config.json`: Agent metadata
    * `example.ts`: Runnable payment example

    The wizard also adds `@conto_finance/create-conto-agent` as a dev dependency (creating a
    minimal `package.json` if the directory has none) so `npx conto <command>` works. Pass
    `--no-install` to skip this.
  </Step>
</Steps>

## Supported Networks

| Network       | Currency | Chain ID       | Notes                                    |
| ------------- | -------- | -------------- | ---------------------------------------- |
| **Tempo**     | USDC.e   | 4217           | Recommended (preselected by the wizard)  |
| Tempo Testnet | pathUSD  | 42431          | Platform default; auto-funded via faucet |
| Base          | USDC     | 8453           |                                          |
| Solana        | USDC     | solana-mainnet |                                          |

The wizard lists every chain returned by `/api/chains` (including Ethereum, Arbitrum, Polygon,
Base Sepolia, and Solana Devnet); the table above covers the most common choices. Tempo is
recommended because it's stablecoin-native (no ETH needed), has sub-second finality, and
negligible gas costs. Tempo Mainnet uses `USDC.e`; Tempo Testnet uses `pathUSD`.

<Info>
  On Tempo Testnet, the wizard automatically funds your wallet via faucet, no manual funding
  needed.
</Info>

## Run the Example

```bash theme={null}
npx tsx example.ts            # Check setup + request a test payment (no funds move)
npx tsx example.ts --execute  # Also execute the payment if policies approve it
```

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.

## Next Steps

After setup, use the `conto` CLI for day-to-day operations (from the project directory):

```bash theme={null}
npx conto doctor          # Verify auth, scopes, wallet, chain, balance, base URL
npx conto status          # Agent info and spending summary
npx conto pay --dry-run 0x... 10   # Test a payment against policies
npx conto pay 0x... 10    # Request + execute a payment
npx conto mcp             # Start the MCP server for Claude
```

<CardGroup cols={2}>
  <Card title="Commands Reference" icon="terminal" href="/cli/commands">
    Full list of CLI commands and flags
  </Card>

  <Card title="Policy Management" icon="shield" href="/cli/policies">
    Create and manage spending policies from the CLI
  </Card>
</CardGroup>
