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

# CLI

> Public Brickken CLI for x402-paid agentic transaction workflows.

The **Brickken CLI** is the public terminal client for the [Agentic API](/api-reference/endpoint/agentic-methods-x402) on Base. It prepares Brickken agentic transactions for free and pays the send through x402. In the recommended `brickken-relayed` mode, Brickken's relayer signs and broadcasts the operation; in `client-signed` mode the CLI signs locally with your private key.

<CardGroup cols={2}>
  <Card title="npm package" icon="box" href="https://www.npmjs.com/package/brickken-cli">
    Install `brickken-cli` from npm.
  </Card>

  <Card title="GitHub repository" icon="github" href="https://github.com/Brickken/brickken-api-cli">
    View the public source repository.
  </Card>
</CardGroup>

## Install

```bash theme={null}
npm install -g brickken-cli
brickken --version
brickken --help
```

You can also run it without a global install:

```bash theme={null}
npx brickken-cli --help
```

## Authentication

The CLI is x402-only. It ignores `BRICKKEN_API_KEY` and `BKN_API_KEY`.

```bash theme={null}
export BRICKKEN_PRIVATE_KEY=0x...
```

`BKN_PRIVATE_KEY` is accepted as an alias. The private key signs the x402 payment, and — in `client-signed` mode only — the blockchain transaction. In `brickken-relayed` mode it signs the x402 payment only.

<Warning>
  Never paste production private keys into shared terminals, tickets, or chat logs. Prefer environment variables or an `.env` file that is not committed.
</Warning>

## Environments

| Environment         | Base URL                           |
| ------------------- | ---------------------------------- |
| `sandbox` (default) | `https://api.sandbox.brickken.com` |
| `production`        | `https://api.brickken.com`         |

```bash theme={null}
brickken --env sandbox --help
brickken --env production --help
```

Override the API base URL directly when needed:

```bash theme={null}
brickken --base-url https://api.sandbox.brickken.com --help
```

## Network and RPC

Pass the target operation chain with `--chain`. Decimal and hex values are accepted. The Agentic API runs on Base, with Base Sepolia for tests.

| Network                   | Decimal    | Hex        |
| ------------------------- | ---------- | ---------- |
| Base mainnet              | `8453`     | `0x2105`   |
| Base Sepolia              | `84532`    | `0x14a34`  |
| Ethereum Sepolia (legacy) | `11155111` | `0xaa36a7` |

Some commands, especially `create-token --execute`, wait for a deployment receipt to recover `tokenAddress`. Set an RPC URL for that lookup:

```bash theme={null}
export BRICKKEN_RPC_URL="https://sepolia.base.org"   # Base Sepolia
```

`BKN_RPC_URL` is accepted as an alias, or pass `--rpc-url`.

## Command Model

High-level commands are prepare-only by default, and preparing is free. Add `--execute` to also send and pay the x402 charge in one step. Add `--json` for machine-readable output.

The recommended path is `brickken-relayed` mode: pass `--execution-mode brickken-relayed` and omit `--signer-address` — Brickken's relayer signs and broadcasts. The default is `client-signed`, where you provide `--signer-address` and the CLI signs the prepared transaction locally.

```bash theme={null}
# Prepare only (free), relayed mode
brickken create-token \
  --chain 84532 \
  --execution-mode brickken-relayed \
  --name "Research Agent Token" \
  --symbol RAGT

# Prepare + pay the send via x402, relayed mode
brickken create-token \
  --chain 84532 \
  --execution-mode brickken-relayed \
  --name "Research Agent Token" \
  --symbol RAGT \
  --execute \
  --json
```

## Commands

