Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

folio212

Check your Trading212 portfolio from the terminal. AI-first design.

What it does

  • 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

Quick start

# 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 --json

Install

Homebrew

brew tap nezdemkovski/homebrew-tap
brew install folio212

Upgrade: brew upgrade folio212

From source

go install github.com/nezdemkovski/folio212@latest

Setup

You need a Trading212 API key to use this tool.

1. Generate API keys

  1. Open Trading212 → SettingsAPI (Beta)
  2. Accept the risk warning
  3. Tap Generate API key
  4. Enable permissions: Account data + Portfolio
  5. Save both the API Key and API Secret (secret is shown only once!)

Official guide

2. Configure folio212

Run the interactive setup:

folio212 init

This will:

  • Ask for your API key and secret
  • Validate the credentials
  • Store config in ~/.folio212/config.yaml
  • Store secret securely in your OS keyring

Usage

Check portfolio

folio212 portfolio

Output includes:

  • Holdings value and pie cash
  • Performance metrics (return, PnL, FX impact)
  • Account total breakdown
  • Allocation percentages
  • Individual position details

JSON export

folio212 portfolio --json
folio212 portfolio --json --include-raw  # Include raw API data

AI Analysis

Send 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.

Period filtering

folio212 portfolio --from 2024-01-01 --to 2024-12-31

Security

How secrets are stored

Your API secret is stored using a 3-tier approach:

  1. OS keyring (default on desktop)

    • macOS: Keychain
    • Windows: Credential Manager
    • Linux: Secret Service
  2. Environment variables (for servers/Docker)

    export FOLIO212_T212_API_SECRET="your-secret"
  3. Config file (fallback only)

    • Stored in ~/.folio212/secrets.yml with 0600 permissions
    • Shows warning when used

Server/Docker usage

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

API Permissions Required

  • Account data: Required for folio212 init to validate credentials
  • Portfolio: Required for folio212 portfolio to fetch positions
  • Metadata (optional): For richer instrument information

For Developers

See CLAUDE.md for:

  • Architecture overview
  • Code organization
  • Adding new commands
  • Layer rules and dependency directions

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages