Documentation Index
Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt
Use this file to discover all available pages before exploring further.
CLI runtime
| Variable | Purpose |
|---|
SF_API_KEY | API key override (takes precedence over config file) |
SF_API_URL | Base URL override (default https://simplefunctions.dev) |
SF_TRADING_ENABLED | Set to true to allow sf buy/sell/cancel |
SF_AUTO_CONFIRM | Set to 1 to bypass confirmInteractive (non-TTY agent flow) |
SF_DEBUG | Verbose logs to stderr |
KALSHI_API_KEY_ID | Kalshi key id |
KALSHI_PRIVATE_KEY_PEM | Kalshi PEM contents (alternative to file path) |
KALSHI_BASE_URL | Override Kalshi API base |
POLYMARKET_WALLET | Wallet address override |
DEFAULT_MODEL | LLM for sf agent |
OPENROUTER_API_KEY | OpenRouter key for sf agent |
ANTHROPIC_API_KEY | Anthropic key (alternative path) |
Portfolio autopilot runtime (src/trigger/portfolio-tick.ts)
These are set transiently per tick and erased on exit:
| Variable | Purpose |
|---|
PORTFOLIO_EXECUTION_MODE | dry-run / live / halted |
RISK_MAX_TOTAL_EXPOSURE | Cents |
RISK_MAX_PER_MARKET | Cents |
RISK_MAX_DAILY_LOSS | Cents |
RISK_MAX_POSITIONS | Count |
RISK_MIN_BALANCE | Cents |
RISK_MAX_ORDERS_PER_TICK | Count |
RISK_COOLDOWN | Tick count |
RISK_MAX_SINGLE_ORDER | Cents |
PORTFOLIO_ENCRYPTION_KEY | Server secret for AES-256-GCM decrypt of stored Kalshi PEM |
Alert runtime worker (scripts/workers/alert-runtime.ts)
| Variable | Default | Purpose |
|---|
DATA_API_BASE | https://data.simplefunctions.dev/v1 | Data API base URL |
DATA_WS_URL | wss://app.simplefunctions.dev/ws | WS URL |
ALERT_RUNTIME_INTERVAL_MS | 30000 | Loop interval |
ALERT_RUNTIME_DELIVERY_ENABLED | true | Master delivery toggle |
ALERT_RUNTIME_WEBHOOKS_ENABLED | true | Webhook fanout toggle |
ALERT_RUNTIME_WS_ENABLED | true | WS preferred (fallback to REST) |
DATABASE_URL | — | Postgres connection (required) |
Server-side (Vercel + Trigger.dev)
| Variable | Purpose |
|---|
DATABASE_URL | Postgres |
RESEND_API_KEY | Email delivery |
OPENROUTER_API_KEY | LLM gateway |
KALSHI_PROXY_URL | Cloudflare proxy URL |
CRON_SECRET | Vercel cron auth header |
FLY_API_TOKEN | For sf-runtime exec |
R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY | Data dump |
HF_TOKEN | HuggingFace push |
AGENTMAIL_API_KEY | Heartbeat reply-to inbox |
RESEND_WEBHOOK_SECRET | Email delivery webhook signature |
Confirming environment
sf status --json | jq '.env'
Returns which env vars the CLI sees set (values redacted).