Skip to main content

Bankr CLI

The Bankr CLI (@bankr/cli) is a command-line interface built on top of the Agent API. It handles authentication, prompt submission, job polling, and result display out of the box.

Installation

Install the CLI
npm install -g @bankr/cli

After installing, the bankr command is available everywhere:

bankr --version

Alternative: bun

bun install -g @bankr/cli

Run without installing

npx @bankr/cli what is the price of ETH?

Updating

Update the CLI to the latest version without remembering your package manager:

bankr update

To check if an update is available without installing:

bankr update --check

The CLI auto-detects whether you installed with npm, bun, pnpm, or yarn and runs the appropriate global install command.

Setup

Login

Credentials are stored in ~/.bankr/config.json. You can also set keys via environment variables (BANKR_API_KEY, BANKR_LLM_KEY).

Email login

Sign in with your email address. This creates a wallet, accepts terms, and generates an API key — all without visiting the Bankr Terminal.

# Interactive: prompts for email, OTP code, key options
bankr login email

# Two-step headless login (for scripts and agents):
# Step 1 — send OTP, then exit
bankr login email user@example.com

# Step 2 — verify OTP and complete setup
bankr login email user@example.com --code 123456 --accept-terms --key-name "My Key" --agent-api --read-write --llm
OptionDescription
--code <otp>OTP code received via email (step 2 of headless login)
--accept-termsAccept Terms of Service without prompting (required for new users)
--key-name <name>Display name for the API key (e.g. "My Agent"). Prompted if omitted
--no-wallet-apiDisable Wallet API (enabled by default)
--agent-apiEnable Agent API (AI prompts)
--read-writeDisable read-only mode (allow transactions). Without this, enabled APIs are read-only
--no-token-launchDisable Token Launch API (enabled by default)
--llmEnable LLM gateway access (multi-model API at llm.bankr.bot)

New key defaults (CLI):

FlagDefaultTo change
walletApiEnabledEnabled--no-wallet-api
agentApiEnabledDisabled--agent-api
tokenLaunchApiEnabledEnabled--no-token-launch
llmGatewayEnabledDisabled--llm
readOnlyEnabled--read-write

When --code is omitted and an email address is provided, the CLI sends the verification code and exits — no credentials are saved. Pass --code with the received code to complete login.

Any option not provided will be prompted interactively, so you can mix headless and interactive:

# Send OTP headlessly, then verify with interactive prompts for key options
bankr login email user@example.com --code 123456

API key login

If you already have a bk_... API key (from the Bankr Terminal or another source):

# Log in directly with an API key
bankr login --api-key bk_YOUR_KEY

# Log in with a separate LLM gateway key
bankr login --api-key bk_YOUR_KEY --llm-key YOUR_LLM_KEY

# Print the Bankr Terminal URL (for generating a key)
bankr login --url

SIWE login (headless agents)

Sign in with an Ethereum wallet using Sign-In with Ethereum. Designed for headless agents and automated environments where no browser or email is available.

# Basic SIWE login (read-write by default)
bankr login siwe --private-key 0xYOUR_PRIVATE_KEY

# With partner attribution
bankr login siwe --private-key 0x... --partner-key pk_PARTNER_KEY

# Custom key name, read-only
bankr login siwe --private-key 0x... --key-name "My Agent" --read-write
OptionDescriptionRequired
--private-key <key>Ethereum private key (0x...)Yes
--partner-key <key>Partner API key for fee attributionNo
--key-name <name>API key display name (default: SIWE-<date>)No
--read-writeEnable write operations on the API keyNo

The CLI fetches a nonce from the Bankr API, constructs and signs an EIP-4361 message with the provided private key, then verifies with the API to create a wallet and generate an API key.

Interactive menu

bankr login

Presents a menu to choose your login method: sign in with email, open the Bankr Terminal to generate an API key, or paste an existing key.

Verify setup

bankr whoami

