Skip to content

Commands

Start a service if not already running. Idempotent - safe to call multiple times.

Terminal window
devmux ensure <service>
Current StateAction
Service not runningStart new tmux session
tmux session exists, process deadRestart the service
Service running and healthyReuse (no-op)
OptionDescription
--waitWait for health check before returning (default: true)
--timeout <ms>Health check timeout (default: 30000)
Terminal window
# Start API service
devmux ensure api
# Start with longer timeout
devmux ensure api --timeout 60000
# Start without waiting for health check
devmux ensure api --no-wait

Show status of all configured services.

Terminal window
devmux status [options]
Service Status Port Session
api running 8787 omo-myapp-api
web running 3000 omo-myapp-web
worker stopped - -
OptionDescription
--jsonOutput as JSON
--service <name>Show status for specific service only
Terminal window
# Show all services
devmux status
# JSON output (for scripting)
devmux status --json
# Specific service
devmux status --service api

Stop one or all services.

Terminal window
devmux stop <service|all>
  • Sends SIGTERM to the process
  • Kills the tmux session
  • Waits for clean shutdown
Terminal window
# Stop API service
devmux stop api
# Stop all services
devmux stop all

Attach to a service’s tmux session to view logs.

Terminal window
devmux attach <service>

After attaching:

  • View live logs
  • Interact with the process
  • Press Ctrl+B then D to detach (service keeps running)
  • Press Ctrl+C to stop the service and exit

Run a command with specified services, cleaning up on exit.

Terminal window
devmux run --with <service> [--with <service>...] -- <command>
  1. Ensures all specified services are running
  2. Runs your command
  3. When command exits, stops services that THIS run started
  4. Services that were already running are left alone
OptionDescription
--with <service>Service to ensure (can be repeated)
--cleanupStop all services on exit, even pre-existing (default: false)
Terminal window
# Run tests with API
devmux run --with api -- npm test
# Run with multiple services
devmux run --with api --with web -- npm run e2e
# Force cleanup of all services on exit
devmux run --with api --cleanup -- npm test

Auto-generate configuration from your project.

Terminal window
devmux discover <source>
SourceDescription
turboRead from turbo.json
OptionDescription
--dry-runPrint config without writing
--forceOverwrite existing config
--mergeMerge with existing config
--filter <pattern>Only include matching packages
--task <name>Task name to look for (default: “dev”)
Terminal window
# Discover from turbo.json
devmux discover turbo
# Preview without writing
devmux discover turbo --dry-run
# Only apps packages
devmux discover turbo --filter "apps/*"

Print a configuration template.

Terminal window
devmux init

Prints a template devmux.config.json that you can customize:

{
"project": "myapp",
"services": {
"api": {
"command": "pnpm dev",
"cwd": "./api",
"port": 8787
}
}
}

CodeMeaning
0Success
1General error
2Config not found or invalid
3Service not found
4Health check timeout

VariableDescription
DEVMUX_CONFIGPath to config file (default: ./devmux.config.json)
DEVMUX_TIMEOUTDefault health check timeout in ms
DEVMUX_DEBUGEnable debug logging (1 or true)