# editor.command

Source: https://docs.lightair.app/developers/remote-api/editor.command

> Runs one of the Editor's commands, as its menu item or key would.

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

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `command` | `string` | yes | A command's id, from editor.commands. |

## Errors

Not found (-32004) for an unknown command. A state error (-32005) when no Editor project is open, or the open one is read-only because a newer Lightair made it.

## Events

- `editor.changed`

## From an AI agent

The MCP server's `editor_command (action: run)` reaches this method.

## Related

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