micromux

Getting started

On this page

This guide goes from an empty machine to a running stack that you watch in the TUI and steer from a second terminal. It takes a few minutes with Homebrew, a few more when Cargo compiles micromux.

Install#

Homebrew

On macOS or Linux:

brew install --cask romnn/tap/micromux

Check that it runs:

$ micromux --version
micromux-cli 0.5.3 (protocol 4.0)

Platforms#

  • Linux and macOS: everything works.
  • Windows: the TUI runs, but the control plane does not yet, so attach, ctl, mcp and serve are not available, and stopping a service kills it at once instead of asking it to stop first.

1. Describe your services#

micromux reads the first of these files that it finds in the directory you start it in:

  • micromux.yaml
  • .micromux.yaml
  • micromux.yml
  • .micromux.yml

Write one for your stack. This one runs a database, a migration job once the database is healthy, and an API once the migration completed:

micromux.yaml
version: "1"

# Restart a service that exits, unless you stopped it yourself.
restart: unless-stopped

services:
  postgres:
    command: postgres -D ./pgdata
    healthcheck:
      test: pg_isready -q

  # A job runs to completion. A service that depends on it waits
  # until it exits with status 0.
  migrate:
    kind: job
    command: ./scripts/migrate.sh
    depends_on:
      - name: postgres
        condition: healthy

  api:
    command: ./run-api
    env_file: .env
    depends_on:
      - migrate
    healthcheck:
      test: ["CMD-SHELL", "curl -fsS http://localhost:8080/health"]

Each service needs a command; everything else is optional. To keep a service from starting with the others, mark it disabled: true and enable it when you need it, with d in the TUI or micromux ctl enable <service>.

Configuration describes every key, and the reference has the comment that gives editors completion and validation.

2. Run it#

In the directory of the config:

micromux

micromux starts every service once its dependencies are ready and opens the TUI. Here postgres starts first, migrate once postgres reports healthy, and api once migrate completed.

To use a config from another directory, name it:

micromux --config ../shop/micromux.yaml

3. Read the TUI#

The sidebar lists the services, each with its state. The pane beside it shows the selected service’s output as it arrives. The screenshots here show the larger demo stack in examples/demo⁠:

The micromux TUI: a sidebar of services, each with its state, such as HEALTHY, COMPLETED, UNHEALTHY, BLOCKED and IDLE, beside the API server's live logs The micromux TUI: a sidebar of services, each with its state, such as HEALTHY, COMPLETED, UNHEALTHY, BLOCKED and IDLE, beside the API server's live logs
Each row shows a service’s state: healthy, running, a completed job, unhealthy, blocked behind a dependency, or a manual job that has not run.

The keys you need first:

  • j and k: select a service, as the arrow keys do.
  • r: restart the selected service, or run a job again.
  • d: disable the selected service, which stops it, or enable it again.
  • H: show why a healthcheck fails: the probe’s command, exit code and output.
  • ?: list every key.
The healthcheck pane beside the logs of the unhealthy payments service, showing the failed probe's command, exit code 1 and its output, connect: connection refused The healthcheck pane beside the logs of the unhealthy payments service, showing the failed probe's command, exit code 1 and its output, connect: connection refused
H on an unhealthy service shows its last probe.

The terminal UI describes every pane and key.

4. Steer it from the shell#

A running session answers micromux ctl from any terminal in the same directory, so a script or a second terminal can check on it. Restart a service, or read its latest output:

$ micromux ctl restart api
$ micromux ctl logs api --tail 50

Ask why a healthcheck fails, here for the demo’s payments service:

$ micromux ctl health payments
attempt 1 `sh -c "echo 'connect: connection refused'; exit 1"` -> success=false exit_code=1
  connect: connection refused

A restart from the shell works as r in the TUI does. api waits for its dependencies again, and picks up your edits to its definition in micromux.yaml. The control plane lists every command, and Agent control lets Claude Code or Codex do the same.

5. Stop it#

Press q in the TUI. micromux stops every service and exits. Ctrl-C does not quit, so a stray one cannot end the session.

Next steps#

  • Configuration: dependencies, healthchecks, restart policies, logs, and ports and hostnames for several checkouts side by side.
  • The terminal UI: every pane and key, the mouse, and attaching to a session that runs without a TUI.
  • Agent control: let a coding agent read logs, restart services and wait for them.
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