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
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?
Setup
Login
bankr login
Opens bankr.bot/api in your browser so you can copy your API key, then prompts you to paste it. The key is stored in ~/.bankr/config.json.
Non-interactive flags
For AI agents or scripts that can't use interactive prompts:
# Print the dashboard URL and exit (no browser, no prompts)
bankr login --url
# 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
You can also set keys via environment variables:
export BANKR_API_KEY=your_api_key_here
export BANKR_LLM_KEY=your_llm_key_here # optional, falls back to BANKR_API_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"
| Option | Description |
|---|---|
--thread <id> | Continue a specific conversation thread |
-c, --continue | Continue 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 sign
Sign messages, typed data, or transactions without broadcasting. Calls the Sign Endpoint.
# Sign a plain text message
bankr sign --type personal_sign --message "Hello, Bankr!"
# Sign EIP-712 typed data
bankr sign --type eth_signTypedData_v4 --typed-data '{"domain":{...},"types":{...},"primaryType":"Permit","message":{...}}'
# Sign a transaction without submitting
bankr sign --type eth_signTransaction --transaction '{"to":"0x...","chainId":8453,"value":"1000000000000000000"}'
| Option | Description | Required |
|---|---|---|
-t, --type <type> | personal_sign, eth_signTypedData_v4, or eth_signTransaction | Yes |
-m, --message <text> | Message to sign (for personal_sign) | Conditional |
--typed-data <json> | EIP-712 typed data as JSON (for eth_signTypedData_v4) | Conditional |
--transaction <json> | Transaction as JSON (for eth_signTransaction) | Conditional |
This is a write operation. Read-only API keys will receive a 403 error. See Access Control.
bankr submit
Submit transactions to the blockchain. Calls the Submit Endpoint.
With explicit parameters
bankr submit tx --to 0xRecipient --chain-id 8453 --value 1000000000000000000
| Option | Description | Required |
|---|---|---|
--to <address> | Destination address | Yes |
--chain-id <id> | Chain ID (8453=Base, 1=Ethereum, 137=Polygon) | Yes |
--value <wei> | Value in wei | No |
--data <hex> | Calldata (hex string) | No |
--gas <limit> | Gas limit | No |
--gas-price <wei> | Gas price (legacy) | No |
--max-fee-per-gas <wei> | Max fee per gas (EIP-1559) | No |
--max-priority-fee-per-gas <wei> | Max priority fee (EIP-1559) | No |
--nonce <n> | Transaction nonce | No |
-d, --description <text> | Description for logging | No |
--no-wait | Return immediately without waiting for confirmation | No |
From JSON
bankr submit json '{"to":"0x...","chainId":8453,"value":"1000000000000000000"}'
| Option | Description |
|---|---|
-d, --description <text> | Description for logging |
--no-wait | Return immediately without waiting for confirmation |
This is a write operation. Read-only API keys will receive a 403 error. See Access Control.
bankr status <jobId>
Check the status of a previously submitted job:
bankr status abc123def456
bankr cancel <jobId>
Cancel a pending or processing job:
bankr cancel abc123def456
bankr whoami
Show current authentication and account info:
bankr whoami
bankr skills
List all available Bankr AI agent skills with examples:
bankr skills
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 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 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
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):
- Environment variable —
BANKR_API_KEY,BANKR_LLM_KEY,BANKR_API_URL,BANKR_LLM_URL - Config file (
~/.bankr/config.json) - 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 key —
bankr promptworks, 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 } 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);
See the npm package for the full API surface.