Displays your API key (masked), API URL, connection status, wallet addresses, linked wallets, social accounts, Bankr Club status, referral code, and score.

Commands

bankr prompt [text...]

Send a prompt to the Bankr AI agent. Submits the prompt, polls for completion, and displays the result.

bankr prompt what is the price of ETH?

Thread options

Continue a multi-turn conversation using threads:

# Continue the most recent thread
bankr prompt --continue "and what about SOL?"
bankr prompt -c "compare them"

# Continue a specific thread by ID
bankr prompt --thread thr_ABC123 "tell me more"
OptionDescription
--thread <id>Continue a specific conversation thread
-c, --continueContinue the most recent thread

The response includes a threadId that is automatically saved. Use --continue to pick up where you left off, or --thread to resume any previous thread.

Interactive and piped input

If no text is provided, the CLI opens an interactive input (which avoids shell expansion issues with $ signs):

bankr prompt
# Enter your prompt: buy $50 of ETH on base

You can also pipe input:

echo "buy $50 of ETH on base" | bankr prompt

bankr wallet

Wallet operations. Running bankr wallet with no subcommand shows your wallet info (same as bankr whoami).

bankr wallet portfolio

Show wallet portfolio across all supported chains. See Portfolio Endpoint.

bankr wallet portfolio                    # Token balances
bankr wallet portfolio --pnl # With profit/loss
bankr wallet portfolio --nfts # With NFT holdings
bankr wallet portfolio --all # Everything
bankr wallet portfolio --chain base # Single chain
bankr wallet portfolio --json # Raw JSON output
bankr wallet portfolio --low-value # Include dust tokens

bankr wallet transfer

Transfer tokens to an EVM address. Supports token symbol resolution.

bankr wallet transfer --to 0x... --amount 100 --token USDC
bankr wallet transfer --to 0x... --amount 0.01 --native
bankr wallet transfer --to 0x... --amount 10 --token USDC --chain polygon
OptionDescriptionRequired
--to <address>Recipient EVM addressYes
--amount <amount>Human-readable amountYes
--token <symbol or address>Token symbol (USDC) or contract addressConditional
--nativeSend native token (ETH, POL)Conditional
--chain <chain>EVM chain (default: base)No

bankr wallet sign

Sign messages, typed data, or transactions without broadcasting.

bankr wallet sign --type personal_sign --message "Hello, Bankr!"
bankr wallet sign --type eth_signTypedData_v4 --typed-data '{"domain":{...},...}'
bankr wallet sign --type eth_signTransaction --transaction '{"to":"0x...","chainId":8453}'

bankr wallet submit

Submit transactions to the blockchain.

bankr wallet submit tx --to 0x... --chain-id 8453 --value 1000000000000000000
bankr wallet submit json '{"to":"0x...","chainId":8453,"value":"1000000000000000000"}'
note

Sign, submit, and transfer are write operations. Read-only API keys will receive a 403 error. See Access Control.

bankr agent

AI agent commands. Running bankr agent "buy ETH" sends a prompt. The default bankr "buy ETH" shortcut also works.

bankr agent status <jobId>

Check the status of a previously submitted job.

bankr agent cancel <jobId>

Cancel a pending or processing job.

bankr agent skills

Show all available agent skills with examples.

bankr agent profile

Manage your agent profile page (create, update, delete, add-update).

bankr whoami

Show current authentication and account info:

bankr whoami

bankr tokens

Token search and info (public, no auth required).

bankr tokens search USDC
bankr tokens search ETH --chain 1
bankr tokens info 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

bankr skills

List all available Bankr AI agent skills with examples:

bankr skills

bankr launch

Launch a token on Base through an interactive wizard. The wizard guides you through providing token details, including name, image, social links, and fee recipients.

# Interactive wizard (prompts for all details)
bankr launch

# Headless with all options specified
bankr launch --name "MyToken" --symbol "MTK" --image "https://example.com/logo.png" -y

