# CLI

The `faceless` CLI (npm package `faceless-cli`) wraps the whole API in commands that work for humans and for scripts and agents.

## Install

```bash
npm install -g faceless-cli
faceless --version
```

The command is `faceless` (alias `fcl`). Without installing, use `npx -y faceless-cli <command>`.

## Authenticate

Three options:

- `faceless login`: signs in with OAuth in your browser (PKCE on a `http://127.0.0.1:<port>/callback` loopback); no key to paste. The tokens are stored in `~/.faceless/config.json` (mode 0600) and refreshed automatically. `faceless login --manual` (or `--api-key fl_live_...`) saves an API key instead.
- `FACELESS_API_KEY` environment variable: nothing to store; ideal for CI and agents.
- `faceless signup`: an agent with no account and no browser opens its own workspace (see below).

Verify with `faceless whoami`. Global flags on every command: `--json` (raw API envelope output), `--api-key` (override the key for one call) and `--api-url` (point at another deployment, also via `FACELESS_API_URL`).

An agent with no account runs `faceless signup` (optional `--name`, `--email`): it opens a Faceless workspace, saves its key and prints a claim link for the human. Run by an agent (no terminal attached) with no credential at all, any command signs up first, except the ones that need no key (`faceless estimate`, `faceless voices`, `faceless options`). A `[SIGNUP_CHALLENGE]` line asks one question; answer with `faceless signup --answer "<word>"`. `faceless agent status` and `faceless agent claim-link` show the claim state and mint a fresh link. The claim link is shown prominently: a framed `ACTION FOR YOUR HUMAN: claim ...` block on stderr, and `signup` (`claimUrl`, `claimCode`, `expiresAt`) in the command's JSON answer. The new workspace has 0 credits, so nothing is spent until someone pays. `FACELESS_NO_AUTO_SIGNUP=1` turns self-signup off (`FACELESS_AUTO_SIGNUP=false` still works).

Paying from the CLI: `faceless checkout create --pack pack_10` prints a Stripe Checkout link for the person (a card, no wallet needed); `faceless checkout get <id>` polls it. `faceless buy-credits --pack pack_10 --token spt_...` pays with a Link wallet's Shared Payment Token.

## Commands

Every API operation is a command, plus `login`, `logout`, `signup` and `mcp` (the local stdio MCP server, see [MCP](/developers/docs/mcp)). The table is generated from the API registry. `faceless-cli` and the API share one version number (`GET /health` shows the API's; `faceless --version` the CLI's); an older CLI lacks the newer commands, so update it with `npm install -g faceless-cli@latest`.

<!-- generated:cli-commands:start -->

