Skip to main content

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.

Install

command not found: sf

Your npm global bin isn’t on PATH:
npm config get prefix
# add the resulting path's /bin to your PATH
Or install via brew:
brew install simplefunctions

Auth

AUTH_INVALID on every command

Your API key is wrong, expired, or revoked.
sf status --json | jq '.auth'
sf login    # re-issue

AUTH_FORBIDDEN on a specific command

The key works but lacks scope. Issue a new key with the right scopes — see API keys.

Rate limits

RATE_LIMITED on every call

Wait Retry-After seconds. Sustained rate limiting means you need a higher tier — see Rate limits.

Trading

RISK_GATE_FAIL

details.blocked[] lists the gate(s). Common causes:
  • Daily loss cap hit — wait until UTC day rolls.
  • Total exposure cap — close positions or raise max_total_exposure_cents.
  • Cooldown — wait the configured tick count.
See Risk gates.

EXECUTION_HALTED

Your execution_mode is halted. Triggered automatically when drawdown breaches max_drawdown_halt_cents. Recover with:
sf portfolio config executionMode live
(After verifying the halt was for the right reason.)

EXCHANGE_REJECT

The venue rejected the order. The error message includes the venue’s reason. Common: market closed, price out of range, position limit at venue.

Webhooks

Endpoint auto-paused

50%+ failure rate over 24h. Fix the receiver, then:
sf webhooks resume <endpoint-id>

Signature verification fails

Common pitfalls:
  1. Receiver consumed the body before passing to verifier. Use raw body.
  2. Receiver decoded JSON before verifying. Verify on the raw bytes.
  3. Clock skew > 5 minutes. Sync your server time.
  4. Wrong secret. Re-issue with sf webhooks rotate-secret <id>.
See Webhook receiver.

CLI agent

Order cancelled (no confirmation)

You’re in a non-TTY environment (autopm, CI, scripted). Set:
export SF_AUTO_CONFIRM=1
Do not set SF_AUTO_CONFIRM=1 in production unless you understand the implications. It bypasses interactive confirmation. Risk gates still run, but if any code path proceeds despite a gate failure (a bug), there’s no human in the loop.

Agent loops without acting

Check if execution_mode is dry-run. Agent will keep recommending without acting. Switch to live only after you trust the agent’s behavior.

See also

Errors reference

Every error code with status and fix path.

FAQ

Frequently asked questions.

Status

Live system status and incident history.