Install Ib Portfolio
Pick your agent. Every command is ready to paste.
npx skills add staskh/trading_skills --skill ib-portfolioThe open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.
01
Install it
Run the command above, or upload the folder in Claude.
02
Ask naturally
Describe the task. Your agent loads ib-portfolio when the request matches its description.
03
Name it if needed
If it does not trigger, say “use the ib-portfolio skill”. In Codex, type $ib-portfolio.
IB Portfolio
Fetch current portfolio positions from Interactive Brokers.
IB Connection
TWS or IB Gateway must be running locally with API enabled:
- Paper trading — port 7497
- Live trading — port 7496
IB_PORTenv var — default port when--portis omitted (e.g.IB_PORT=4001for a Gateway container). Precedence:--portflag >IB_PORT> built-in default. Set it in the shell or a.envfile.
Port fallback: If the configured port fails, automatically retry on the other port. If the retry succeeds, save to memory which account type worked (live/paper) and reuse it for all IB skill calls in this and future sessions — until the user explicitly asks for the other account. If both ports fail, ask the user to verify that TWS or IB Gateway is running with API access enabled.
Instructions
Note: If
uvis not installed orpyproject.tomlis not found, replaceuv run pythonwithpythonin all commands below.
uv run python scripts/portfolio.py [--port PORT]
Arguments
--port- IB port (default: 7497 for paper trading)--account- Specific IB account ID (optional, defaults to first account)
Output
Returns JSON with:
connected- Whether connection succeededpositions- Array of positions with symbol, quantity, avg_cost, market_value, unrealized_pnl
If not connected, explain that TWS/Gateway needs to be running.
Dependencies
ib-async
Timezone
All timestamps and time-based calculations must use the America/New_York timezone. All JSON output must include generated_at (NY time string) and data_delay fields.
Tips for Ib Portfolio
- • Start a fresh session after installing so your agent picks up the new skill.
- • This skill ships scripts. Read them before the first run, and run it in a project without secrets first.
- • It is part of a pack with 30 skills. Install only the ones you need with --skill to keep triggers precise.
- • If two skills overlap, mention the one you want by name.
Questions about Ib Portfolio
What does the Ib Portfolio skill do?
Get portfolio positions from Interactive Brokers. Use when user asks about their portfolio, positions, holdings, or what stocks they own. Requires TWS or IB Gateway running locally.
How do I install Ib Portfolio?
Run "npx skills add staskh/trading_skills --skill ib-portfolio" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.
Does Ib Portfolio work in Cursor and Codex?
Yes. Ib Portfolio uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.
Is Ib Portfolio free?
Ib Portfolio is open source on GitHub under the MIT license. It is free to install; check the license before commercial use.
Who made Ib Portfolio?
Ib Portfolio is published by staskh in the staskh/trading_skills repository, together with 29 other skills.



