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

# Fanvue CLI

> Run your Fanvue account from the terminal: answer chats, publish posts, manage the vault and read earnings with one command each, as a creator or agency.

The **Fanvue CLI** (`fanvue`) puts your Fanvue account in your terminal. Every public API operation is a command, so you can read your unread chats, reply to a fan, publish a post, sort the vault or pull this month's earnings without opening a browser or writing an app. Pipe the output into `jq`, put it in a cron job, or hand it to a coding agent.

You need a Fanvue creator or agency account and Node.js 18 or later. There's no app to register and no API credentials to manage. You sign in with Fanvue in your browser, and you're running commands a minute later.

> [!WARNING]
>
> Every command runs against your live account. There's no sandbox or test mode, so a write changes real data the moment it sends. Add `--dry-run` to see the request first.

## Get started

**1. Install the CLI**

Install the `@fanvue/cli` package globally, then check the version.

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

```text theme={null}
1.0.2
```

The package installs one compiled binary for macOS, Linux or Windows. Nothing else runs alongside it.

**2. Sign in**

Sign in with write access so you can send messages and publish posts. Fanvue opens in your browser, and you approve the **Fanvue CLI**.

```bash theme={null}
fanvue login --write
```

```text theme={null}
Opening your browser to sign in to Fanvue. Approve only if you ran `fanvue login` yourself.
Logged in as @yourhandle with write access.
```

