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.
The CLI is the local command surface for agents. It can read public market state, read authenticated user context, inspect portfolio history, run one-shot research, and expose a headless tool server.
If an agent consumes the output, pass --json.
Install and login
npm install -g @spfunctions/cli
sf login
sf status --json
sf login configures the SimpleFunctions API key. Exchange credentials stay local unless you explicitly enable cloud/runtime features.
Start here
sf me --json
sf describe --all --json
sf tools search "portfolio history" --json
| Command | Use |
|---|
sf me --json | Bounded boot context: config status, portfolio summary, exchange reads, next commands. |
sf describe --all --json | Full local command manifest with options, requirements, policy tags, and side-effect level. |
sf tools search "<task>" --json | Find the best command for a task. |
Read public market state
Search natural-language event questions:
sf query "Fed rate cut" --json --limit 3
Fetch compact world state:
sf world --json
sf world --delta --json --since 1h
Inspect one market:
sf inspect KXRATECUT-26DEC31 --json
Screen markets:
sf screen --json --limit 20
sf cross-venue --json --preset arb
sf newmarkets --json --hours 24
Query public source context:
sf policy "SAVE Act" --json
sf bill 119-hr-22 --json
sf econ "unemployment rate" --json
sf fred UNRATE --json
Read user context
sf me --json --detail --limit 10
sf feed --json --hours 24
sf list --json
sf intent list --json
sf portfolio status --json
Use sf me --json for bootstrapping. Use narrower commands when the agent needs a specific user-scoped surface.
Read portfolio memory
sf portfolio status --json
sf portfolio history --json --ticks 20 --trades 10 --since 2026-04-23
sf portfolio last --json --include handoff
sf portfolio tick <id> --json
sf portfolio trade <id> --json
Portfolio history is the audit trail for the autonomous portfolio manager: ticks, trades, handoff notes, risk gates, actions taken, config snapshots, and page cursors.
Views and strategies are separate:
sf portfolio view list --json
sf portfolio strategy list --json
One-shot agent
Use sf ask when a process wants one answer and then exits.
sf ask "Summarize my current portfolio risk and cite the relevant ticks" --json --budget 0.50
Use sf research for parallel perspective research:
sf research "Fed cut pricing versus labor market data" --json --perspectives macro,rates,markets
Interactive and headless agent
Interactive text agent:
sf agent --plain
sf agent --plain --once "Inspect KXRATECUT-26DEC31 and tell me what changed"
Headless tool server for an external LLM:
sf agent --headless --deny trade,runtime
The headless process speaks NDJSON messages such as ready, call, result, error, and wake. Use it when another model or orchestration layer owns the conversation but wants SimpleFunctions tools.
Permissions
Use --allow and --deny on agent commands.
sf agent --plain --allow read,user_data --once "Summarize my positions"
sf agent --headless --deny trade,runtime
sf agent --plain --allow read,user_data,research --deny trade
Common categories:
| Category | Meaning |
|---|
read | Public or local reads. |
user_data | Authenticated user-scoped reads. |
research | LLM/research commands. |
write | Mutates SimpleFunctions state. |
runtime | Starts or controls daemons. |
trade | Creates execution intents or exchange orders. |
Trace and replay
Record a run:
sf agent --plain --record-trace traces/fed-cut.ndjson --once "Inspect Fed cut markets"
Replay tool outputs:
sf agent --plain --replay-trace traces/fed-cut.ndjson --once "Inspect Fed cut markets"
Use traces for regression tests, deterministic demos, and tool-call audits.
Agent loop
sf status --json
sf me --json
sf describe --all --json
sf tools search "event probability search" --json
sf query "Fed rate cut" --json --limit 3
sf inspect KXRATECUT-26DEC31 --json
sf portfolio history --json --ticks 10 --trades 5
Then choose whether to continue with a read-only agent, a runtime, or an execution workflow.