If someone says
sf --plain, the copy-paste command you want is usually sf agent --plain. The --plain flag belongs to sf agent.
What it can do
The agent has the same market tools as the interactivesf agent session:
Use direct
--json commands for deterministic parsing. Use sf agent --plain --once when you want the SimpleFunctions agent to reason across those commands and return an analyst-style answer.
First run
Install and verify the local control plane:--once runs one turn and exits. --plain removes the TUI. --new avoids inheriting a stale local session. The --allow and --deny lists are enforced before tool execution.
Plain mode from cron
This pattern is useful for hourly thesis review or morning portfolio briefs:--record-trace for audit and regression replay:
Headless NDJSON server
Usesf agent --headless when your own LLM loop should decide which SimpleFunctions tool to call while still staying on the CLI-first path. In this mode SimpleFunctions does not run its own LLM loop; it exposes tools over newline-delimited JSON.
Start the server:
ready frame:
Minimal Node harness
Claude Code with sf agent --plain
Claude Code can run non-interactively with claude -p, the current programmatic CLI mode documented by Anthropic. That makes it a good host for SimpleFunctions CLI calls: Claude Code handles repository context and shell orchestration, while SimpleFunctions handles prediction-market tools and thesis state.
Use a narrow Bash-only prompt:
sf command families, and SimpleFunctions still enforces its own --allow / --deny policy before any tool execution.
Claude Code with the NDJSON server
For a tighter integration, have Claude Code write or run a small harness that startssf agent --headless, reads the ready manifest, and sends only approved call frames.
Example prompt:
-p mode supports structured output with --output-format json and streaming with --output-format stream-json. Use that for the outer automation layer; use sf agent --headless NDJSON for the SimpleFunctions tool layer.
Safety model
Default automation policy:write only when the automation is allowed to mutate SimpleFunctions state, such as injecting a thesis signal or creating a watchlist item. Do not add trade or runtime to unattended Claude Code, cron, or CI jobs.
For execution workflows:
- Read first:
sf me portfolio --json,sf intent list --json,sf runtime status --json. - Propose the action in text.
- Ask a human to approve.
- Prefer
sf intent buy/sf intent sellover directsf buy/sf sell. - Record the run with
--record-trace.
Related docs
Agentic CLI
Full CLI control plane, permission categories, trace and replay.
Thesis lifecycle
Create, signal, evaluate, augment, heartbeat, and publish a thesis.
Agent runtime
Long-running execution daemon, intents, and cloud runtime.
Claude Code programmatic mode
Anthropic reference for
claude -p, JSON output, and scripted runs.