[Sign in](https://api.fanvue.com/docs/cli/login.md) covers read-only access, signing in over SSH and signing out.

**3. Run your first commands**

Check what's waiting, read a chat, then answer it.

```bash theme={null}
fanvue messages unread
fanvue messages read 7b1c2d3e-0000-4000-8000-000000000001 --limit 3
fanvue messages send 7b1c2d3e-0000-4000-8000-000000000001 --text "Thanks for subscribing" --yes
```

## What you can run

Commands follow the sections of your Fanvue account. Run a section name on its own to list its commands, and add `--help` to any command for its flags.

> [card] Messages
>
> `fanvue messages`: read and send chats, mass messages, templates and automated replies.

> [card] Fans
>
> `fanvue fans`: subscribers, followers, fan insights, custom lists and blocks.

> [card] Vault and posts
>
> `fanvue vault` and `fanvue posts`: organise folders and collections, then publish, pin and repost.

> [card] Insights
>
> `fanvue insights`: earnings, top spenders, subscribers, retention and unsubscribe reasons.

> [card] Links and promotions
>
> `fanvue links` and `fanvue promotions`: tracking links, free trial links, media links and promotions.

> [card] Agencies
>
> `fanvue agency`: your roster and agency insights, plus `--creator` on any command a creator can run.

The [command reference](https://api.fanvue.com/docs/cli/commands.md) lists every command, the API operation it sends and what it needs before it sends.

## Everyday commands

```bash theme={null}
fanvue --help                                    # every section and command
fanvue account me                                # who you're signed in as
fanvue messages unread                           # unread chats and messages
fanvue messages list --size 5                    # your five most recent chats
fanvue messages send <userUuid> --text "Hi" --yes   # answer a fan
fanvue posts list                                # your posts
fanvue vault folders list                        # vault folders
fanvue fans subscribers list --all --format jsonl   # every subscriber, one per line
fanvue insights earnings summary                 # earnings at a glance
fanvue insights top-spenders                     # who spends the most
fanvue links tracking list                       # your tracking links
fanvue agency creators                           # creators your agency manages
```

Most sections follow the same shape, `fanvue <section> list|get|create|update`, and any command takes `--help` for its flags.

## Run a command

Flags are the operation's query parameters and body fields under their API names, so `--mediaUuids` sets `mediaUuids`. Repeat a flag to send a list, and pass an object field as JSON. To send a whole body, use `--data` with JSON or a file. Individual flags override the fields in `--data`.

```bash theme={null}
fanvue posts create --text "New set is live" --audience subscribers --mediaUuids 2f6a8b1c-0000-4000-8000-000000000003 --mediaUuids 9c41d2e5-0000-4000-8000-000000000004 --yes
fanvue posts create --data @post.json --audience followers --yes
```

`fanvue api` sends a raw request to any route the CLI has a command for, and refuses any other route.

```bash theme={null}
fanvue api GET "/v1/chats?size=5"
```

## Choose the CLI or the MCP server

Both run on the same Fanvue account, with the same sign-in and the same scopes.

| You want to | Use |
| - | - |
| Type one exact command and get the same result every time | Fanvue CLI |
| Script a routine, run it on a schedule or pipe output into other tools | Fanvue CLI |
| Give a coding agent a tool it calls through the shell | Fanvue CLI |
| Ask for things in plain language in a chat client | [MCP server](https://api.fanvue.com/docs/mcp-server.md) |

## Confirm changes before they send

Reads send straight away. A command that changes data needs `--yes`. A command that changes something fans see or pay for needs `--confirm <your handle>`, for example your subscription price, a promotion or a mass message. `--yes` alone is refused for these, so a script can't make the change by accident. Without the flag, the command sends nothing and exits with code `7`, naming the flag it needs.

The CLI never stops to ask a question by default, so a script or an agent can't hang on a prompt. To be asked at the terminal instead, add `--interactive`. The CLI then asks before a change, and asks you to type your handle for a change fans see.

Add `--dry-run` to any command to print the request it would send without sending it.

```bash theme={null}
fanvue account subscription-price set --subscriptionPrice 999 --dry-run
```

```text theme={null}
PATCH https://api.fanvue.com/v1/users/me/subscription-price
{
  "subscriptionPrice": 999
}
```

## Money stays in Fanvue

The CLI can read your checkout links, payments, refund requests and subscriptions, but it can't move money. Creating, changing or deleting a checkout link, requesting or withdrawing a refund, and cancelling or reactivating a checkout-link subscription are refused with `403` and the code `operation_excluded`, whatever the session's access. Make those changes in Fanvue.

The [command reference](https://api.fanvue.com/docs/cli/commands.md#links) marks these commands **Not available**.

## Keep your account safe

The CLI never holds your Fanvue password or your Fanvue access token. It signs in to a Fanvue service that keeps your Fanvue token on Fanvue's servers and forwards each command, so the CLI only stores its own session, in your system's credential store.

Access tokens never appear in the output, and `--debug` hides them too. Signed media links are hidden unless you add `--show-url`, because anyone holding one can open the media until it expires. To cut off the CLI on every computer, remove the **Fanvue CLI** from the apps connected to your Fanvue account.

## Act for a creator as an agency

Agency team members add `--creator <creatorUserUuid>` to act for a creator they manage. The CLI sends the operation's `/v1/creators/{creatorUserUuid}/...` route, which carries the same scopes and uses the creator's own rate-limit budget. The [command reference](https://api.fanvue.com/docs/cli/commands.md) marks which commands accept `--creator`.

```bash theme={null}
fanvue fans subscribers list --creator 7b1c2d3e-0000-4000-8000-000000000002
```

## Read the output

At a terminal, lists print as a table and single objects as `key value` lines. Choose a format with `--format`, or use `--json` as a short form of `--format json`.

| Format | Output |
| - | - |
| `table` | Readable columns. The default at a terminal. |
| `json` | The API response, indented. The default when the output is piped or redirected. |
| `jsonl` | One JSON object per line for each item in a list. |

`--all` follows `nextCursor` and returns every page as one list.

```bash theme={null}
fanvue fans subscribers list --all --format jsonl | wc -l
```

## Use the CLI in scripts and agents

Exit codes are stable, so a script or an agent can branch on them.

| Exit code | Meaning |
| - | - |
| `0` | The command succeeded. |
| `1` | Something unexpected failed, including an error the API returned. |
| `2` | The command, an argument or a flag was wrong. Nothing was sent. |
| `4` | The session is missing or has ended, or the session lacks the scope. |
| `7` | The command needs your confirmation, or the confirmation didn't match. Nothing was sent. |

Codes `3`, `5` and `6` are reserved.

When the output isn't a terminal, errors print to standard error as JSON. `code` is stable, so branch on it rather than on `message`. `pointer` is a JSON Pointer to the input that was wrong, and `hint` says how to fix it.

```json theme={null}
{"error":{"code":"invalid_type","message":"--subscriptionPrice must be a whole number.","pointer":"/body/subscriptionPrice","value":"ten","hint":"Pass a whole number, for example 10."}}
```

The CLI retries a `429` on a read after the `Retry-After` interval, and never retries a write, so a change is never sent twice. Each request counts against your [rate limit](https://api.fanvue.com/docs/authentication/rate-limits.md) like any other app's.

## Fix a missing command

`fanvue: command not found` after a global install means npm's global `bin` folder isn't on your `PATH`. Add it to your shell profile, then open a new terminal.

```bash theme={null}
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc
```

Use `~/.bashrc` instead of `~/.zshrc` if your shell is bash.

## Update or remove the CLI

Run the install again to update to the latest version, or uninstall the package to remove the CLI.

```bash theme={null}
npm install -g @fanvue/cli@latest
npm uninstall -g @fanvue/cli
```

Uninstalling leaves your session in the credential store. Run `fanvue logout` first to remove it.

## Next steps

> [card] [Sign in](https://api.fanvue.com/docs/cli/login.md)
>
> Read or write access, signing in over SSH and signing out.

> [card] [Command reference](https://api.fanvue.com/docs/cli/commands.md)
>
> Every command, the operation it sends and what it needs before it sends.

> [card] [MCP server](https://api.fanvue.com/docs/mcp-server.md)
>
> The same account in a chat client, in plain language.

> [card] [Scopes](https://api.fanvue.com/docs/authentication/scopes.md)
>
> What read and write access cover.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.