> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trystratos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Script Stratos AI from your terminal or CI.

## Install

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

## Authenticate

```bash theme={null}
stratos auth login strat_live_your_key_here
```

The key is stored in your OS's standard config directory (via `conf` — `~/Library/Preferences` on macOS, XDG on Linux). For CI, skip `login` entirely and set an env var instead:

```bash theme={null}
export STRATOS_API_KEY=strat_live_your_key_here
```

`STRATOS_API_KEY` always takes priority over a stored key, so CI never depends on interactive login having happened.

## Every command

```text theme={null}
stratos auth login|logout|whoami
stratos apps import --name <name> [--app-store-url <url>] [--website-url <url>] [--note <note>]
stratos apps list|get <id>
stratos content create --app <id> --type slideshow|illustrated|hook_video [--topic ...] [--archetype ...] [--hook ...]
stratos content list|get <id>|approve <id>|reject <id>
stratos jobs get <id>
stratos automations create --app <id> --format ... --tiktok-account <id> --times "09:00:mon,wed,fri"
stratos automations list|get <id>|pause <id>|resume <id>
stratos schedules create --content <id> --tiktok-account <id> --at <iso> [--mode draft|publish] [--yes]
stratos schedules list|rm <id>
stratos analytics summary [--window-days 30]
stratos analytics content <videoId>
stratos credits
stratos webhooks add <url> --events job.completed,content.approved|list|rm <id>
```

Every command accepts `--json` for raw output you can pipe into `jq`. Human-readable output is the default.

## Exit codes

`0` on success, `1` on any API or usage error (message goes to stderr). Safe to check `$?` in scripts without parsing output.

## The one command that asks for confirmation

```bash theme={null}
stratos schedules create --content <id> --tiktok-account <id> --at <iso> --mode publish
```

fails immediately with a message telling you to add `--yes`. This isn't a client-side nicety layered on top — `mode: "publish"` posts live with no draft/review step, and the CLI won't let that happen from a bare command a script could run by accident. Add `--yes` once you mean it.
