Advanced guide
Driving Zene Studio from another program
A first script against the control socket — start the session, discover commands, make one change safely.
This guide takes you from a socket that exists to a script you can undo. It assumes you are comfortable in a terminal.
1. Start a session with a socket
zene --control-socket /tmp/zene.sock
Opt-in and off by default — without this flag there is no socket at all.
2. Find out what you can call
Never guess. Ask:
echo '{"command":"control.commands_list"}' | nc -U ~/.zene/session.sock
You get every command with its schema and its reversibility class.
3. Understand the reversibility class before you call
| Class | Meaning |
|---|---|
not_mutating | Read-only. Safe to poll. |
snapshot | Capture state first if you need to restore it. |
true_inverse | Undoable by running the inverse. |
irreversible | Cannot be undone. Confirm with a human first. |
There are 13 irreversible commands out of 340. Know which ones they are before you automate anything.
4. Make one safe change
Start with a not_mutating command — a read. Once you trust the round trip, make a small write and
immediately undo it:
# Undo reaches the same history as Ctrl+Z in the GUI.
echo '{"command":"control.undo"}' | nc -U ~/.zene/session.sock
That property is the safety net. A scripted edit and a manual edit are the same kind of thing.
5. Handle honest refusals
mixer.set_pan refuses every call. A mixer channel in this tree has no pan property.
Treat refusals as a normal outcome:
- log them,
- branch on them,
- never retry in a loop.
6. Automate something real
At this point you can build the automation other DAWs make you do by hand. Batch fades, routing changes, and renders across a set of projects are all within reach.
Two rules:
- Snapshot before bulk operations. A hundred
true_inversecommands are individually safe and collectively hard to reason about. - Do it on a scratch project first.
Related
- The control socket
- Command reference
- The MCP bridge — the same thing, for AI agents.
- How we verify
That is the guide
If a step did not work, that is worth reporting — a guide that no longer matches the software is one of the most useful bugs anybody can file.