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

# CLI quickstart

> Install sf, run the first JSON market reads, and discover the command manifest.

Use the CLI when a human operator, local script, cron job, or external coding agent owns the runtime.

## 1. Install

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

## 2. Configure auth when needed

Public query, world, and market reads can start without exchange keys. Account, portfolio, intent, and execution workflows need a SimpleFunctions API key.

```bash theme={null}
sf login
# or
export SF_API_KEY="sf_..."
```

## 3. Run the first reads

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

Every command above should print one JSON document on stdout.

## 4. Discover commands before acting

```bash theme={null}
sf describe --all --json
sf tools plan "read world state and inspect Fed markets" --json
```

Use the manifest to check auth, side effects, JSON support, and arguments before an agent calls a command.

## 5. Use direct contract tools

```bash theme={null}
sf agent --tool world.read --stream-json --compact
sf agent --tool markets.search --input '{"query":"Fed CPI","limit":3}' --ndjson --compact
```

`sf agent --tool` accepts canonical dotted names from `/api/contracts/tools`, not broad hosted compatibility names.

## Next steps

<CardGroup cols={2}>
  <Card title="Agentic CLI" href="/cli/agentic-cli">
    Full CLI control-plane guide.
  </Card>

  <Card title="Command reference" href="/cli/command-reference">
    Command inventory and examples.
  </Card>

  <Card title="API quickstart" href="/start/api-quickstart">
    Call the same surfaces over HTTP.
  </Card>

  <Card title="Agent SDK quickstart" href="/start/agent-sdk-quickstart">
    Embed the loop in TypeScript.
  </Card>
</CardGroup>
