reference

Command line reference

Three commands are installed: mux talks to a running daemon, muxd is the daemon, and swe-mux is the Windows desktop window and tray.

#

muxd, the daemon

FlagWhat it does
--hostOverride the configured listener host. Must be a loopback address.
--portOverride the configured port for this run.
--configUse a specific configuration file.
--devDevelopment mode.
--local-onlyDo not open the direct Tailscale listener for this run. Useful when you are isolating a network problem, because it removes tailnet detection from the startup path.
--wherePrint where swe-mux is installed, whether its commands are on PATH, and how to run it when they are not. Then exit.
--shutdownReap every session the PTY supervisor owns, stop the supervisor, and exit. This ends live sessions. It is the deliberate stop-everything command, never part of an update.

--host takes a loopback address only, because the Tailscale listener is detected rather than configured. Binding a LAN interface is an unsupported configuration rather than a flag that is missing.

#

mux, the client

CommandWhat it does
mux lsList sessions. Filter with --project, --state, --backend.
mux spawnSpawn a session. --project is required; --backend, --name, --profile, --exe, and repeatable --arg shape it.
mux sendSend input to a session, named by id, name, or a unique id prefix.
mux killTerminate a session.
mux resumeResume a history entry. --project is required.
mux projectsList Projects.
mux profilesList launch profiles.
mux harnessesList every harness in the registry with its detection state. The first thing to run when a CLI you have installed is not being recognised.
mux historyList conversation history.
mux history-duplicatesReport, or with repair merge, history entries that share one conversation.
mux accountslist, verify, or audit saved provider accounts.
mux doctorThe consolidated read-only diagnostics report. --export prints the full bundle as JSON.
mux updateReport the release check and this install's update path. --install VERSION downloads that release and verifies its hash against the published manifest before anything is staged.
mux reload-daemonRestart the daemon in place. Sessions survive when the PTY supervisor is on; --force restarts without it and kills every session.
mux install-shortcutCreate the Start Menu and Desktop shortcuts a wheel install structurally cannot (Windows). --startup adds a run-at-login entry, --remove takes them all away. Idempotent.

Every subcommand takes --json to print the raw daemon response instead of a table, and --url to point at a specific daemon.

#

Which daemon mux talks to

Resolved in this order, and the order is the contract: --url, then the MUX_URL environment variable, then the configured host and port, then http://127.0.0.1:8765.

#

Exit codes

CodeMeaning
0Success. For doctor, a full report with no failing check.
1A doctor report with a failing check, local or full.
2Usage error.
3Daemon unreachable. For doctor, also a clean local report.
4Daemon HTTP error.
5Ambiguous session name.
6Not found.

A degraded report never exits 0, so a script gating on mux doctor keeps working whether or not a daemon is running. The doctor codes compose the two that already existed rather than adding a scheme of their own.

#

mux doctor has two modes, and picks between them itself

  • Full reportWhen a daemon answers. Categories for the daemon, each harness, remote access, the firewall, host prerequisites, fleet status health, the background loops, conversation freshness, WSL, and optional assets. Nothing in it reads a secret, a terminal byte, or message content.
  • Local reportWhen nothing answers, because a daemon that will not start is the most likely new-user failure and the full report presupposes exactly the thing that is missing. It checks the interpreter, the imports, the config, the frontend bundle, the data directory, the database, the port, this host's pseudoterminal backend, and the supervisor bundle.

The local report marks what it did not check as unchecked rather than folding it into a pass. Folding a skipped check into ok claims health nobody measured, which is worse than the connection error it replaced.