Skip to content

north-brook/broker-cli

Repository files navigation

broker-cli

Give your AI agent a brokerage account.

Broker APIs exist. SDKs exist. But AI agents use the command line. broker-cli turns any brokerage into shell commands your agent already understands, with a SKILL.md that teaches it everything.

📖 brokercli.com · 📚 Reference

Install

curl -fsSL https://brokercli.com/install | bash

Or clone and install manually:

git clone https://github.com/north-brook/broker-cli && cd broker-cli && ./install.sh

Then finish provider setup from any directory:

broker setup

Quick Start

broker setup                   # Choose provider + configure credentials
broker daemon start --paper   # Start in paper trading mode
broker daemon status           # Check connection
broker quote AAPL MSFT         # Get quotes
broker positions               # View portfolio
broker exposure --by symbol    # Exposure analysis
broker order buy AAPL 100 --limit 185 \
  --decision-name "Initiate AAPL Position" \
  --decision-summary "Open core position" \
  --decision-reasoning "## Thesis\nHigh-conviction setup."   # Place an order

Built for Agents

  • SKILL.md Included — Ships with a skill file that Codex, Claude Code, and OpenClaw agents read automatically. Your agent knows every command, flag, and workflow without extra prompting.
  • CLI-First, Agent-Ready — Every action is a shell command. Agents don't need SDKs, API keys, or custom integrations — just bash.
  • Autonomous Execution — Persistent auth keeps sessions alive 24/7. No manual logins, no token expiry interruptions.
  • Multi-Broker — Unified commands across E*Trade and Interactive Brokers. One skill file, one interface.
  • Full Options Support — Option chains with greeks, expiry filtering, and strike ranges.

Supported Brokers

Feature Interactive Brokers E*Trade
Real-time quotes
Option chains + greeks
All order types
Cancel all
Positions & P/L
Exposure analysis
Persistent auth
Streaming events
Historical bars

Commands

broker daemon start              Start the trading daemon
broker daemon start --paper      Paper trading mode
broker daemon status             Daemon status and connection info
broker daemon stop               Graceful shutdown
broker setup                     Choose provider and configure credentials
broker update                    Sync local install to latest commit on main
broker uninstall                 Remove broker-cli install/setup artifacts
broker quote SYMBOL...           Snapshot quotes
broker watch SYMBOL              Live quote stream
broker chain SYMBOL              Option chain with greeks
broker history SYMBOL            Historical bars
broker order buy SYMBOL QTY      Buy order (requires --decision-name/--decision-summary/--decision-reasoning)
broker order sell SYMBOL QTY     Sell order (requires --decision-name/--decision-summary/--decision-reasoning)
broker order bracket SYMBOL QTY  Bracket order (entry + TP + SL, requires decision flags)
broker order status ORDER_ID     Order status
broker orders                    List orders
broker cancel ORDER_ID           Cancel an order
broker cancel --all              Cancel all open orders
broker fills                     Execution history
broker positions                 Current positions
broker pnl                       P&L summary
broker balance                   Account balances and margin
broker exposure --by symbol      Exposure breakdown
broker audit orders              Order audit trail
broker audit commands            Command audit trail

E*Trade Setup

broker setup

Persistent Auth (Headless)

Keep E*Trade authenticated across the daily midnight token expiry:

{
  "broker": {
    "provider": "etrade",
    "etrade": {
      "consumer_key": "...",
      "consumer_secret": "...",
      "username": "your_username",
      "password": "your_password",
      "persistent_auth": true
    }
  }
}

Or via environment variables:

export BROKER_ETRADE_USERNAME=your_username
export BROKER_ETRADE_PASSWORD=your_password
export BROKER_ETRADE_PERSISTENT_AUTH=true

Requires Playwright: pip install playwright && playwright install chromium

Accounts with 2FA/MFA enabled cannot use persistent auth. Run broker setup to complete manual OAuth when needed.

Uninstall

broker uninstall

Use broker uninstall --yes for non-interactive cleanup.

Configuration

Path Description
~/.config/broker/config.json Config file
~/.config/broker/etrade_tokens.json E*Trade tokens
~/.local/state/broker/broker.sock Daemon socket
~/.local/state/broker/broker.log Daemon log
~/.local/share/broker/ Audit data

Repository Layout

cli/           CLI package
daemon/        Daemon package
sdk/python/    Python SDK
sdk/typescript/ TypeScript SDK
install/       Installer and bootstrap
website/       Marketing site (brokercli.com)

Development

bun install    # Install hooks
bun run ci:all # Lint + typecheck + test

About

Broker CLI for AI Agents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors