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

# CLI reference

> Every tpay command and flag.

Run `tpay <command> --help` for full details on any command.

## Commands

| Command                                          | Description                                                      |
| ------------------------------------------------ | ---------------------------------------------------------------- |
| `tpay setup`                                     | Create your first wallet and initialize `tpay`                   |
| `tpay curl <args…>`                              | Run `curl`, settling any x402 payment automatically              |
| `tpay claude <args…>`                            | Run Claude with the active wallet wired in as an MCP server      |
| `tpay mcp`                                       | Start an MCP server (stdio) exposing the active wallet to agents |
| `tpay account`                                   | Show the active wallet's balances                                |
| `tpay account list`                              | List all wallets (alias: `ls`)                                   |
| `tpay account new <label>`                       | Create a new wallet                                              |
| `tpay account import <label> --secret-key <key>` | Import a wallet from a secret key                                |
| `tpay account export <label>`                    | Reveal a wallet's secret key                                     |
| `tpay account balance [label]`                   | Show a wallet's balances                                         |
| `tpay account default <label>`                   | Set the active (default) wallet                                  |
| `tpay account remove <label>`                    | Delete a wallet (alias: `rm`)                                    |

## Global flags

| Flag                               | Description                                       |
| ---------------------------------- | ------------------------------------------------- |
| `-a, --account <label>`            | Use a specific wallet instead of the active one   |
| `-n, --network <mainnet\|testnet>` | Network for balance commands (default: `mainnet`) |

## setup

```sh theme={null}
tpay setup [label] [--keystore platform]
```

Generates a keypair, stores the secret in your OS keychain, and sets it as the active wallet. `label` defaults to your system username. `--keystore` selects where the secret is stored; `platform` (the default) uses your OS keychain.

## curl

```sh theme={null}
tpay curl <curl args…>
```

A drop-in for `curl` that settles x402 payments. See [Paying for APIs](/wallet/paying-for-apis).

## account

```sh theme={null}
tpay account [list|new|import|export|balance|default|remove] [label]
```

Manage wallets. See [Managing wallets](/wallet/accounts).

## mcp and claude

```sh theme={null}
tpay mcp
tpay claude <claude args…>
```

Expose the wallet to agents over MCP. See [Connecting agents](/wallet/agents).

## Environment

| Variable    | Description                           |
| ----------- | ------------------------------------- |
| `TPAY_HOME` | Config directory (default: `~/.tpay`) |

Wallets are listed in `~/.tpay/accounts.yaml`; secret keys are kept in the OS keychain, not in this file.