# With fee recipient
bankr launch --name "MyToken" --fee "@myhandle" --fee-type x -y

Options

OptionDescription
--name <name>Token name (prompted if omitted)
--symbol <symbol>Token symbol, 1-10 characters (default: auto-generated from name)
--image <url>Token image URL (optional)
--tweet <url>Associated tweet URL for social proof (optional)
--website <url>Project website URL (optional)
--fee <recipient>Fee recipient: X/Farcaster handle, ENS name, or wallet address (optional)
--fee-type <type>Fee recipient type: x, farcaster, ens, or wallet (default: x)
-y, --yesSkip confirmation prompt
--simulateSimulate the deploy without broadcasting a transaction

Fee Recipients

Direct a portion of trading fees to collaborators, partners, or your treasury:

# X (Twitter) handle
bankr launch --name "MyToken" --fee "@partner" --fee-type x

# Farcaster handle
bankr launch --name "MyToken" --fee "@partner" --fee-type farcaster

# ENS name
bankr launch --name "MyToken" --fee "partner.eth" --fee-type ens

# Wallet address
bankr launch --name "MyToken" --fee "0x..." --fee-type wallet

The wizard displays a summary and asks for confirmation before submitting the launch. Use --yes to skip confirmation in scripts and automated deployments.

note

This is a write operation. Read-only API keys will receive a 403 error. See Access Control. Token launches are subject to deployment limits.

bankr fees [address]

View a full fee earnings dashboard for your deployed tokens. Displays claimable and claimed WETH, a daily earnings chart, per-token breakdown, and projected monthly/yearly earnings based on your daily average.

# Dashboard for your authenticated wallet
bankr fees

# Dashboard for a specific wallet address
bankr fees 0x1234...

# Look up fees by token contract address
bankr fees --token 0xTokenAddress

# Custom lookback period (1-90 days, default 30)
bankr fees --days 7

# Raw JSON output (for scripting)
bankr fees --json
OptionDescription
--days <n>Lookback period for daily chart (1–90, default: 30)
--token <address>Look up fees by token contract address instead of wallet
--jsonOutput raw JSON data

The dashboard includes:

  • Claimable / Claimed WETH summary cards
  • Daily earnings chart with sparkline visualization
  • Statistics: total earned, daily average, best day, active days, current streak
  • Projections: estimated monthly and yearly earnings based on your daily average
  • Per-token breakdown: claimable and claimed amounts for each token

bankr fees claim <tokenAddress>

Claim accumulated fees for a specific token:

# Claim with confirmation prompt
bankr fees claim 0xTokenAddress

# Skip confirmation (for scripts)
bankr fees claim 0xTokenAddress --yes
OptionDescription
-y, --yesSkip confirmation prompt
note

This is a write operation. Read-only API keys will receive a 403 error. See Access Control.

bankr fees claim-wallet [address]

Claim earned Doppler fees using your own private key — no Bankr account needed. Scans all launches where your wallet is a fee beneficiary, shows claimable amounts, and submits claim transactions directly from the CLI.

# Derive address from BANKR_PRIVATE_KEY in .env
bankr fees claim-wallet

# Specify address explicitly (key prompted or read from .env)
bankr fees claim-wallet 0xYourAddress

# Claim all tokens without interactive selection
bankr fees claim-wallet --all

# Skip all confirmation prompts (for scripts)
bankr fees claim-wallet --all --yes

