Commands
devmux ensure
Section titled “devmux ensure”Start a service if not already running. Idempotent - safe to call multiple times.
devmux ensure <service>Behavior
Section titled “Behavior”| Current State | Action |
|---|---|
| Service not running | Start new tmux session |
| tmux session exists, process dead | Restart the service |
| Service running and healthy | Reuse (no-op) |
Options
Section titled “Options”| Option | Description |
|---|---|
--wait | Wait for health check before returning (default: true) |
--timeout <ms> | Health check timeout (default: 30000) |
Examples
Section titled “Examples”# Start API servicedevmux ensure api
# Start with longer timeoutdevmux ensure api --timeout 60000
# Start without waiting for health checkdevmux ensure api --no-waitdevmux status
Section titled “devmux status”Show status of all configured services.
devmux status [options]Output
Section titled “Output”Service Status Port Sessionapi running 8787 omo-myapp-apiweb running 3000 omo-myapp-webworker stopped - -Options
Section titled “Options”| Option | Description |
|---|---|
--json | Output as JSON |
--service <name> | Show status for specific service only |
Examples
Section titled “Examples”# Show all servicesdevmux status
# JSON output (for scripting)devmux status --json
# Specific servicedevmux status --service apidevmux stop
Section titled “devmux stop”Stop one or all services.
devmux stop <service|all>Behavior
Section titled “Behavior”- Sends SIGTERM to the process
- Kills the tmux session
- Waits for clean shutdown
Examples
Section titled “Examples”# Stop API servicedevmux stop api
# Stop all servicesdevmux stop alldevmux attach
Section titled “devmux attach”Attach to a service’s tmux session to view logs.
devmux attach <service>After attaching:
- View live logs
- Interact with the process
- Press
Ctrl+BthenDto detach (service keeps running) - Press
Ctrl+Cto stop the service and exit
devmux run
Section titled “devmux run”Run a command with specified services, cleaning up on exit.
devmux run --with <service> [--with <service>...] -- <command>Behavior
Section titled “Behavior”- Ensures all specified services are running
- Runs your command
- When command exits, stops services that THIS run started
- Services that were already running are left alone
Options
Section titled “Options”| Option | Description |
|---|---|
--with <service> | Service to ensure (can be repeated) |
--cleanup | Stop all services on exit, even pre-existing (default: false) |
Examples
Section titled “Examples”# Run tests with APIdevmux run --with api -- npm test
# Run with multiple servicesdevmux run --with api --with web -- npm run e2e
# Force cleanup of all services on exitdevmux run --with api --cleanup -- npm testdevmux discover
Section titled “devmux discover”Auto-generate configuration from your project.
devmux discover <source>Sources
Section titled “Sources”| Source | Description |
|---|---|
turbo | Read from turbo.json |
Options
Section titled “Options”| Option | Description |
|---|---|
--dry-run | Print config without writing |
--force | Overwrite existing config |
--merge | Merge with existing config |
--filter <pattern> | Only include matching packages |
--task <name> | Task name to look for (default: “dev”) |
Examples
Section titled “Examples”# Discover from turbo.jsondevmux discover turbo
# Preview without writingdevmux discover turbo --dry-run
# Only apps packagesdevmux discover turbo --filter "apps/*"devmux init
Section titled “devmux init”Print a configuration template.
devmux initOutput
Section titled “Output”Prints a template devmux.config.json that you can customize:
{ "project": "myapp", "services": { "api": { "command": "pnpm dev", "cwd": "./api", "port": 8787 } }}Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Config not found or invalid |
| 3 | Service not found |
| 4 | Health check timeout |
Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
DEVMUX_CONFIG | Path to config file (default: ./devmux.config.json) |
DEVMUX_TIMEOUT | Default health check timeout in ms |
DEVMUX_DEBUG | Enable debug logging (1 or true) |