CLI
A command-line interface (CLI) is a text-based interface that enables interaction with software by typing commands into a terminal or console.
Cambrian provides several ways to use our data with AI agents, including the Cambrian CLI, Cambrian MCP, and llms.txt.
The Cambrian CLI brings Cambrian API data directly to terminal-based agent environments like Claude Code, Codex, Hermes, and OpenClaw. With the Cambrian CLI, you can easily access onchain and offchain data across Cambrian API endpoints.
Setup
The CLI is distributed as the cambrian npm package and can be installed by using the following command in your terminal or sharing it with your agent (Claude Code, Codex, Cursor, etc.):
npm install -g cambrian
Authentication
API key (recommended)
The CLI uses CAMBRIAN_API_KEY for authentication:
export CAMBRIAN_API_KEY="YOUR_CAMBRIAN_API_KEY"
Cambrian’s CLI authentication follows the BYOK (bring your own key) approach. You just need to add your API key. If you don’t have an API key yet, you can create a Cambrian Account and get one for free.
x402
Agents such as Claude Code, Codex, Hermes, and OpenClaw can use the Cambrian CLI without an API key. They can pay per request with USDC on Base by using x402.
To query over x402 with the CLI, please review the x402 guide.
Use cases
Once you have installed the CLI, there are two ways to get started. You can either use CLI commands from your terminal or directly prompt your agent with instructions.
1. CLI commands
Cambrian CLI commands are a friendly way to query the Cambrian API from a terminal. Instead of writing raw HTTP requests, humans and agents can run commands like:
cambrian describe opencli
cambrian --help
cambrian --version
cambrian docs solana price-current
cambrian describe opencli
cambrian solana price-current --token-address So11111111111111111111111111111111111111112
cambrian base chains
cambrian mcp config --mode hosted
To discover all commands, please type:
cambrian --help
If you’re looking for a specific group of commands, you can also try:
cambrian solana --help
cambrian base --help
cambrian deep42 --help
cambrian risk --help
2. Prompt your agent
You can also use the CLI by directly prompting your agent. Here are some example prompts you can use to get started:
- Use cambrian to find trending Solana tokens and analyze the top three.
- Use cambrian to detect recent high-alpha tweets and check the credibility of those influencers.
- Use cambrian to find the best Aerodrome v2 pools on Base by TVL and fee generation.
- Use cambrian to assess the risk of a 5x leveraged SOL perp position.
- Use cambrian to find the most active vaults across Morpho and Euler on Base.
Cambrian skill
The cambrian skill is a packaged instruction bundle that tells agents how to use Cambrian data correctly through the CLI. Including which command to use, how to route Solana, EVM, Deep42, and Risk queries, what commands to prefer, and what mistakes to avoid,
It supports packaged installs for:
- Claude Code:
~/.claude/skills/cambrian - OpenCode:
~/.config/opencode/skills/cambrian
Installing the skill does not configure API access. The agent still needs an API key.
Cambrian CLI vs MCP
Installing the Cambrian CLI, you get access to the CLI and a simple command to setup the remote MCP server.
An agent might prefer using the CLI over the MCP when it has shell access because:
- It can run reproducible commands
- It gets a stable command/output contract
- It can debug any undesired behavior directly
- It can generate MCP config with
cambrian mcp configandcambrian mcp test - It has direct access to the Cambrian MCP if needed
- It can use
cambrian describe openclifor machine-readable command discovery