# Command Center

> The Command Center lets people operate your app through explicit commands, and optionally through natural language that a model turns into a plan of those same commands.

Source: https://docs.sommatic.ai/en/command-center/ (updated 2026-11-26)

The Command Center is a panel that lives inside your React app. From it a person can read what is on the page, fill a
form, select rows, claim a task or run a workflow, either by typing a command or by asking in their own words. Every
action is a registered command with an id, a slash label and a JSON schema, so what happens on screen is always one of
a known set of operations, recorded and reversible when it can be.

Diagram: Type a slash label or ask in your words: either way the page changes through the same registered commands.

## Two ways to run a command

| Mode                   | How it starts                                                                                         | What decides the action                                                                         |
| ---------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| **Explicit**           | The person types a slash label (`/page-outline`, `/open-surface`) or a feature calls a command by id. | Nobody: the command runs with the arguments given.                                              |
| **Inference-assisted** | The person writes a request ("fill the name with Acme and save").                                     | A model reads the request, the commands available and the page, and returns a plan of commands. |

Both modes run the same commands. Inference only chooses which ones and with which arguments.

> **Note: Operable without inference**
>
> Every command can be invoked directly by id, including through `command_center.exec.command.invoke`. If no LLM
> provider is configured, only the inference path stops working; the commands keep working.

## Read and exec commands

There are 37 commands: 18 **read** commands and 19 **exec** commands. Their ids say which kind they are.

- **Read** commands observe without changing anything: the page outline, the surfaces and targets a page publishes, the
  current selection and focus, the task inbox and a task's detail, the capabilities available here and the debug logs.
  Example: `command_center.read.page.outline` (`/page-outline`).
- **Exec** commands act: open or close a surface, set fields, submit a form, apply a filter, select rows, navigate, open
  an app, claim, comment, complete, create or transition a task, run a workflow and undo.
  Example: `command_center.exec.ui.set_fields` (`/set-fields`).

The [command reference](https://docs.sommatic.ai/en/command-center/commands.md) lists every command with its arguments and its result.

## How a request becomes a plan

### The panel builds a request

It packs the request, the selected LLM provider, the definition of every available command and a snapshot of the
page (surfaces, targets, context sources, selection, focus and the pages and apps you can navigate to):
`{ type: 'command-center.request', organization_id, context, payload }`.

### Sommatic AI proposes a plan

The request goes to `POST /chat/conversation/execute/stream`, which streams the model's reasoning while it works, or to
`POST /chat/conversation/execute` when streaming is not available. The answer is `{ execution_plan, thought, output }`.

### The panel runs the plan step by step

Each step is a command id with its arguments. The panel waits 300 ms before each step so the previous change settles,
and a little longer after opening a surface or setting fields. Each step moves from `pending` to `running` and ends in
`success` or `error`, live in the panel.

A plan looks like this:

```json
{
  "execution_plan": [
    { "command_id": "command_center.read.page.outline", "args": { "detail_level": "high" } },
    { "command_id": "command_center.exec.ui.open_surface", "args": { "surface_id": "organization-edit-form" } }
  ],
  "thought": "The user wants to inspect the page and open the edit form."
}
```

When the model answers with plain text instead of a plan, the panel shows that text as a single `reply` step. It does
not send the request again.

## Receipts and undo

A successful exec command records a **receipt**: the command, its arguments, its result and whether it can be reversed.
The panel keeps the last 100. `/undo` takes a `receipt_id` and reverses the action when its receipt is marked
`reversible`.

## Next steps

- [Add it to your app](https://docs.sommatic.ai/en/command-center/integration.md): Providers, services and the per-page wiring that makes a page operable.
- [Command reference](https://docs.sommatic.ai/en/command-center/commands.md): Every read and exec command with its arguments.
- [Omnisearch](https://docs.sommatic.ai/en/command-center/omnisearch.md): Search records and launch commands from one box.
- [Conversations API](https://docs.sommatic.ai/en/api/reference/conversations.md): The endpoints that turn a request into a plan.
