# WP-CLI commands

<!-- Generated by `pnpm docs:reference`. Do not edit this file; change the code it is read from. -->

SleekAI registers these WP-CLI commands. Each is documented by the WP-CLI docblock where it is declared; `wp help <command>` prints the same text on a site.

## `wp sleek ai`

Runs one-off AI generations for SleekAI.

## `wp sleek ai agent caps`

Manages the per-role agent capabilities.

## `wp sleek ai agent caps list`

Lists every role with its agent capabilities.

```bash
wp sleek ai agent caps list [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `[--format=<format>]` | Output format. Supports table and json. The json output carries the full per-role payload. |

**Examples**

```bash
wp sleek ai agent caps list --format=json
```

## `wp sleek ai agent caps set`

Sets one agent capability for a role.

The remaining capabilities keep their current (or default) values.
The Agent itself reads only useAgent; createModes, shareModes and
manageAllModes govern the stored-mode REST operations, and
usePluginMode is kept from earlier versions and has no effect.

```bash
wp sleek ai agent caps set <role> --cap=<capability>
```

| Argument | Description |
| --- | --- |
| `<role>` | A WordPress role key like editor. |
| `--cap=<capability>` | A name=value pair like useAgent=1. Supported names: useAgent, createModes, shareModes, manageAllModes, usePluginMode. Values 0 and 1. |

**Examples**

```bash
wp sleek ai agent caps set editor --cap=useAgent=1
```

## `wp sleek ai alt-text`

Generates image alt text with the configured AI model.

## `wp sleek ai alt-text generate`

Generates alt text for attachments, like the app's bulk generate.

Writes to the fields configured under altText.fields (alt, caption,
description) using the model configured under altText.model.model.

```bash
wp sleek ai alt-text generate [<attachment-id>...] [--all-missing] [--limit=<number>] [--dry-run]
```

| Argument | Description |
| --- | --- |
| `[<attachment-id>...]` | One or more image attachment ids. |
| `[--all-missing]` | Target every image attachment without alt text instead of naming ids. |
| `[--limit=<number>]` | At most this many images per run, at most 500. Run again for the rest. Default `50`. |
| `[--dry-run]` | List the attachments that would be processed without calling the AI provider. |

**Examples**

```bash
wp sleek ai alt-text generate 42 43
wp sleek ai alt-text generate --all-missing --dry-run
wp sleek ai alt-text generate --all-missing --limit=200
```

## `wp sleek ai chatbot`

Manages the chatbots, their logs and their RAG file sync.

## `wp sleek ai chatbot create`

Creates a chatbot from a JSON definition.

The JSON uses the same shape the app sends: name plus optional data,
conditions, security, model, provider, widget and logs keys.

```bash
wp sleek ai chatbot create --from-json=<file> [--porcelain]
```

| Argument | Description |
| --- | --- |
| `--from-json=<file>` | Path to a JSON file, or - to read from STDIN. |
| `[--porcelain]` | Output just the new chatbot id. |

**Examples**

```bash
wp sleek ai chatbot create --from-json=chatbot.json
echo '{"name":"Support"}' | wp sleek ai chatbot create --from-json=-
```

## `wp sleek ai chatbot delete`

Deletes a chatbot and its synced provider files.

```bash
wp sleek ai chatbot delete <id> [--yes]
```

| Argument | Description |
| --- | --- |
| `<id>` | The chatbot id. |
| `[--yes]` | Skip the confirmation prompt. |

**Examples**

```bash
wp sleek ai chatbot delete 42 --yes
```

## `wp sleek ai chatbot get`

Shows one chatbot.

```bash
wp sleek ai chatbot get <id> [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `<id>` | The chatbot id. |
| `[--format=<format>]` | Output format. Supports table and json. The json output carries the full chatbot payload. |

**Examples**

```bash
wp sleek ai chatbot get 42 --format=json
```

## `wp sleek ai chatbot list`

Lists every chatbot.

```bash
wp sleek ai chatbot list [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `[--format=<format>]` | Output format. Supports table and json. The json output carries the full chatbot payloads. |

**Examples**

```bash
wp sleek ai chatbot list --format=json
```

## `wp sleek ai chatbot logs`

Lists the conversation logs of a chatbot, newest first.

```bash
wp sleek ai chatbot logs <id> [--page=<page>] [--per-page=<per-page>] [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `<id>` | The chatbot id. |
| `[--page=<page>]` | Page to show. Default 1. |
| `[--per-page=<per-page>]` | Logs per page, 1 to 100. Default 50. |
| `[--format=<format>]` | Output format. Supports table and json. |

**Examples**

```bash
wp sleek ai chatbot logs 42 --per-page=10 --format=json
```

## `wp sleek ai chatbot logs-delete`

Deletes chatbot logs.

```bash
wp sleek ai chatbot logs-delete <id> [--all] [--yes]
```

| Argument | Description |
| --- | --- |
| `<id>` | A log id, or a chatbot id when --all is set. |
| `[--all]` | Treat the id as a chatbot id and delete every one of its logs. |
| `[--yes]` | Skip the confirmation prompt. |

**Examples**

```bash
wp sleek ai chatbot logs-delete 42 --all --yes
```

## `wp sleek ai chatbot sync`

Re-uploads the synced query variables to the RAG file store now.

```bash
wp sleek ai chatbot sync <id> [--variable=<index>]
```

| Argument | Description |
| --- | --- |
| `<id>` | The chatbot id. |
| `[--variable=<index>]` | Only sync this variable index instead of every sync-enabled query variable. |

**Examples**

```bash
wp sleek ai chatbot sync 42
```

## `wp sleek ai chatbot sync-status`

Shows the RAG file sync state of a chatbot's query variables.

```bash
wp sleek ai chatbot sync-status <id> [--variable=<index>] [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `<id>` | The chatbot id. |
| `[--variable=<index>]` | Only show this variable index. |
| `[--format=<format>]` | Output format. Supports table and json. |

**Examples**

```bash
wp sleek ai chatbot sync-status 42 --format=json
```

## `wp sleek ai chatbot update`

Updates a chatbot from a JSON definition.

The JSON replaces the stored definition, like saving from the app.

```bash
wp sleek ai chatbot update <id> --from-json=<file>
```

| Argument | Description |
| --- | --- |
| `<id>` | The chatbot id. |
| `--from-json=<file>` | Path to a JSON file, or - to read from STDIN. |

**Examples**

```bash
wp sleek ai chatbot update 42 --from-json=chatbot.json
```

## `wp sleek ai cleanup`

Runs the maintenance jobs on demand.

## `wp sleek ai cleanup completions`

Removes stale completion files, like the hourly cron.

Deletes the polling files under uploads/sleek-ai/completions that are
older than ten minutes.

```bash
wp sleek ai cleanup completions
```

**Examples**

```bash
wp sleek ai cleanup completions
```

## `wp sleek ai cleanup retention`

Prunes chat logs and messages past the configured retention window.

Deletes every chat, Agent conversation and chatbot log last updated
more than retention.days days ago, with its messages, as the daily
sleekAi/retention/prune action does, and removes stale completion
files. While retention.days is 0 it only removes the files.

```bash
wp sleek ai cleanup retention
```

**Examples**

```bash
wp sleek ai cleanup retention
```

## `wp sleek ai generate`

Generates a text completion, useful as a provider smoke test.

```bash
wp sleek ai generate <prompt> [--model=<model>] [--system=<system>]
```

| Argument | Description |
| --- | --- |
| `<prompt>` | The user prompt. |
| `[--model=<model>]` | A model string like openai-gpt-4.1-nano or anthropic-claude-3-5-haiku-latest. Defaults to the configured alt text model. |
| `[--system=<system>]` | An optional system instruction. |

**Examples**

```bash
wp sleek ai generate "Say hello" --model=openai-gpt-4.1-nano
```

## `wp sleek ai key`

Manages the stored provider API keys.

## `wp sleek ai key delete`

Deletes a stored key.

```bash
wp sleek ai key delete <id> [--yes]
```

| Argument | Description |
| --- | --- |
| `<id>` | The key id (see `wp sleek ai key list`). |
| `[--yes]` | Skip the confirmation prompt. |

**Examples**

```bash
wp sleek ai key delete 6f9619ff-8b86-4d01-b42d-00cf4fc964ff --yes
```

## `wp sleek ai key list`

Lists the stored keys without exposing their values.

Lists every user's keys, newest first, with their id, provider and
label.

```bash
wp sleek ai key list [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `[--format=<format>]` | Output format. Supports table, json and csv. |

**Examples**

```bash
wp sleek ai key list --format=json
```

## `wp sleek ai key set`

Stores a provider API key, encrypted at rest.

The key belongs to the user the command runs as (--user). Completions
use a provider's key whoever stored it, but a custom model only finds a
key stored by the user who owns the model.

```bash
wp sleek ai key set <provider> <key> [--label=<label>] [--porcelain]
```

| Argument | Description |
| --- | --- |
| `<provider>` | One of openai, anthropic, google, openrouter, or a custom-* name referenced by a custom model endpoint. |
| `<key>` | The API key to store. |
| `[--label=<label>]` | A display label shown in the app and in `key list`. |
| `[--porcelain]` | Output just the new key id. |

**Examples**

```bash
wp sleek ai key set openai sk-abc123 --label=Production
```

## `wp sleek ai models`

Lists the AI models available through the stored keys.

## `wp sleek ai models list`

Lists the models of every provider with a stored key.

```bash
wp sleek ai models list [--custom] [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `[--custom]` | Include custom model endpoints. On by default; pass --no-custom to list provider models only. |
| `[--format=<format>]` | Output format. Supports table, json and csv. The json output keeps the provider > models tree. |

**Examples**

```bash
wp sleek ai models list --no-custom --format=json
```

## `wp sleek ai pt-sync`

Drives the file-based post type sync for chatbots, agents and modes.

## `wp sleek ai pt-sync flush`

Writes every synced post to its file now, rather than waiting for the next save.

```bash
wp sleek ai pt-sync flush
```

**Examples**

```bash
wp sleek ai pt-sync flush
```

## `wp sleek ai pt-sync import`

Imports the JSON files from the active theme's sleek/ai directory.

```bash
wp sleek ai pt-sync import
```

**Examples**

```bash
wp sleek ai pt-sync import
```

## `wp sleek ai settings`

Reads and writes the SleekAI settings.

## `wp sleek ai settings get`

Shows the settings, or one value by dot path.

```bash
wp sleek ai settings get [<path>]
```

| Argument | Description |
| --- | --- |
| `[<path>]` | A dot path like altText.autoGenerate. Omit for everything. |

**Examples**

```bash
wp sleek ai settings get altText.autoGenerate
```

## `wp sleek ai settings update`

Updates one settings value by dot path.

The value takes the type the setting already has; for a new setting,
true/false and numbers are cast and everything else is stored as a
string.

```bash
wp sleek ai settings update <path> <value>
```

| Argument | Description |
| --- | --- |
| `<path>` | A dot path like altText.autoGenerate. |
| `<value>` | The new value. |

**Examples**

```bash
wp sleek ai settings update altText.autoGenerate true
```
