# AIReviewCustomCommand

typedef

An extra review command definition.

The command needs a prompt source, provided in one of three ways:

* an inline `prompt` string - sent as the prompt,
* a `context` reference - the referenced context drives the command (for example through a prompt it contains),
* both - the inline `prompt` is used and the `context` is attached as additional reference material (for example a file).

The `model` property is optional. If not specified, the default model is used.

```typescript
{
	id: 'improve-captions',
	label: 'Improve Captions',
	description: 'Improve image captions in the document.',
	prompt: 'Suggest improvements for the image captions in the document.'
}
```

The same command using a `context` reference instead of an inline `prompt`:

```typescript
{
	id: 'improve-captions',
	label: 'Improve Captions',
	description: 'Improve image captions in the document.',
	context: { id: 'style-guide', promptId: 'improve-captions' }
}
```

An inline `prompt` combined with a `context` that attaches a single file as reference material:

```typescript
{
	id: 'improve-captions',
	label: 'Improve Captions',
	description: 'Improve image captions in the document.',
	prompt: 'Suggest improvements for the image captions in the document.',
	context: { id: 'style-guide', fileId: 'caption-examples' }
}
```

<a id="properties">

## Properties

<a id="member-context">

### `context?: AIContextRef` _(readonly)_

A context reference attached to the command.

When no inline `prompt` is provided, the referenced context drives the command (a whole context or a `promptId` reference). When combined with an inline `prompt`, it is attached as additional reference material (for example a single file).

**Experimental:** This is a production-ready API but may change in minor releases without the standard deprecation policy. Check the changelog for migration guidance.

<a id="member-description">

### `description: string`

<a id="member-id">

### `id: string`

<a id="member-label">

### `label: string`

<a id="member-model">

### `model?: string`

<a id="member-prompt">

### `prompt?: string` _(readonly)_

The prompt to be sent to the AI model when the command is executed.

At least one prompt source is required: an inline `prompt`, a `context` that carries a prompt (a whole context or a `promptId` reference), or both. A `context` that references only a single file (`fileId`) cannot drive the command on its own and must be combined with an inline `prompt`.

#### Value

`object`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
