# The control socket

Driving a running Zene Studio session from another program over a local UNIX socket.

Source: https://zenestudio.org/docs/control/control-socket

Markdown version of the Zene Studio page at https://zenestudio.org/docs/control/control-socket. For a map of the whole site, see
https://zenestudio.org/llms.txt.

---
Zene Studio can be driven by **another application instead of by a person**. Launch it with a control
socket and any process on the machine can read and change the open session.

This is the defining feature of the current release, and the reason the interface can be incomplete
while the software is still useful.

## Starting with a socket

```bash
zene --control-socket /tmp/zene.sock
```

It is **opt-in and off by default**. An instance not started that way has **no socket at all**. There
is nothing to connect to, and no hidden listener waiting.

:::warning
The socket is a **local UNIX socket**. It is not a network service and it is not authenticated. Anyone
who can reach that socket path can drive the session. Keep the path in a private directory with
restrictive permissions, and do not put it somewhere world-readable on a shared machine.
:::

## What you can do with it

The registry this tree builds holds **340 commands in 53 groups**. Every one of them carries:

- a **JSON schema** describing its parameters and return value;
- a **declared reversibility class**, so a caller knows in advance whether it can be undone.

Commands span the whole application: track and clip manipulation, mixer routing, automation,
transport, project save and load, plugin control, rendering, meters, undo.

## Undo is the same undo

`control.undo` reaches **the same undo history as the GUI's Ctrl+Z**. A change made over the socket is
a normal edit in the session, with normal undo semantics. This matters: it means an automated edit and
a manual edit are not two different kinds of thing.

## Asking what is available

Do not hardcode a command list — it changes between builds. Ask the running application:

```bash
# List every command with its schema
echo '{"command":"control.commands_list"}' | nc -U /tmp/zene.sock
```

See [Command reference](/docs/control/command-reference) for the full pattern, and
[MCP bridge](/docs/control/mcp-bridge) if you would rather drive Zene from an AI agent.

## A command that refuses on purpose

`mixer.set_pan` is registered with a full schema and **refuses every call** instead of faking a write,
because a mixer channel in this tree carries no pan property.

That is a design decision worth internalising: the API would rather return an honest refusal than
pretend to succeed. If you script against Zene Studio, handle refusals as a normal outcome.

## Safety

Because the socket can render, export, overwrite projects and change routing, treat the socket path
as a capability. Anything that can reach it can do all of those things to the open session.