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

# Install

> Install the SimpleFunctions CLI, authenticate, and verify — every other surface layers on top.

The `sf` CLI is the primary surface. Install it once and the API, SDK, Agent SDK, MCP adapter, and web terminal can share the same account context.

## npm

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

Verify:

```bash theme={null}
sf --version
```

## First-time setup

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

`sf setup` walks you through:

<Steps>
  <Step title="SimpleFunctions API key">
    Pasted from `simplefunctions.dev/dashboard/keys`, or auto-issued via `sf login`.
  </Step>

  <Step title="Kalshi credentials (optional)">
    Your private key for read-only positions or live trading.
  </Step>
</Steps>

Credentials live in `~/.config/simplefunctions/config.json`. They never leave your machine unless you opt into BYOK cloud secrets via `sf portfolio enable`.

<Tip>
  If you want to run portfolio autopilot in the cloud, see [Portfolio autopilot](/guides/portfolio-autopilot). The CLI encrypts your Kalshi private key before upload; the cloud runner decrypts it only for the active tick.
</Tip>

## Login

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

Opens a browser. After authorization, the CLI receives a long-lived API key and writes it to your config.

To rotate or scope keys, see [API keys](/enterprise/api-keys).

## Verify

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

Returns your account context, plan, Kalshi linkage, and recent activity. If this prints a JSON envelope without an `error` field, you're set.

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" href="/quickstart">
    First 5 minutes — agent loop with curl + CLI.
  </Card>

  <Card title="CLI quickstart" href="/start/cli-quickstart">
    First JSON commands and tool discovery.
  </Card>

  <Card title="SDK quickstart" href="/start/sdk-quickstart">
    Install the TypeScript SDK and read market context.
  </Card>

  <Card title="Agent SDK quickstart" href="/start/agent-sdk-quickstart">
    Run the first Cursor-style market agent.
  </Card>

  <Card title="MCP server" href="/cli/mcp-server">
    Wire up Claude Desktop or Cursor.
  </Card>

  <Card title="Direct API access" href="/build/direct-api-access">
    Call the HTTP API from curl, TypeScript, Python, services, and agents.
  </Card>
</CardGroup>
