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

# CLI

> Drive common tasks from the terminal against the hosted API.

`onlyfanskit-cli` ships the `onlyfans` command for connecting accounts,
sending DMs, health checks, and scripting against the **hosted platform**.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
npm install -g onlyfanskit-cli
export ONLYFANSKIT_API_KEY="sk_..."
onlyfans --help
```

## Credentials

Use your platform API key — not browser cookies:

| Variable              | Description                                                         |
| --------------------- | ------------------------------------------------------------------- |
| `ONLYFANSKIT_API_KEY` | Bearer key from the [dashboard](https://onlyfanskit.dev/dashboard). |
| `ONLYFANSKIT_API_URL` | Optional — defaults to `https://api.onlyfanskit.dev`.               |

Connect flows (`onlyfans connect …`) call the hosted
[connect API](/connect/overview) (email login, mobile, etc.) and register
account ids locally for `--account`.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
onlyfans connect login --email creator@example.com
onlyfans whoami --account acct_...
```

See [Commands](/cli/commands) for the full list.

## Conventions

* Output goes to **stdout**; diagnostics to **stderr**.
* Pass `--json` for machine-parseable output.
* Exit codes: `0` success, `1` usage error, `2` API failure.
