← Back to blog

Introducing broker-cli: Give Your AI Agent a Brokerage Account

·3 min read·North Brook
launchagentic-tradingopen-source

AI coding agents — Codex, Claude Code, OpenClaw — interact with the world through shell commands. They can git push, run tests, deploy apps. But they can't trade.

Broker APIs exist. SDKs exist. But agents don't use HTTP clients or OAuth flows well. They use bash.

broker-cli closes that gap.

What it does

Install broker-cli, and your agent gets a full trading interface through the terminal:

broker quote AAPL MSFT          # Get quotes
broker snapshot --symbols AAPL,MSFT
broker exposure --by symbol     # Analyze exposure
broker order buy AAPL 100 --dry-run --idempotency-key aapl-100
broker chain AAPL --type call --limit 50 --fields strike,expiry,bid,ask
broker cancel --all             # Cancel everything

Every command returns a deterministic JSON envelope: {ok,data,error,meta}. No SDKs, no API keys to manage, no custom integrations — just shell commands.

The SKILL.md advantage

broker-cli ships with a SKILL.md file that agents read automatically. This means your agent knows every command, flag, and workflow without extra prompting. Point it at a task, and it figures out which commands to run:

$ codex exec "Check my portfolio. If any position exceeds 20% of NLV, trim it to 15%."

agent → reading SKILL.md...
agent → broker exposure --by symbol
agent → TSLA is 34.2% of NLV. Reducing to 15%.
agent → broker order sell TSLA 142 --limit 248.50 --dry-run --idempotency-key rebalance-tsla
✓ Order placed. TSLA exposure now 15.1% of NLV.

Multi-broker, one interface

broker-cli currently supports Interactive Brokers and E*Trade, with a unified command interface across both. Your agent doesn't need to know which broker is behind the scenes — the commands are the same.

FeatureInteractive BrokersE*Trade
Real-time quotes
Option chains + greeks
All order types
Exposure analysis
Persistent auth
Streaming events

Safety first

We built broker-cli with guardrails:

Get started

curl -fsSL https://brokercli.com/install | bash
broker setup
broker daemon start --paper

broker-cli is open source. Check out the GitHub repo, read the full reference, and give your agent a brokerage account.