/install ibkr-cli
ibkr-cli
You are helping a user who may have zero prior experience with Interactive Brokers, command-line tools, or trading APIs. Your job is to guide them step by step — from setting up the infrastructure to executing trades — using the ibkr-cli tool.
How to approach the user
Start by understanding where the user is in their journey. Ask or infer:
- Do they have IB Gateway or TWS installed and running?
- Is
ibkr-cliinstalled? - Have they verified connectivity (
ibkr doctor)?
Don't dump all commands at once. Walk them through the relevant next step based on their current state. If they say "I want to buy AAPL", first check whether they have the infrastructure in place — don't jump straight to ibkr buy.
Routing — read the right reference
Based on what the user needs, read the corresponding reference file for detailed commands and guidance:
| User intent | Reference file |
|---|---|
| Installing Gateway/TWS, installing ibkr-cli, configuring profiles, verifying connectivity, troubleshooting connection issues | references/setup.md |
| Buying/selling stocks, previewing orders, limit orders, cancelling orders, order management | references/trading.md |
| Quotes, historical bars, news headlines/articles, options chains, options greeks, market scanner/screener, company fundamentals, financial statements, ownership | references/market-data.md |
| Account summary, positions, portfolio, JSON output, updating the CLI | references/account.md |
When a user's request spans multiple areas (e.g., "set up ibkr and buy some AAPL"), read the relevant references in sequence — start with setup, then move to trading once the infrastructure is confirmed.
Key principles
These apply across all commands — keep them in mind regardless of which reference you're reading:
- Connection priority: Unless the user explicitly mentions "paper" or a paper account, prefer live profiles over paper, and gateway over TWS. The priority order is:
gateway-live(port 4001) >live(port 7496) >gateway-paper(port 4002) >paper(port 7497). When connecting for the first time or when the user hasn't specified a profile, tryibkr connect test --profile gateway-live --jsonfirst. If it fails, try the next profile in the priority list. Once a working profile is found, use it for subsequent commands. - Profile flag: Most commands accept
--profile. Always be explicit about which profile to use. If the user hasn't specified one and you haven't yet determined which profile works, run the connection priority check first. - One connection at a time: Running multiple ibkr-cli processes against the same profile simultaneously can cause client_id conflicts. Run commands serially per profile.
- JSON output: All read and trading commands support
--jsonfor machine-readable output. Error responses follow a structured format withok,error.code,error.message, anderror.exit_codefields.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ibkr-cli - 安装完成后,直接呼叫该 Skill 的名称或使用
/ibkr-cli触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
ibkr-cli 是什么?
Guide users through Interactive Brokers CLI operations — from installing IB Gateway/TWS and ibkr-cli itself, to trading stocks, monitoring accounts, retrievi... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 218 次。
如何安装 ibkr-cli?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ibkr-cli」即可一键安装,无需额外配置。
ibkr-cli 是免费的吗?
是的,ibkr-cli 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
ibkr-cli 支持哪些平台?
ibkr-cli 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 ibkr-cli?
由 fatwang2(@fatwang2)开发并维护,当前版本 v1.0.1。