Skip to main content
The SimpleFunctions CLI is designed to be driven by an LLM. The recommended loop, the tool classifications, and the JSON contract all assume an agent — not a human — is the primary caller.
1

Discover tools

sf describe --all --json returns every command with its safety class and JSON shape.
2

Pull world state

sf world --json for fresh global context, or sf world --delta --json --since 1h for a long-running agent.
3

Query or inspect

sf query for natural-language search, sf inspect <ticker> for a structured market dossier.
4

Pull account context

sf me --json --detail if authenticated.
5

Decide

Monitor, create an intent, place an order, or wait.
sf describe --all --json
sf world --json
sf query "Fed rate cut" --json --limit 3
sf inspect KXRATECUT-26DEC31 --json
sf portfolio history --json --ticks 10 --trades 10 --since 2026-04-23

Long-running agents

Use deltas instead of full snapshots so the context window stays small:
sf world --delta --json --since 1h
Use bounded account reads:
sf me --json --detail --limit 10
sf feed --json --hours 6
sf portfolio history --json --ticks 0 --trades 50 --status open

Safety classes

Agents should treat commands as:
ClassMeaning
safe_readPublic read-only. No auth required. Always safe to call.
account_readAuthenticated read-only. Returns user-scoped data. Safe to call.
server_writeMutates SimpleFunctions server state (creates intents, theses, alerts). Reversible.
local_runtimeStarts/stops a local process (e.g. sf agent). Side-effects on the local box only.
exchange_writeCan place or cancel orders on Kalshi or Polymarket. Real money.
Always check sf describe --all --json for the safety class before calling a command. exchange_write commands fail-closed without a TTY unless SF_AUTO_CONFIRM=1 is set, but the gate is still your last line of defense — review the order before confirming.

Headless mode

sf agent --headless
Emits NDJSON tool calls on stdout and waits for tool responses on stdin. Useful when you want to drive sf’s tool surface from your own LLM harness — for example, embed it in a scheduled task, CI job, or another agent runtime. See Common workflows for a worked example.

MCP

Same tools, different transport. See MCP server for the wire-up.

Next steps

JSON contract

CLI envelope shape and exit codes.

Tool manifest

Discover every command programmatically.

CLI command reference

Comprehensive command surface.

Risk gates

Pre-trade safety rails for exchange_write commands.