mprocs - Esegui Più Comandi in Parallelo Cheatsheet
mprocs esegue più comandi a lungo termine contemporaneamente, ognuno nel suo riquadro etichettato con output e scrollback indipendenti, controllati da un singolo TUI. È progettato per la situazione di sviluppo comune in cui dovresti altrimenti aprire più terminali o split tmux per eseguire un server frontend, un backend, un watcher e un database. Definisci i processi una volta in un file di configurazione e avviali insieme.
Installation
| Platform | Command |
|---|
| Cargo (all platforms) | cargo install mprocs |
| macOS (Homebrew) | brew install mprocs |
| npm | npm install -g mprocs |
| Arch Linux (AUR) | yay -S mprocs |
| Scoop (Windows) | scoop install mprocs |
| Prebuilt binary | Download from the GitHub Releases page |
Basic Usage
| Command | Description |
|---|
mprocs | Start using mprocs.yaml in the current directory |
mprocs "npm run dev" "npm run api" | Run ad-hoc commands as panes |
mprocs -c path/to/mprocs.yaml | Use a specific config file |
mprocs --names web,api "npm run dev" "cargo run" | Name ad-hoc panes |
mprocs --help | Full option list |
Configuration (mprocs.yaml)
procs:
web:
shell: "npm run dev"
api:
shell: "cargo run"
db:
shell: "docker compose up postgres"
autostart: false # start it manually with the UI
worker:
cmd: ["python", "worker.py"]
cwd: "./backend"
env:
LOG_LEVEL: debug
| Field | Purpose |
|---|
shell | Command run through the shell |
cmd | Command as an argv list (no shell parsing) |
cwd | Working directory for the process |
env | Per-process environment variables |
autostart | Whether the process starts on launch |
stop | How to stop it (SIGTERM, SIGKILL, hard-kill) |
Keyboard Controls
| Key | Action |
|---|
Ctrl+a then j/k | Move selection down/up the process list |
Ctrl+a then s | Start the selected process |
Ctrl+a then x | Stop the selected process |
Ctrl+a then r | Restart the selected process |
Ctrl+a then a | Toggle focus between list and pane (interact with the process) |
Ctrl+a then c | Copy mode / scroll the pane output |
Ctrl+a then q | Quit mprocs (stops all processes) |
| Mouse | Click a process to select; scroll its output |
Il prefisso predefinito è Ctrl+a; è configurabile. Premi il prefisso, rilascia, quindi il tasto azione.
Remote Control
mprocs può essere controllato programmaticamente, il che è utile da script o attività dell”editor.
# Send a command to a running mprocs instance over its control socket
mprocs --ctl '{c: restart-proc, proc: web}'
Common Workflows
# One command to bring up a full local stack defined in mprocs.yaml
mprocs
# Quick throwaway: watch tests and a dev server side by side
mprocs --names test,dev "npm test -- --watch" "npm run dev"
# Keep the database pane present but start it only when needed (autostart: false)
mprocs vs Alternatives
| Tool | Model | Best for |
|---|
| mprocs | TUI, one pane per process | Dev process groups, simple config |
| tmux | Full terminal multiplexer | Sessions, splits, remote persistence |
| foreman/overmind | Procfile runners | Procfile-based process management |
| GNU parallel | Batch parallelism | Running many short jobs, not long-lived servers |
Resources