# commands.execute

Source: https://docs.lightair.app/developers/remote-api/commands.execute

> Runs Lightair's document commands as one undoable change.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: History and commands. Script plugins need the `project.write` permission.

The commands are the ones Lightair's journal records; [commands.list](/developers/remote-api/commands.list) lists them with an example each. The change shows in Undo under the caller's name and `label`.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `commands` | `object[]` | yes | The commands, in order. |
| `command` | `object` | no | One command, instead of `commands`. |
| `label` | `string` | no | The change's name in Undo. Default: the command's own, or "N changes". |

## Errors

Invalid params (-32602) without commands, for something that isn't a command, or when a command can't be done.

## Events

- `workspace.changed`

## From an AI agent

The MCP server's `run_commands` reaches this method.

## Related

- [commands.list](https://docs.lightair.app/developers/remote-api/commands.list.md)
- [history.undo](https://docs.lightair.app/developers/remote-api/history.undo.md)
