> ## 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.

# Quickstart

> Zero-to-running agent loop in 8 steps — install CLI, query, world state, inspect, account context, portfolio, tool discovery.

This quickstart gives an agent or developer a working path in five minutes. The product order is CLI first, HTTP API second, SDK / Agent SDK third, and MCP last as a compatibility adapter.

1. install the CLI
2. run a public market query
3. pull world state
4. inspect one market
5. discover the full command manifest

## 1. Install

```bash theme={null}
npm install -g @spfunctions/cli
```

Check that the binary is available:

```bash theme={null}
sf status --json
```

## 2. Configure auth when you need account data

```bash theme={null}
sf login
```

or set an API key:

```bash theme={null}
export SF_API_KEY="sf_live_..."
export SF_API_URL="https://simplefunctions.dev"
```

Public market and world-state reads do not require an API key. Account, portfolio, thesis, intent, and exchange-related reads do.

## 3. Query prediction markets

```bash theme={null}
sf query "Fed rate cut" --json --limit 3
```

The result should be one JSON document containing normalized Kalshi and Polymarket markets, implied probabilities, related contracts, source context, traditional-market anchors, and next actions.

HTTP equivalent:

```bash theme={null}
curl "https://simplefunctions.dev/api/public/query?q=Fed%20rate%20cut&limit=3"
```

## 4. Read world state

```bash theme={null}
sf world --json
sf world --delta --json --since 1h
```

Use the full snapshot at session start. Use deltas inside a long-running loop.

HTTP equivalents:

```bash theme={null}
curl "https://simplefunctions.dev/api/agent/world?format=json"
curl "https://simplefunctions.dev/api/agent/world/delta?since=1h&format=json"
```

## 5. Inspect a market

```bash theme={null}
sf inspect KXRATECUT-26DEC31 --json
```

Returns market metadata, price, liquidity, indicators, regime state, related surfaces, and follow-up URLs.

HTTP equivalent:

```bash theme={null}
curl "https://simplefunctions.dev/api/agent/inspect/KXRATECUT-26DEC31"
```

## 6. Pull account context

```bash theme={null}
sf me --json --detail --limit 10
sf feed --json --hours 24
sf intent list --json
sf portfolio status --json
```

`sf me` returns a bounded boot context. Use `sf feed`, `sf intent list`, and `sf portfolio ...` when the agent needs a narrower user-scoped read.

## 7. Pull portfolio history

```bash theme={null}
sf portfolio status --json
sf portfolio history --json --ticks 20 --trades 10 --since 2026-04-23
sf portfolio last --json --include handoff
sf portfolio view list --json
sf portfolio strategy list --json
```

Portfolio reads are scoped to the authenticated user.

## 8. Discover tools before acting

```bash theme={null}
sf describe --all --json
```

Agents should use the manifest to see each command's args, options, auth requirements, policy tags, side-effect level, and JSON support.

## Minimal agent loop

```bash theme={null}
sf describe --all --json
sf world --json
sf query "Fed rate cut" --json --limit 3
sf inspect KXRATECUT-26DEC31 --json
sf world --delta --json --since 1h
```

If you want a surface-specific first run, use the [CLI quickstart](/start/cli-quickstart), [API quickstart](/start/api-quickstart), [SDK quickstart](/start/sdk-quickstart), or [Agent SDK quickstart](/start/agent-sdk-quickstart). Use [MCP](/cli/mcp-server) only when your client specifically requires MCP.

If authenticated:

```bash theme={null}
sf feed --json --hours 24
sf portfolio history --json --ticks 20 --trades 10 --since 2026-04-23
sf intent list --json
```
