Skip to content
docs/architecture
Get started

How it fits together

One controller holds the state and owns every terminal. Any number of machines register with it as workers and run the processes. Any number of agents run on those workers and report back through tools the controller serves them.

Puppet Master’s architectureFour clients — the CLI, the TUI, the web dashboard and the iOS app — reach one controller. The CLI and TUI use a unix socket guarded by filesystem permissions; the web dashboard and the iOS app use HTTP with a session cookie. The controller owns the terminals, keeps its state in SQLite, and serves MCP tools to the agents it spawns. It dispatches sessions to workers over a mutually authenticated link, where the agent and shell processes actually run. Notifications leave the controller sealed, pass through a relay that cannot read them, and reach Apple.clientscontrollerworkerspm — the CLIone command at a timepm tuithe fleet, full screenweb dashboardevery surface at onceiOS appanswer from anywhereunix socketfs permissionsHTTP · cookiepm daemonowns every PTYstate in SQLiteMCP tools for the agentsforwards and directory sharesreviews, plans, the boardA restart keeps the stateand reconciles the sessions.mutual authprotobufworkeragent PTYshell PTYsthe workspaceThe controller’s ownmachine is a worker too.sealed payloadpush relaycannot read itAPNs

pm daemon is the controller. It holds the database, owns every session’s terminal, serves the web UI and the MCP tools agents call, and is the only thing that decides what should be running.

It can run sessions itself. On a single machine that is all you need, and the controller is also a worker.

A worker is a machine that runs sessions. pm worker turns one into a worker, and enrollment pairs it with a controller. From then on it does what the controller asks: start a session, stop one, serve a forward.

A worker holds no state of its own worth keeping. If one is rebuilt, you enroll it again and the controller fills it back in. That is also why losing a worker loses nothing but the processes that were on it.

See adding a second machine for the setup, and securing your install for what enrolling one grants.

A session is one agent doing work in one directory. Every session has a terminal, and that terminal is owned by the controller rather than by whoever is looking at it — which is why you can attach from the web UI and the TUI at the same time, see the same thing, and lose nothing when you close either.

Terminals covers what that means for replay and multiple viewers.

Four ways in, all talking to the same controller:

Client Over Good for
Web UI HTTP the main interface — watching and steering many sessions
iOS app HTTP notifications and replying away from your desk
pm CLI unix socket starting the daemon, enrolling workers, scripting
TUI unix socket a terminal-native view of the same sessions

The CLI and TUI use the unix socket and so must run on the controller’s machine. The web UI and the app work from anywhere that can reach it.

Puppet Master observes agent CLIs rather than replacing them. It starts the real claude, codex, gemini, opencode, antigravity or grok binary in a terminal, configures it per session so it reports lifecycle events back, and serves it MCP tools. The agent behaves exactly as it would if you ran it yourself.

Supported agents covers what each one can and cannot do.