# Clanker CLI

{% hint style="info" %}
[Clanker's CLI only supports v4 deployments](#user-content-fn-1)[^1]
{% endhint %}

### Installation

#### Global install (recommended)

```bash
npm install -g clanker-sdk
```

Then run commands with:

```bash
clanker-sdk <command> [options]
```

#### npx (no install)

```bash
npx clanker-sdk <command> [options]
```

### Quick Start

```bash
# 1. Run interactive setup to configure your wallet and RPC
clanker-sdk setup

# 2. Deploy a token (interactive mode)
clanker-sdk deploy

# 3. Deploy a token (non-interactive)
clanker-sdk deploy --name "MyToken" --symbol "MTK" --chain base

# 4. Check available rewards
clanker-sdk rewards available --token 0x4200000000000000000000000000000000000006
```

### Configuration

#### `setup` command

Run `clanker-sdk setup` to interactively configure:

* **Wallet** — create a new wallet, import an existing private key, or skip
* **Default chain** — choose from supported chains
* **RPC URL** — use a public RPC or enter a custom one

Configuration is saved to `~/.clanker/config.json` with `0600` permissions (owner-only read/write).

#### Config file

Located at `~/.clanker/config.json`:

```json
{
  "privateKey": "0x...",
  "defaultChain": "base",
  "rpc": {
    "base": "https://mainnet.base.org",
    "arbitrum": "https://arb1.arbitrum.io/rpc"
  }
}
```

#### Private key resolution order

The CLI resolves your wallet private key in this order:

1. `--private-key` flag
2. `PRIVATE_KEY` environment variable
3. `~/.clanker/config.json` → `privateKey`

#### Chain resolution order

1. `--chain` flag
2. `~/.clanker/config.json` → `defaultChain`
3. Falls back to `base`

#### RPC resolution order

1. `--rpc` flag
2. `~/.clanker/config.json` → `rpc[chainName]`
3. Default public RPC for the chain

### Global Options

These options apply to all commands:

| Flag                  | Description                           | Default          |
| --------------------- | ------------------------------------- | ---------------- |
| `--chain <name>`      | Target chain                          | `base`           |
| `--rpc <url>`         | Custom RPC URL                        | per config/chain |
| `--private-key <key>` | Wallet private key                    | env/config       |
| `--json`              | Machine-readable JSON output          | `false`          |
| `--dry-run`           | Simulate transactions without sending | `false`          |
| `--help`              | Show help for a command               | —                |
| `--version`           | Show CLI version                      | —                |

#### Supported Chains

| Chain          | Chain ID |
| -------------- | -------- |
| `base`         | 8453     |
| `base-sepolia` | 84532    |
| `arbitrum`     | 42161    |
| `ethereum`     | 1        |
| `bsc`          | 56       |
| `unichain`     | 130      |
| `monad`        | 143      |

### Commands

#### `setup`

Interactive wizard to configure wallet, default chain, and RPC settings.

```bash
clanker-sdk setup
```

No additional flags. Prompts you to:

1. **Wallet** — create new, import existing, keep current, or skip
2. **Default chain** — select from supported chains
3. **RPC** — use public RPC, enter a custom URL, or keep current

***

#### `deploy`

Deploy a new ERC-20 token with Uniswap V4 (default) or V3 liquidity.

When `--name` and `--symbol` are provided, the CLI runs non-interactively. Otherwise, it launches an interactive wizard.

```bash
# Interactive mode
clanker-sdk deploy

# Non-interactive mode
clanker-sdk deploy --name "MyToken" --symbol "MTK"

# V3 legacy deployment
clanker-sdk deploy --v3 --name "MyToken" --symbol "MTK"

# Full configuration example
clanker-sdk deploy \
  --name "MyToken" \
  --symbol "MTK" \
  --chain base \
  --paired-token WETH \
  --starting-market-cap 10 \
  --fee-config Static \
  --static-fee-percent 1 \
  --vault-percentage 10 \
  --vault-lockup-days 30 \
  --dev-buy-eth 0.1 \
  --description "My awesome token" \
  --website "https://mytoken.com" \
  --twitter "https://twitter.com/mytoken"
```

**Deploy Options**

| Flag                             | Description                                                  | Default     |
| -------------------------------- | ------------------------------------------------------------ | ----------- |
| `--v3`                           | Use Clanker V3 (legacy)                                      | V4          |
| `--name <name>`                  | Token name (required for non-interactive)                    | —           |
| `--symbol <symbol>`              | Token symbol (required for non-interactive)                  | —           |
| `--image <url>`                  | Token image URL                                              | —           |
| `--token-admin <address>`        | Token admin address                                          | your wallet |
| `--paired-token <address>`       | Paired token address or `WETH`                               | `WETH`      |
| `--starting-market-cap <amount>` | Starting market cap in paired token units                    | —           |
| `--fee-config <type>`            | Fee config: `Static`, `Dynamic3`                             | `Static`    |
| `--static-fee-percent <n>`       | Static fee percentage (0–10)                                 | `1`         |
| `--pool-positions <type>`        | `Standard`, `Project`, `TwentyETH` (when starting mcap is 0) | `Standard`  |
| `--vault-percentage <n>`         | Vault percentage (1–90)                                      | —           |
| `--vault-lockup-days <n>`        | Vault lockup duration in days (min 7)                        | `7`         |
| `--dev-buy-eth <amount>`         | Dev buy amount in ETH                                        | —           |
| `--fee-preference <type>`        | `Both`, `Paired`, `Clanker`                                  | `Both`      |
| `--description <text>`           | Token description                                            | —           |
| `--website <url>`                | Website URL                                                  | —           |
| `--twitter <url>`                | Twitter/X URL                                                | —           |
| `--telegram <url>`               | Telegram URL                                                 | —           |
| `--farcaster <url>`              | Farcaster URL                                                | —           |
| `--salt <hex>`                   | Custom CREATE2 salt (`0x`-prefixed); skips vanity address    | —           |
| `--airdrop-csv <path>`           | CSV file for airdrop (`address,amount`)                      | —           |
| `--airdrop-lockup-days <n>`      | Airdrop lockup in days                                       | `1`         |
| `--airdrop-vesting-days <n>`     | Airdrop vesting in days                                      | `0`         |
| `--reward-recipients <json>`     | JSON array: `[{admin, recipient, bps, token}]`               | —           |
| `--sniper-starting-fee <n>`      | Sniper starting fee (unibps)                                 | `666777`    |
| `--sniper-ending-fee <n>`        | Sniper ending fee (unibps)                                   | `41673`     |
| `--sniper-decay-seconds <n>`     | Sniper fee decay duration in seconds                         | `15`        |

**Paired Token Defaults by Chain**

| Chain      | Available Paired Tokens |
| ---------- | ----------------------- |
| `base`     | WETH, USDC              |
| `bsc`      | USDT                    |
| `monad`    | WMON                    |
| All others | WETH                    |

**Fee Configurations**

| Type       | Description                                               |
| ---------- | --------------------------------------------------------- |
| `Static`   | Flat fee; configurable via `--static-fee-percent` (0–10%) |
| `Dynamic3` | Dynamic fee up to 3%                                      |

> Legacy names `StaticBasic` and `DynamicBasic` are also accepted.

> Monad only supports `Static` fees.

***

#### `rewards`

Manage creator rewards (LP fees) for deployed tokens.

**`rewards claim`**

Claim accumulated fees for a specific reward token.

```bash
# Claim WETH rewards on Base
clanker-sdk rewards claim --token 0x4200000000000000000000000000000000000006

# Claim for a specific recipient
clanker-sdk rewards claim --token 0x4200000000000000000000000000000000000006 --recipient 0xYourAddr

# Dry run
clanker-sdk rewards claim --token 0x4200000000000000000000000000000000000006 --dry-run
```

| Flag                    | Required | Description                                                            |
| ----------------------- | -------- | ---------------------------------------------------------------------- |
| `--token <address>`     | Yes      | The **fee token** address to claim (e.g. WETH) — not the clanker token |
| `--recipient <address>` | No       | Reward recipient address (defaults to your wallet)                     |

**`rewards available`**

Check claimable fee balance for a specific reward token.

```bash
clanker-sdk rewards available --token 0x4200000000000000000000000000000000000006
clanker-sdk rewards available --token 0x4200000000000000000000000000000000000006 --recipient 0xSomeAddr
```

| Flag                    | Required | Description                                                            |
| ----------------------- | -------- | ---------------------------------------------------------------------- |
| `--token <address>`     | Yes      | The **fee token** address to check (e.g. WETH) — not the clanker token |
| `--recipient <address>` | No       | Reward recipient address (defaults to your wallet)                     |

**`rewards info`**

Show reward admins and recipients for a clanker token.

```bash
clanker-sdk rewards info --token 0xe75785C92cc93938160e0BE449073A1C35521010
```

| Flag                | Required | Description                   |
| ------------------- | -------- | ----------------------------- |
| `--token <address>` | Yes      | The **clanker token** address |

**`rewards update-recipient`**

Update who receives rewards for a clanker token.

```bash
clanker-sdk rewards update-recipient --token 0xClankerToken --index 0 --new-recipient 0xNewAddr
```

| Flag                        | Required | Description                     |
| --------------------------- | -------- | ------------------------------- |
| `--token <address>`         | Yes      | Clanker token address           |
| `--index <n>`               | Yes      | Reward position index (0-based) |
| `--new-recipient <address>` | Yes      | New recipient address           |

**`rewards update-admin`**

Update who can manage rewards for a clanker token.

```bash
clanker-sdk rewards update-admin --token 0xClankerToken --index 0 --new-admin 0xNewAdmin
```

| Flag                    | Required | Description                     |
| ----------------------- | -------- | ------------------------------- |
| `--token <address>`     | Yes      | Clanker token address           |
| `--index <n>`           | Yes      | Reward position index (0-based) |
| `--new-admin <address>` | Yes      | New admin address               |

***

#### `vault`

Manage vaulted (time-locked) tokens.

**`vault claim`**

Claim vaulted tokens after the lockup period has elapsed.

```bash
clanker-sdk vault claim --token 0xTokenAddress
clanker-sdk vault claim --token 0xTokenAddress --dry-run
```

| Flag                | Required | Description   |
| ------------------- | -------- | ------------- |
| `--token <address>` | Yes      | Token address |

**`vault balance`**

Check the claimable vault balance for a token.

```bash
clanker-sdk vault balance --token 0xTokenAddress
```

| Flag                | Required | Description   |
| ------------------- | -------- | ------------- |
| `--token <address>` | Yes      | Token address |

***

#### `airdrop`

Merkle tree–based airdrop utilities. Airdrops are configured either at deploy time (via `--airdrop-csv`) or managed separately with these subcommands.

**`airdrop generate-tree`**

Generate a Merkle tree from a CSV file.

```bash
clanker-sdk airdrop generate-tree --csv airdrop.csv
clanker-sdk airdrop generate-tree --csv airdrop.csv --output tree.json
```

| Flag              | Required | Description                                     |
| ----------------- | -------- | ----------------------------------------------- |
| `--csv <path>`    | Yes      | Path to CSV file (columns: `address`, `amount`) |
| `--output <path>` | No       | Path to write the tree JSON output              |

**CSV format:**

```csv
address,amount
0x1234567890abcdef1234567890abcdef12345678,1000
0xabcdefabcdefabcdefabcdefabcdefabcdefabcd,500
```

**`airdrop get-proof`**

Get a Merkle proof for a specific address.

```bash
clanker-sdk airdrop get-proof --csv airdrop.csv --address 0x1234... --amount 1000
```

| Flag                  | Required | Description                                      |
| --------------------- | -------- | ------------------------------------------------ |
| `--csv <path>`        | Yes      | Path to CSV file used to generate the tree       |
| `--address <address>` | Yes      | Address to get proof for                         |
| `--amount <n>`        | Yes      | Airdrop amount for this address (must match CSV) |

**`airdrop register`**

Register a Merkle tree with the Clanker service. The token must already be deployed with a matching Merkle root.

```bash
clanker-sdk airdrop register --token 0xTokenAddress --csv airdrop.csv
```

| Flag                | Required | Description                                |
| ------------------- | -------- | ------------------------------------------ |
| `--token <address>` | Yes      | Deployed token address                     |
| `--csv <path>`      | Yes      | Path to CSV file used to generate the tree |

**`airdrop claim`**

Claim airdrop tokens. Proofs are fetched automatically from the Clanker service.

```bash
clanker-sdk airdrop claim --token 0xTokenAddress
clanker-sdk airdrop claim --token 0xTokenAddress --recipient 0xRecipient
```

| Flag                    | Required | Description                                 |
| ----------------------- | -------- | ------------------------------------------- |
| `--token <address>`     | Yes      | Token address                               |
| `--recipient <address>` | No       | Recipient address (defaults to your wallet) |

***

#### `token`

Manage token metadata on-chain.

**`token update-image`**

Update a token's image URL.

```bash
clanker-sdk token update-image --token 0xTokenAddress --image "https://example.com/image.png"
```

| Flag                | Required | Description   |
| ------------------- | -------- | ------------- |
| `--token <address>` | Yes      | Token address |
| `--image <url>`     | Yes      | New image URL |

**`token update-metadata`**

Update token metadata (description, social links).

```bash
clanker-sdk token update-metadata \
  --token 0xTokenAddress \
  --description "Updated description" \
  --website "https://mytoken.com" \
  --twitter "https://twitter.com/mytoken"
```

| Flag                   | Required | Description       |
| ---------------------- | -------- | ----------------- |
| `--token <address>`    | Yes      | Token address     |
| `--description <text>` | No       | Token description |
| `--website <url>`      | No       | Website URL       |
| `--twitter <url>`      | No       | Twitter/X URL     |
| `--telegram <url>`     | No       | Telegram URL      |
| `--farcaster <url>`    | No       | Farcaster URL     |

***

### JSON Output

Pass `--json` to any command to get machine-readable JSON output, suitable for scripting and automation:

```bash
clanker-sdk rewards available --token 0x... --json
```

```json
{
  "token": "0x4200000000000000000000000000000000000006",
  "recipient": "0xYourAddress",
  "availableRewards": "1000000000000000"
}
```

### Dry Runs

Pass `--dry-run` to simulate transactions without sending them on-chain. Supported by `deploy`, `rewards claim`, `rewards update-recipient`, `rewards update-admin`, `vault claim`, `token update-image`, `token update-metadata`, and `airdrop claim`:

```bash
clanker-sdk deploy --name "TestToken" --symbol "TST" --dry-run
```

### Environment Variables

| Variable      | Description                                                             |
| ------------- | ----------------------------------------------------------------------- |
| `PRIVATE_KEY` | Wallet private key (alternative to `--private-key` flag or config file) |
| `NO_COLOR`    | Disable colored output                                                  |
| `FORCE_COLOR` | Force colored output                                                    |

### Examples

#### Deploy a token with a vault and dev buy

```bash
clanker-sdk deploy \
  --name "VaultToken" \
  --symbol "VTK" \
  --vault-percentage 10 \
  --vault-lockup-days 30 \
  --dev-buy-eth 0.05
```

#### Deploy with custom reward recipients

```bash
clanker-sdk deploy \
  --name "RewardToken" \
  --symbol "RTK" \
  --reward-recipients '[{"admin":"0xAdminAddr","recipient":"0xRecipAddr","bps":5000,"token":"Paired"}]'
```

#### Deploy with airdrop

```bash
clanker-sdk deploy \
  --name "AirdropToken" \
  --symbol "ADT" \
  --airdrop-csv ./recipients.csv \
  --airdrop-lockup-days 7 \
  --airdrop-vesting-days 30
```

#### Deploy on BSC

```bash
clanker-sdk deploy \
  --name "BSCToken" \
  --symbol "BSC" \
  --chain bsc \
  --paired-token 0x55d398326f99059fF775485246999027B3197955 \
  --starting-market-cap 10000
```

#### Full rewards workflow

```bash
# Check reward configuration for a token
clanker-sdk rewards info --token 0xClankerToken

# Check available rewards (pass the fee token, e.g. WETH)
clanker-sdk rewards available --token 0x4200000000000000000000000000000000000006

# Claim rewards
clanker-sdk rewards claim --token 0x4200000000000000000000000000000000000006
```

#### Full airdrop workflow

```bash
# 1. Generate Merkle tree from CSV
clanker-sdk airdrop generate-tree --csv recipients.csv --output tree.json

# 2. Deploy token with airdrop
clanker-sdk deploy --name "AirdropToken" --symbol "ADT" --airdrop-csv recipients.csv

# 3. Register the tree with Clanker
clanker-sdk airdrop register --token 0xDeployedToken --csv recipients.csv

# 4. Recipients claim their tokens
clanker-sdk airdrop claim --token 0xDeployedToken
```

[^1]:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clanker.gitbook.io/documentation/sdk/clanker-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
