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

# Configuration

> Configure accounts, networks, and environment variables for the Decibel CLI

## Authentication

The CLI uses **API wallets** for signing transactions on behalf of your Decibel subaccount. API wallets can be created at [app.decibel.trade/api](https://app.decibel.trade/api). They allow programmatic trading without permitting deposits or withdrawals.

The CLI resolves credentials in this order:

1. `--account <alias>` flag - Use a named account from local storage
2. `DECIBEL_PRIVATE_KEY` environment variable - API wallet private key
3. `DECIBEL_SUBACCOUNT_ADDRESS` environment variable - Subaccount address (read-only operations)
4. Default account from local storage (`~/.decibel/data.db`)

## Adding an account

Run the interactive setup:

```bash theme={null}
decibel-cli account add
```

You'll be prompted for:

* **Subaccount address** - Your Decibel subaccount address (starts with `0x`)
* **Account type** - `api-wallet` (for trading) or `read-only` (for monitoring)
* **Private key** - API wallet private key (for `api-wallet` type only)
* **Alias** - A short name like `main`, `trading`, or `bot`
* **Set as default** - Whether to use this account by default

Accounts are stored locally in `~/.decibel/data.db` with private keys encrypted at rest.

### Managing accounts

```bash theme={null}
decibel-cli account ls              # List all accounts
decibel-cli account set-default     # Change the default account
decibel-cli account remove          # Remove an account
decibel-cli account info            # Show balances and equity
```

## Network selection

The CLI supports four networks:

| Network   | Description             |
| --------- | ----------------------- |
| `mainnet` | Production (real funds) |
| `testnet` | Public testnet          |
| `local`   | Local development       |

Set the network with the `--network` flag or `DECIBEL_NETWORK` environment variable:

```bash theme={null}
# Per-command
decibel-cli markets ls --network testnet

# Or set globally
export DECIBEL_NETWORK=testnet
```

The default network is `testnet`.

## Environment variables

| Variable                      | Description                                                               |
| ----------------------------- | ------------------------------------------------------------------------- |
| `DECIBEL_PRIVATE_KEY`         | API wallet private key for signing transactions                           |
| `DECIBEL_SUBACCOUNT_ADDRESS`  | Subaccount address for read operations                                    |
| `DECIBEL_ACCOUNT_ALIAS`       | Account alias from stored accounts                                        |
| `DECIBEL_NETWORK`             | Network (`mainnet`, `testnet`, `local`)                                   |
| `DECIBEL_NODE_API_KEY`        | Required. Node API key for authentication                                 |
| `DECIBEL_GAS_STATION_API_KEY` | [Gas Station](/quickstart/gas-station) API key for sponsored transactions |

You can place these in a `.env` file in your working directory - the CLI loads it automatically via `dotenv`.

## Global options

These options are available on all commands:

| Option              | Description                              |
| ------------------- | ---------------------------------------- |
| `--json`            | Output in JSON format (machine-readable) |
| `--network <name>`  | Network to use                           |
| `--account <alias>` | Use a specific stored account            |
| `-h, --help`        | Show help for any command                |

## MCP server

The CLI includes a built-in MCP server for AI agent integration. See the [MCP Server Installation](/agents/mcp/installation) page for setup instructions.