| Command                                 | Backend method                | Purpose                                                   |
| --------------------------------------- | ----------------------------- | --------------------------------------------------------- |
| `brickken agent register`               | `agentRegister`               | Register an ERC-8004 agent identity.                      |
| `brickken agent set-uri`                | `agentSetURI`                 | Update an agent URI/profile.                              |
| `brickken agent set-metadata`           | `agentSetMetadata`            | Write an agent metadata key/value.                        |
| `brickken agent set-wallet`             | `agentSetWallet`              | Update the agent operational wallet.                      |
| `brickken agent transfer-ownership`     | `agentTransferOwnership`      | Transfer the ERC-8004 identity to a new owner.            |
| `brickken agent feedback give`          | `agentGiveFeedback`           | Submit reputation feedback.                               |
| `brickken agent feedback revoke`        | `agentRevokeFeedback`         | Revoke feedback.                                          |
| `brickken agent feedback respond`       | `agentAppendFeedbackResponse` | Respond to feedback.                                      |
| `brickken create-token`                 | `agentCreateToken`            | Deploy an agent-owned ERC-20 token.                       |
| `brickken mint`                         | `agentMintToken`              | Mint an agent-owned token.                                |
| `brickken burn`                         | `agentBurnToken`              | Burn an agent-owned token.                                |
| `brickken transfer`                     | `agentTransferToken`          | Transfer an agent-owned token.                            |
| `brickken transfer-from`                | `agentTransferFromToken`      | Transfer through allowance.                               |
| `brickken approve`                      | `agentApproveToken`           | Approve an allowance.                                     |
| `brickken tx prepare --method <method>` | any supported method          | Prepare a raw backend method.                             |
| `brickken tx sign`                      | local only                    | Sign prepared transaction JSON locally.                   |
| `brickken tx send`                      | `POST /send-transactions`     | Submit signed transactions.                               |
| `brickken tx status`                    | `GET /get-transaction-status` | Poll transaction status.                                  |
| `brickken skill path`                   | local only                    | Print the bundled Brickken AI-agent skill path.           |
| `brickken skill install`                | local only                    | Install the bundled skill into an agent skills directory. |

## AI Agent Skill

The npm package includes a Brickken skill at `skills/brickken`, built on the open [Agent Skills](https://agentskills.io) format and compatible with any agent that supports it — Claude Code, OpenAI Codex, Gemini CLI, Cursor, GitHub Copilot, and more. Use it when an AI agent needs to choose between the Dapp API, Agentic API, CLI, or MCP.

For standalone installation without a global CLI install, see the [Skill documentation](/skill/introduction).

After installing `brickken-cli`, install the skill into the default skills directory (`~/.codex/skills`):

```bash theme={null}
brickken skill install
```

Or pass `--path` to target your agent's skills directory (for example `~/.claude/skills` for Claude Code, `~/.gemini/skills` for Gemini CLI, `~/.cursor/skills` for Cursor):

```bash theme={null}
brickken skill install --path ~/.claude/skills --force
```

To inspect where the bundled skill lives in the installed package:

```bash theme={null}
brickken skill path
```

Without a global install:

```bash theme={null}
npx brickken-cli skill install --path ~/.claude/skills --force
```

## Agent Example

```bash theme={null}
export CHAIN="84532"   # Base Sepolia

brickken agent register \
  --chain "$CHAIN" \
  --execution-mode brickken-relayed \
  --name "Research Agent" \
  --description "On-chain AI research agent" \
  --image https://example.com/agent.png \
  --service-name A2A \
  --service-endpoint https://agent.example/.well-known/agent-card.json \
  --ai-model-provider OpenAI \
  --ai-model-name "Research Model" \
  --x402-support true \
  --execute \
  --json
```

## File Input

Use `--file` for nested JSON/YAML payloads, long metadata, or automation:

```bash theme={null}
brickken tx prepare \
  --method agentSetMetadata \
  --file metadata.json \
  --execute \
  --json
```

<Note>
  Preparing is free; only the send is x402-priced. Fund the wallet behind `BRICKKEN_PRIVATE_KEY` with enough USDC on the x402 payment chain (e.g. Circle USDC on Base Sepolia). In `brickken-relayed` mode Brickken's relayer pays native gas; in `client-signed` mode you also need native gas on the operation chain.
</Note>