| Command | What it does | Endpoint |
| --- | --- | --- |
| `faceless whoami` | Identify the caller | GET /me |
| `faceless signup` | Open a workspace as an AI agent (no key needed) | POST /agent/signup |
| `faceless agent status` | Claim and expiry status of this workspace | GET /agent/account |
| `faceless agent claim-link` | Mint a fresh claim link for your human | POST /agent/claim-link |
| `faceless defaults` | Read the team's video defaults | GET /video-defaults |
| `faceless defaults set` | Set the team's video defaults | PATCH /video-defaults |
| `faceless credits` | Credit balance and history | GET /credits |
| `faceless buy-credits` | Buy a credit pack (MPP, a payment token, or a checkout link) | POST /credits |
| `faceless checkout create` | Create a checkout link a person pays | POST /checkout-sessions |
| `faceless checkout get` | Check whether a checkout link was paid | GET /checkout-sessions/{id} |
| `faceless estimate` | Price requests before making them | POST /estimates |
| `faceless videos create` | Create a faceless video from a script | POST /videos |
| `faceless videos captions` | Caption an existing video or audio file | POST /videos/captions |
| `faceless videos from-audio` | Create a faceless video from your own voiceover recording | POST /videos/audio |
| `faceless videos list` | List the team's videos | GET /videos |
| `faceless videos get` | Get one video | GET /videos/{id} |
| `faceless videos update` | Update a video's name or post metadata | PATCH /videos/{id} |
| `faceless videos get-captions` | Read what each platform posts for a video | GET /videos/{id}/captions |
| `faceless videos set-captions` | Set each platform's caption for a video, posted exactly as written | PATCH /videos/{id}/captions |
| `faceless videos select-thumbnail` | Choose which thumbnail a video uses | POST /videos/{id}/thumbnail |
| `faceless videos status` | Poll video generation progress | GET /videos/{id}/status |
| `faceless videos render` | Render a video to MP4 | POST /videos/{id}/render |
| `faceless videos place-images` | Place your own pictures in a video | POST /videos/{id}/images |
| `faceless videos shots` | List a video's shots | GET /videos/{id}/shots |
| `faceless videos redo-shot` | Redo one shot of a video | POST /videos/{id}/shots |
| `faceless videos clean-audio` | Clean the recorded voice of an Audio to Visuals video again | POST /videos/{id}/clean-audio |
| `faceless videos frames` | See frames of a video's render | GET /videos/{id}/frames |
| `faceless videos sound-report` | Hear what a video sounds like, item by item | GET /videos/{id}/sound-report |
| `faceless videos mute-voice` | Mute stretches of a video's voice | POST /videos/{id}/mute-voice |
| `faceless videos set-cover` | Set a video's cover (thumbnail) | POST /videos/{id}/cover |
| `faceless videos delete` | Delete a video | DELETE /videos/{id} |
| `faceless renders get` | Poll render progress | GET /renders/{id} |
| `faceless series create` | Create an automated video series | POST /series |
| `faceless series list` | List the team's series | GET /series |
| `faceless series get` | Get one series | GET /series/{id} |
| `faceless series update` | Update a series | PATCH /series/{id} |
| `faceless series delete` | Delete a series | DELETE /series/{id} |
| `faceless series generate` | Generate the next episode now | POST /series/{id}/generate |
| `faceless series episodes` | List a series' episodes | GET /series/{id}/episodes |
| `faceless posts publish` | Publish a rendered video to a platform now | POST /posts |
| `faceless posts schedule` | Schedule a video to one or more platforms | POST /posts/schedule |
| `faceless posts now` | Post a scheduled video now instead of at its scheduled time | POST /posts/post-now |
| `faceless posts cancel` | Cancel a scheduled post | DELETE /posts/{id} |
| `faceless calendar` | Posting calendar | GET /calendar |
| `faceless accounts` | List connected social accounts | GET /accounts |
| `faceless connect link` | Create a link a human opens to connect a social account | POST /accounts/connect-links |
| `faceless connect status` | Check whether a connect link has been used | GET /accounts/connect-links/{id} |
| `faceless voices` | List TTS voices | GET /voices |
| `faceless options` | List content option catalogs | GET /options |
| `faceless assets create` | Register a media asset by URL | POST /assets |
| `faceless assets upload-image` | Upload your own image | POST /assets/images |
| `faceless assets list` | List the team's media library | GET /assets |
| `faceless analytics` | Cross-platform posting analytics | GET /analytics |
| `faceless fast-track list` | List Fast Track video types, categories and scripts | GET /fast-track |
| `faceless fast-track buy` | Get a Fast Track video | POST /fast-track |
| `faceless edits create` | Edit your own video with the AI Video Editor | POST /edits |
| `faceless edits get` | Follow an AI Video Editor job | GET /edits/{id} |
| `faceless edits change` | Ask for a change to an edit | POST /edits/{id}/notes |
| `faceless ads search` | Search Meta ads shown in the EU and UK | GET /ads/search |
| `faceless ads saved` | List the team's saved ads | GET /saved-ads |
| `faceless ads save` | Save an ad from a search | POST /saved-ads |
| `faceless ads unsave` | Remove a saved ad | DELETE /saved-ads/{id} |
| `faceless ads brief` | Write an ad brief for your brand from a competitor's ad | POST /ads/briefs |
| `faceless webhooks list` | List webhook endpoints | GET /webhooks |
| `faceless webhooks create` | Create a webhook endpoint | POST /webhooks |
| `faceless webhooks get` | Get a webhook endpoint | GET /webhooks/{id} |
| `faceless webhooks update` | Update a webhook endpoint | PATCH /webhooks/{id} |
| `faceless webhooks delete` | Delete a webhook endpoint | DELETE /webhooks/{id} |
| `faceless webhooks deliveries` | Webhook delivery log | GET /webhooks/{id}/deliveries |
| `faceless webhooks test` | Send a test event to a webhook endpoint | POST /webhooks/{id}/test |
| `faceless webhooks redeliver` | Redeliver a webhook event | POST /webhooks/{id}/redeliver |

<!-- generated:cli-commands:end -->

## Scripting and agents: --json

Always pass `--json` when running from a script or agent, and parse the `success` field. The output is the raw API envelope, so the [API reference](/developers/reference) documents every field.

```bash
faceless videos create --script "Did you know..." --voice-id EXAVITQu4vr4xnSDxMaL \
  --model storyboard --wait --json
faceless posts publish --video-id <videoId> --platform youtube --json
```

The CLI sends an `Idempotency-Key` automatically on every mutating command, so a timed-out command is safe to re-run without double credit charges.

## --wait and --timeout

Asynchronous operations (`videos create`, `videos captions`, `videos render`, `series generate`) accept `--wait`: the CLI polls status at the recommended cadence and exits when the operation reaches a terminal state, printing the final resource. Cap the polling with `--timeout <seconds>`. Without `--wait`, poll yourself with `faceless videos status <id> --json` or `faceless renders get <id> --json`.

```bash
faceless videos create --script "..." --voice-id <voiceId> --wait --timeout 900 --json
faceless videos render <videoId> --wait --json
```

## Exit codes

- `0`: success
- `2`: authentication failed (`unauthorized`); re-run `faceless login` or fix `FACELESS_API_KEY`
- `3`: `insufficient_credits`; top up at https://faceless.so/billing
- `4`: `rate_limited`; wait and retry (respect Retry-After)
- `1`: any other error
