Check your Trading212 portfolio from the terminal. AI-first design.
- AI-ready JSON export - Pipe your portfolio data directly to AI assistants (Claude, ChatGPT, etc.) for instant analysis, rebalancing suggestions, or tax optimization
- Quick portfolio overview - See all your holdings, allocations, and performance in one view
- Secure by default - API secrets stored in your OS keyring (macOS Keychain, Windows Credential Manager, Linux Secret Service)
- Works everywhere - Desktop, servers, Docker with environment variable fallback
# Install
go install github.com/nezdemkovski/folio212@latest
# Or use Homebrew
brew tap nezdemkovski/homebrew-tap
brew install folio212
# Setup (interactive)
folio212 init
# Check your portfolio
folio212 portfolio
# Export as JSON
folio212 portfolio --jsonbrew tap nezdemkovski/homebrew-tap
brew install folio212Upgrade: brew upgrade folio212
go install github.com/nezdemkovski/folio212@latestYou need a Trading212 API key to use this tool.
- Open Trading212 → Settings → API (Beta)
- Accept the risk warning
- Tap Generate API key
- Enable permissions: Account data + Portfolio
- Save both the API Key and API Secret (secret is shown only once!)
Run the interactive setup:
folio212 initThis will:
- Ask for your API key and secret
- Validate the credentials
- Store config in
~/.folio212/config.yaml - Store secret securely in your OS keyring
folio212 portfolioOutput includes:
- Holdings value and pie cash
- Performance metrics (return, PnL, FX impact)
- Account total breakdown
- Allocation percentages
- Individual position details
folio212 portfolio --json
folio212 portfolio --json --include-raw # Include raw API dataSend your portfolio data to AI for instant insights:
# Copy to clipboard and paste into Claude, ChatGPT, etc.
folio212 portfolio --json | pbcopy # macOS
folio212 portfolio --json | xclip -selection clipboard # Linux
# Or pipe directly to AI CLI tools
folio212 portfolio --json | llm "Analyze my portfolio and suggest rebalancing"
folio212 portfolio --json | claude "What are the tax implications of my holdings?"
folio212 portfolio --json | chatgpt "Compare my allocation to a 60/40 portfolio"The JSON includes complete holdings data, performance metrics, and cost basis - everything an AI needs to provide meaningful analysis.
folio212 portfolio --from 2024-01-01 --to 2024-12-31Your API secret is stored using a 3-tier approach:
-
OS keyring (default on desktop)
- macOS: Keychain
- Windows: Credential Manager
- Linux: Secret Service
-
Environment variables (for servers/Docker)
export FOLIO212_T212_API_SECRET="your-secret"
-
Config file (fallback only)
- Stored in
~/.folio212/secrets.ymlwith0600permissions - Shows warning when used
- Stored in
For headless environments without a keyring:
# Recommended: Use environment variable
export FOLIO212_T212_API_SECRET="your-secret"
folio212 portfolio
# Or use the --env flag pattern
FOLIO212_T212_API_SECRET="your-secret" folio212 portfolio- Account data: Required for
folio212 initto validate credentials - Portfolio: Required for
folio212 portfolioto fetch positions - Metadata (optional): For richer instrument information
See CLAUDE.md for:
- Architecture overview
- Code organization
- Adding new commands
- Layer rules and dependency directions
MIT