# Strave CLI (/docs/api/cli)

Scaffold Siege apps, run a local Sandbox mock server, test webhooks, preview overlays, and manage events from your terminal.

The `@strave/cli` package gives you local development tools for Strave
integrations alongside terminal commands to inspect and manage your events,
matches, and broadcast playdays.

## Run the CLI [#run-the-cli]

Run commands directly with `bunx` or install the CLI globally:

```sh
bunx @strave/cli help
```

## Scaffold a starter project [#scaffold-a-starter-project]

`strave init` creates a standalone starter directory wired to the Strave SDKs.
Choose from five templates: `nextjs-auth`, `discord-bot`, `broadcast-overlay`,
`replay-dashboard`, and `esports-tracker`.

```sh
bunx @strave/cli init nextjs-auth my-siege-app
```

## Run the local mock API server [#run-the-local-mock-api-server]

`strave mock` starts an offline HTTP server on `http://127.0.0.1:4747/api/v2`
backed by the Sandbox fixtures and SSE stream.

```sh
bunx @strave/cli mock --port 4747
```

## Test webhooks locally [#test-webhooks-locally]

Use `strave trigger` to send an HMAC SHA-256 signed webhook directly to your
local server, or `strave listen` to verify and forward incoming deliveries:

```sh
bunx @strave/cli trigger match.result_accepted \
  --url http://127.0.0.1:3000/api/webhooks/strave
```

```sh
bunx @strave/cli listen \
  --forward http://127.0.0.1:3000/api/webhooks/strave \
  --port 4748
```

## Preview a broadcast overlay [#preview-a-broadcast-overlay]

`strave overlay dev` serves a local preview harness that implements the
`@strave/overlay-sdk` `postMessage` handshake with manual team, score, and map
controls.

```sh
bunx @strave/cli overlay dev --entry ./index.html --port 4749
```

## Manage events, matches, and replays [#manage-events-matches-and-replays]

You can also inspect tournaments, watch live SSE streams, update playday overlay
scores, and read `.rec` replay headers from your terminal. Pass `--sandbox` to
test against Sandbox data, or set `STRAVE_API_KEY` for live organisations.

```sh
bunx @strave/cli events get event_sbx_eml_s7 --sandbox
bunx @strave/cli events standings event_sbx_eml_s7 --sandbox
bunx @strave/cli matches watch event_sbx_eml_s7 --sandbox
bunx @strave/cli playdays score event_sbx_eml_s7 playday_sbx_day_1 6 4 --revision 7 --sandbox
bunx @strave/cli replay inspect ./Match-*-R*.rec
```

## Next steps [#next-steps]

- Install [SDKs and packages](/docs/api/sdks) in your scaffolded project.
- Connect the Builder MCP server in [Connect an MCP client](/docs/api/mcp).