The engine without the window (deffierd)

Preview. deffierd is Deffier's engine running on its own, with no window: your terminals, agents, rooms and Autopilot. The desktop app attaches to it and detaches again, and what runs in the engine keeps running when you close the window. It is the first step towards running Deffier on a server and driving it from a phone.

What it does

  • Runs your terminals and the agents in them. Close the Deffier window and they keep working; open it again and you are back in the same shells, with their earlier output on screen.
  • Runs Autopilot jobs from your registered projects (the same ~/.swarmherd the app uses), on their schedules and on new commits, and keeps runs that wait for your approval across restarts.
  • Answers deffier autopilot run / approve / cancel, deffier room send and deffier send from a terminal.

Start and stop it

Windows. The terminal library is built for Electron, so run deffierd with Electron's own Node. From the Deffier folder:

set ELECTRON_RUN_AS_NODE=1
desktop-ui\node_modules\electron\dist\electron.exe desktop-ui\engine\deffierd.cjs

Linux. Needs Node 22 and tmux (terminals live in tmux):

node desktop-ui/engine/deffierd.cjs

It prints ready and keeps running. Stop it with Ctrl+C (or SIGTERM on Linux). Running Autopilot agents are stopped (their runs end Cancelled) and runs waiting for approval are kept. Terminals:

  • Linux: they keep running in tmux while deffierd is stopped, with whatever runs in them (an agent, a build). The next deffierd picks them up as it starts ("picked up 2 running terminal(s)") and redraws each screen from tmux, colours included. Restarting or upgrading the engine doesn't interrupt your agents.
  • Windows: they close with deffierd.

Options: --poll-ms 1000 (how often it checks for terminal requests) and --trigger-ms 15000 (how often it checks schedules and new commits; 0 turns schedules off). DEFFIER_HOME points it at another state folder. DEFFIER_TERMINAL_HOST=pty|tmux picks the terminal library.

With the desktop app

Only one engine runs for a computer at a time:

  • deffierd running, then you open Deffier: the window attaches to it. Everything works as usual; terminals and agents live in deffierd, so closing the window leaves them running.
  • deffierd stops while the window is open: Deffier restarts and runs the engine itself again. Terminals that lived in deffierd are gone (they stopped with it).
  • Deffier open, then you start deffierd: it refuses with "Deffier's engine is already running". Close Deffier first.

More than one viewer

Several windows can watch the same terminal (later: a phone and your desktop). Each sees the terminal's output from the moment it attaches. One of them is in control: only that one types and sets the terminal's size, so a phone that is only watching can't shrink your desktop terminal or type by accident. The first to type gets control; a phone takes it explicitly; typing in the desktop window takes it back. A viewer on a slow connection skips the output it missed and gets the current screen instead.

The window and the engine talk over a local pipe (a named pipe on Windows, ~/.swarmherd/engine.sock on Linux) that only your user can open. A client proves itself with the key in ~/.swarmherd/engine.token.

Approving

Runs waiting for approval need their 6-digit code (see Autopilot). Allow and Deny in the app pass it for you. With no window open, deffierd prints it in its own console, with the command to type:

seed-20261123-041249-00d7 waits for approval of Bash(npm run seed). Approve: deffier autopilot approve seed-20261123-041249-00d7 --code 482913

The code is never written to a file, so an agent can't approve its own request, through the CLI or the pipe. After a restart the run still waits, with a new code printed at start.

Limits (preview)

  • On Windows, stopping deffierd closes its terminals (they survive restarts on Linux only, in tmux).
  • Deleting a session closes its shell, on Linux too.
  • Swarm tasks waiting for approval don't survive a restart; start them again.
  • On Windows, stopping deffierd can print a harmless AttachConsole failed message from the terminal library.

This guide is doc/ENGINE.md in the Deffier repo. Still stuck? Help.

Enter opens, arrows move, Esc closes. Or browse Help.