# Use a custom RPC endpoint
bankr fees claim-wallet --rpc https://your-rpc.com
OptionDescription
--private-key <key>Private key (0x...). Also reads BANKR_PRIVATE_KEY from .env or environment. If neither set, prompted interactively.
--rpc <url>Custom Base RPC URL (default: https://mainnet.base.org)
--allClaim all tokens without selection prompt
-y, --yesSkip confirmation prompt

Environment variables:

Create a .env file in your working directory:

BANKR_PRIVATE_KEY=0xYourPrivateKey
BANKR_API_KEY=your-api-key

The CLI automatically reads .env from the current directory. When BANKR_PRIVATE_KEY is set and no address argument is provided, the address is derived from the key automatically.

bankr llm models

List all models available through the Bankr LLM Gateway:

bankr llm models

If you're authenticated, the CLI fetches the live model list from the gateway. Otherwise it shows the built-in catalog.

bankr llm credits

Check your LLM gateway credit balance:

bankr llm credits

Shows your current USD credit balance for LLM gateway usage. Returns an error if your balance is exhausted or if authentication fails.

bankr llm credits add <amount>

Top up your LLM gateway credits from your wallet:

bankr llm credits add 25                   # Add $25 credits (USDC default)
bankr llm credits add 50 --token 0x... # Add $50 from a specific token
bankr llm credits add 25 -y # Skip confirmation prompt
OptionDescription
--token <address>ERC-20 token address to pay with (default: USDC on Base)
-y, --yesSkip confirmation prompt

The command swaps your token for USDC and deposits it as LLM credits. Displays your balance before and after the top-up.

note

This is a write operation. Read-only API keys will receive a 403 error. See Access Control.

bankr llm credits auto

View or configure automatic LLM credit top-ups:

bankr llm credits auto                     # View current config
bankr llm credits auto --amount 25 --threshold 5 --tokens USDC # Enable auto top-up
bankr llm credits auto --disable # Disable auto top-up
OptionDescription
--enableEnable auto top-up
--disableDisable auto top-up
--amount <usd>Top-up amount in USD (max $1,000)
--threshold <usd>Trigger top-up when balance falls below this (max $500)
--tokens <list>Comma-separated token symbols or addresses to pay with (max 3, e.g. USDC,ETH)

When --amount, --threshold, or --tokens are provided without --enable/--disable, auto top-up is implicitly enabled. Token symbols are resolved against your wallet balances on Base.

bankr llm setup <target>

Generate configuration to use the Bankr LLM Gateway with your coding agent. Supported targets:

bankr llm setup openclaw             # OpenClaw JSON config
bankr llm setup openclaw --install # Write to ~/.openclaw/openclaw.json
bankr llm setup opencode # OpenCode JSON config
bankr llm setup opencode --install # Write to ~/.config/opencode/opencode.json
bankr llm setup cursor # Cursor IDE setup instructions
bankr llm setup claude # Claude Code env var config

The --install flag (available for OpenClaw and OpenCode) merges the Bankr provider into your existing config file without overwriting other providers.

bankr llm claude [args...]

Launch Claude Code with all API requests routed through the Bankr LLM Gateway:

bankr llm claude
bankr llm claude --model claude-sonnet-4.5

This spawns claude with ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN set automatically from your Bankr config. If a separate llmKey is configured, it uses that; otherwise it falls back to your API key. All arguments are passed through to Claude Code.

bankr llm opencode [args...]

Launch OpenCode with all API requests routed through the Bankr LLM Gateway:

bankr llm opencode
bankr llm opencode --model claude-sonnet-4.5

This spawns opencode with the Bankr provider automatically configured. If the OpenCode config doesn't include the Bankr provider, it runs bankr llm setup opencode --install first. All arguments are passed through to OpenCode.

bankr x402

x402 Cloud commands for deploying, managing, and calling paid API endpoints. See the full x402 CLI Reference for all commands.

Key commands:

bankr x402 init                    # Scaffold project
bankr x402 add <name> # Add a service
bankr x402 deploy [name] # Deploy services
bankr x402 list # List deployed endpoints
bankr x402 search <query> # Search the marketplace
bankr x402 schema <url> # View endpoint schema
bankr x402 call <url> # Call with automatic payment
bankr x402 call <url> -i # Interactive mode — prompt for inputs
bankr x402 revenue [name] # View earnings
bankr x402 env set KEY=VALUE # Set encrypted env var

bankr config get [key]

Read configuration values. Without a key, shows all config:

bankr config get          # show all
bankr config get apiKey # show API key
bankr config get apiUrl # show API URL
bankr config get llmKey # show LLM gateway key
bankr config get llmUrl # show LLM gateway URL

bankr config set <key> <value>

Set a configuration value. Supported keys: apiKey, apiUrl, llmKey, llmUrl.

bankr config set llmKey YOUR_LLM_KEY

bankr logout

Clear stored credentials:

bankr logout

bankr sounds

Manage CESP (CLI Event Sound Packs) sound effects. Without a subcommand, displays the current sound configuration status.

bankr sounds                        # Show current config
bankr sounds enable # Enable sounds
bankr sounds disable # Disable sounds
bankr sounds install <pack> # Install a pack from the CESP registry
bankr sounds search [query] # Search available packs
bankr sounds list # List installed packs
bankr sounds use <pack> # Set the active sound pack
bankr sounds volume [level] # Get or set volume (0.0–1.0)
bankr sounds mute # Mute all sounds
bankr sounds unmute # Unmute sounds
bankr sounds test [category] # Play a test sound

Sound packs are installed to ~/.bankr/sounds/ and provide audio feedback for CLI events like task completion or errors.

bankr update

Update the CLI to the latest published version:

bankr update              # Check and install latest version
bankr update --check # Check only, don't install
OptionDescription
--checkCheck for updates without installing

Default command

Any unrecognized arguments are treated as a prompt:

bankr what is the price of BNKR?
# equivalent to: bankr prompt what is the price of BNKR?

Thread options (--thread, --continue) are only available on the prompt subcommand.

Configuration

The CLI uses this config precedence (highest to lowest):

  1. Environment variableBANKR_API_KEY, BANKR_LLM_KEY, BANKR_API_URL, BANKR_LLM_URL
  2. Config file (~/.bankr/config.json)
  3. Defaults (API URL: https://api.bankr.bot, LLM URL: https://llm.bankr.bot)

Separate LLM key

If your LLM gateway key differs from your Bankr API key, you can configure them separately. The LLM key is used for all LLM gateway calls (bankr llm models, bankr llm credits, bankr llm setup, bankr llm claude). When not set, the API key is used for both.

# Set during login (interactive prompt or flag)
bankr login --llm-key YOUR_LLM_KEY

# Or set via config
bankr config set llmKey YOUR_LLM_KEY

# Or via environment variable
export BANKR_LLM_KEY=your_llm_key_here

Access Controls

The CLI uses the same API key as the REST API, so all server-side access controls apply:

  • Read-only keybankr prompt works, but the agent can only query data (prices, balances, analytics). It cannot execute swaps, transfers, or other write operations.
  • IP allowlist — requests from IPs not on the allowlist are rejected with a 403 error.
  • Rate limits — the same daily message limits apply (100/day standard, 1,000/day Bankr Club).

Credential storage — The API key is stored in ~/.bankr/config.json. Never commit this file to version control. Run bankr logout on shared machines and consider chmod 600 ~/.bankr/config.json to restrict file permissions.

See Access Control for full details.

Programmatic usage

The CLI also exports its API client for use in Node.js/TypeScript projects:

import { submitPrompt, pollJob, getUserInfo, getBalances } from "@bankr/cli";

// Submit and poll
const { jobId, threadId } = await submitPrompt("what is the price of ETH?");
const result = await pollJob(jobId, {
onStatus: (s) => console.log(s.status),
});
console.log(result.response);

// Continue the conversation using the threadId
const { jobId: jobId2 } = await submitPrompt("and what about BTC?", threadId);
const result2 = await pollJob(jobId2);
console.log(result2.response); // agent has context from the first question

// Get user info
const info = await getUserInfo();
console.log(info.address, info.score);

// Get wallet balances
const balances = await getBalances(["base", "solana"]);
for (const [chain, data] of Object.entries(balances.balances)) {
console.log(`${chain}: $${data.total}`);
}

See the npm package for the full API surface.