micromux

Configuration reference

On this page

Every key in micromux.yaml. The machine-readable source of truth is micromux.schema.json⁠; reference it from your config for editor completion and validation:

# yaml-language-server: $schema=https://github.com/romnn/micromux/raw/main/micromux.schema.json

Top level#

KeyTypeDefaultDescription
versionstring / number—Config format version. Use "1".
namestringdirectory nameSession name surfaced to agents via the control plane.
strictboolfalseTreat config warnings as errors.
gitobject—metadata (bool, default true) controls Git branch and GitHub PR fetching for session listings. Overrides the user config; changes require a session restart.
servicesmap—Service definitions, keyed by id.
restartstring—Default restart policy.
healthcheckobject—Default healthcheck timing (no test).
logsobject—Default log retention.
uiobject—Terminal-UI options.
controlobject—Control plane and dynamic-service policy.
sessionobject—Session name (default: the config directory’s name, slugified) and domain (default localhost).
allocate_portsarray—Environment variable names that each receive a session-allocated port, or { name, prefer } to take a preferred port whenever it is free.
routesarray—Hostnames { host, path, strip_prefix, port } served by the shared proxy, optionally split by path prefix. Not supported on Windows.
proxyobject—The proxy port the session’s routes are served on (default 80), and an optional fallback_port for when that port cannot be bound. Sessions with different ports share one proxy.
env_filestring / object / array—Session-wide .env file(s), loaded beneath every service’s own env_file and environment and read from disk for every micromux env and micromux exec without --service. Same entries as env_file[].

services.<id>#

KeyTypeDescription
commandstring / arrayRequired. Shell-like string or argv array. Each argument is interpolated after splitting.
namestringDisplay name for the TUI.
kindstringservice (default) or job, which runs to completion.
runstringFor a job: on-start (default) or manual, which runs it only when restarted.
disabledboolLeave the service disabled when the session starts.
working_dirstringWorking directory, relative to the config; defaults to the config’s directory. Aliases: cwd, directory. May reference ${VAR} from micromux’s own environment only.
environmentmapInline environment variables. Values may reference ${VAR}.
env_filestring / object / array.env file(s) to load, earlier first. Long form is { path: …, optional: … }; see env_file[].
depends_onarrayDependencies; each a service id or { name, condition }.
healthcheckobjectA probe with test plus timing.
portsarrayPorts the service uses (metadata; not bound by micromux). Entries may reference ${VAR}.
restartstringRestart policy for this service.
stop_grace_perioddurationTime between graceful termination and force-kill. Defaults to 10s; must be greater than zero and no longer than 5m.
stop_signalstringSignal delivered for the graceful stop request. One of SIGTERM (default), SIGINT, SIGHUP, SIGQUIT, SIGUSR1, SIGUSR2; the SIG prefix is optional and matching is case-insensitive. Delivered to the service’s process group and — best-effort, via a process-table sweep that cannot guarantee hard containment — to descendants that escaped it, so a non-default choice reaches child processes too. Ignored on Windows.
cleanupobjectA cleanup command run after each of the service’s processes exits; see cleanup.
logsobjectLog retention for this service.
colorboolForce color handling for this service.
resourcestringA shared resource the service needs; only the session holding it runs the service. A lowercase hostname label, such as desktop-app. Needs a config loaded from a file and process containment, so it is refused on Windows.

cleanup#

KeyTypeDescription
commandstring / arrayRequired. Shell-like string or argv array, interpolated like command. Runs in the service’s environment and working directory.
timeoutdurationHow long the cleanup may run before it gets the service’s stop_signal, and SIGKILL 5 seconds later. Defaults to 60s; must be greater than zero and no longer than 1h.

env_file[]#

A bare path or an object:

KeyTypeDescription
pathstringRequired. Path of the dotenv file, relative to the config. May reference ${VAR} from micromux’s own environment.
optionalboolSkip the entry when its path names an unset variable or no file exists there. Defaults to false. A present file is always loaded in full.

depends_on[]#

A bare string (the started condition) or an object:

KeyTypeDescription
namestringRequired. The dependency’s service id.
conditionstringstarted, healthy, or completed.

healthcheck#

KeyTypeDescription
teststring / arrayThe probe command. Required on a service; absent in the top-level defaults block.
start_delaydurationGrace period before the first probe. Aliases: startup_delay, initial_delay.
intervaldurationTime between probes.
timeoutdurationPer-probe time limit.
retriesintegerConsecutive failures tolerated before unhealthy.

restart#

One of always, unless-stopped, on-failure (or on-failure:N), no (synonym never). Case-insensitive; - and _ are interchangeable.

logs#

KeyTypeDefaultDescription
retained_runsinteger5Full disk-backed runs kept, including the current run. Aliases: runs, history.
memory.max_linesinteger / unbounded—In-memory tail line bound.
memory.max_bytesinteger / unbounded—In-memory tail byte bound.
max_lines, max_bytes——Shorthand for the memory.* fields.
levelstringallInitial TUI level threshold for structured JSON logs: all, trace (same as all), debug, info, warn, error, or fatal. Lines without a structured level always show.
timestampsbooltrueLead structured JSON log lines with their local time in the TUI; toggle per service with T.
filter_fieldsbooltrueLeave out the fields that fields hides in the TUI; toggle per service with F.
fieldsmap of field name to hide / show{}How the TUI displays structured JSON fields. A service’s map merges into the inherited one key by key.

ui#

KeyTypeDefaultDescription
widthinteger—Initial sidebar width, in columns.
pretty_json_logsbooltrueRender structured JSON logs as compact colored lines in the TUI.
mousebool or mappingfrom the user config, else trueWhat the TUI’s mouse may do: true or false for everything, or a mapping of select, navigate and scroll, each left out taken from the user config, else on. See Mouse parts. Overrides the user config; --mouse / MICROMUX_MOUSE override both. See Mouse.
copy_on_selectboolfrom the user config, else falseCopy a mouse selection to the clipboard as soon as the drag ends, instead of on y or Enter. Overrides the user config; --copy-on-select / MICROMUX_COPY_ON_SELECT override both.

control#

KeyTypeDefaultDescription
enabledbooltrueEnable the local control endpoint. Changes require a session restart.
dynamic_services.enabledboolfalsePermit runtime-created services.
dynamic_services.allowed_working_rootsarray["."]Allowed working-dir roots, resolved relative to the config.
dynamic_services.max_servicesinteger4Maximum live dynamic services.
dynamic_services.max_lifetimeduration / none12hDefault and maximum dynamic-service lifetime.
Esc

Type # for headings only ↑↓ move ↵ open Ctrl ↵ new tab Ctrl U/D scroll preview

Keyboard shortcuts

/ ⌘ K Ctrl K
Search
← →
Previous or next page
?
Show these shortcuts