Position Pilot is a local, read-only portfolio workstation for Tastytrade options traders. The primary interface is a loopback web dashboard. The Python CLI remains available for quick commands and automation.
All trading recommendations are decision support only. The application never creates, stages, submits, replaces, or cancels broker orders.
# Python + backend deps
uv sync --group devNormal installations use the prebuilt React frontend shipped inside the Python package. Contributors rebuild it with a pinned Node and pnpm toolchain (see Frontend development).
# Launch the secure local web dashboard (loopback only)
uv run pilot dashboardThis starts a loopback-only FastAPI service on an ephemeral port and opens a one-time authenticated browser session.
source .venv/bin/activate
pilot dashboardCredentials stay in .env (never committed, never exported to the browser, diagnostics, or backups as raw values).
# Tastytrade OAuth (account settings → API)
export TASTYTRADE_CLIENT_SECRET=your_client_secret
export TASTYTRADE_REFRESH_TOKEN=your_refresh_token
# Optional market/news providers
export MASSIVE_API_KEY=...
export BENZINGA_API_KEY=...AI recommendations use the local Codex CLI, authenticated through ChatGPT subscription sign-in (Codex CLI OAuth). Position Pilot never inspects, copies, or persists Codex OAuth tokens.
- Install and sign in to the Codex CLI separately using its supported ChatGPT flow.
- There is no Anthropic / API-key recommendation path in production.
- Core portfolio data remains available when Codex is signed out or unavailable.
Application settings and snapshots live under ~/.local/share/position-pilot/ (override with POSITION_PILOT_DATA_DIR). Market data cache: ~/.cache/position-pilot/ (~10 minutes).
Strategy detail includes a Tasty mechanics panel driven by the versioned educational playbook tastylive-short-premium.v1 (profit target, ~21 DTE, small size, tested-side review, credit-only roll preference). Defaults are educational presets, not guarantees. Evaluation is deterministic and offline-capable; shadow mode defaults on and never places orders. Settings: GET/PUT /api/v1/settings/mechanics. Execution remains manual in tastytrade.
The app verifies that .env is gitignored and warns if it appears tracked or broadly readable. Credential values are never read into diagnostic payloads.
# Web dashboard (only dashboard surface)
pilot dashboard
pilot dashboard --no-browser
# Positions (grouped by strategy)
pilot positions
pilot positions --raw
# Quote
pilot quote SPY
# Deterministic health metrics (Codex recommendations: use the web UI)
pilot analyze
# Market overview
pilot market
# Watchlist
pilot watchlist show
pilot watchlist add TSLA
pilot watchlist remove SPY
# Accounts
pilot account list
pilot account set 12345678src/position_pilot/
├── cli.py # Typer CLI
├── client/tastytrade.py # Read-only Tastytrade API client
├── domain/ # Application services (portfolio, risk, catalysts, recommendations, operations, …)
├── providers/ # Tastytrade, Codex CLI, Massive, Benzinga
├── persistence/sqlite.py # Versioned SQLite + backups
├── streaming/ # DXLink + account streaming
├── analysis/ # Strategy detection, market analytics
└── web/ # FastAPI + prebuilt static frontend
frontend/ # React / TypeScript / Vite sources
- Web-only dashboard — legacy Textual TUI removed in Phase 7.
- LLM recommendations via local Codex CLI — ChatGPT subscription; no Anthropic SDK.
- Domain services shared by CLI and web.
- Deterministic risk never depends on AI.
- Read-only, loopback-only security model.
- Operations — CSV/HTML/PDF export, redacted diagnostics, retention controls, backup/restore, explicit update readiness (never auto-install).
Confirmed requirements: docs/PRD.md, docs/IMPLEMENTATION_PLAN.md.
Tastytrade API → PortfolioService snapshot
↓
detect_strategies() → multi-leg groups (never cross-account)
↓
RiskService / CatalystService / RecommendationService (Codex)
↓
Web dashboard (decision support only)
From the web Settings panel (authenticated local session):
| Capability | Notes |
|---|---|
| Portfolio / history CSV | Current snapshot and historical summaries |
| Printable HTML / PDF | Timestamped, attributed, decision-support disclaimer |
| Redacted diagnostic JSON/ZIP | No credentials, tokens, cookies, prompts, licensed full text, or raw env |
| Retention | Preview then explicit apply; audit-critical history not silently purged |
| Backups | List / create / download / restore with integrity checks; restore blocked while monitoring runs; pre-restore backup always created |
| Update readiness | Current/schema awareness, backup required, never auto-installs or runs package managers |
.env checks |
gitignore / tracking / permissions warnings without reading values |
- Disable monitoring if it is running.
- Create a manual backup from Settings.
- Install the new version yourself (
git pull+uv sync --group devas appropriate). - Launch
pilot dashboardand confirm schema migrations complete. - Restore the pre-update backup if needed.
Backups occur before migrations and daily while monitoring runs (seven daily / four weekly). .env is excluded.
Supported contributor toolchain:
- Node.js 22.x (see
frontend/.nvmrc) - pnpm 11.7.0 (see
packageManagerinfrontend/package.json)
cd frontend
pnpm install
pnpm run typecheck
pnpm run build # writes into src/position_pilot/web/static/
pnpm run test:browser # Playwright + axeuv sync --group dev
uv run ruff check src/ tests/
uv run ruff format src/ tests/
uv run pytest
uv run pytest tests/test_operations.py -q
# Opt-in live Tastytrade read-only smoke (accounts/positions/quotes only)
POSITION_PILOT_LIVE_SMOKE=1 uv run pytest tests/test_live_tastytrade_smoke.py -q
cd frontend && pnpm run typecheck && pnpm run build && pnpm run test:browser
uv buildArchitecture targets (regression-tested): 5 accounts, 500 open legs, 200 strategies, 100 watchlist symbols — via batch enrichment, shared services, and frontend table pagination.
- Python 3.12+, FastAPI, Typer, Pydantic, Rich, httpx, uvicorn
- React, TypeScript, Vite, pnpm
- Local Codex CLI for AI recommendations (ChatGPT subscription OAuth)
- Tastytrade OAuth for read-only market data and positions
- Python 3.12+
- Tastytrade account (OAuth client secret + refresh token)
- Optional: Codex CLI signed in with ChatGPT for recommendations
- Optional: Massive / Benzinga keys for extended market/news
Apache 2.0