Crash restart
Processes come back up automatically. Configure delay, max restarts, and backoff per process.
curl -sL https://raw.githubusercontent.com/shellhaki/zpm/main/scripts/install.sh | bashiex (curl.exe -UseBasicParsing https://raw.githubusercontent.com/shellhaki/zpm/main/scripts/install-windows.ps1)go build -o daemon/zpmd ./daemongo build -o src/zpm ./srcln -sf "$PWD/src/zpm" ~/.local/bin/zpmAfter installation:
zpm --help # see available commandszpm list # list managed processeszpm start script.js # start managing a processCrash restart
Processes come back up automatically. Configure delay, max restarts, and backoff per process.
Clusters
Spin up N instances with --instances. Named api-0, api-1, etc. Group commands work on all of them.
Health checks
Run any shell command as a health probe. ZPM restarts unhealthy processes automatically.
Log rotation
Cap log file size and keep N backups. No manual cleanup, no disk surprises.
Environment profiles
Named env profiles in your ecosystem config. Switch between production, staging, and more at runtime.
Startup on boot
Native integration with systemd, LaunchAgent, and Task Scheduler. One command to install.
Ecosystem config
Declare all your processes in a single zpm.config.json. Version-controllable and shareable.
Built in Go
Single static binary. No runtime, no dependencies. Ships with a daemon and a CLI.
zpm start "bun index" --name api --followzpm statuszpm stop apizpm restart apizpm purge apiZPM starts commands from the directory where you run zpm start, so package scripts work naturally:
{ "scripts": { "serve:zpm": "zpm start \"bun index\" --name api --follow" }}zpm start "bun index" --name api --env productionzpm start "bun index" --name api --env PORT=3000zpm start "bun index" --name api --instances 4zpm start "bun index" --name api --restart-delay 1000 --max-restarts 10zpm start "bun index" --name api --health "curl -fsS http://127.0.0.1:3000/health"zpm start "bun index" --name api --log-max-size 20mb --log-backups 7Cluster instances are named api-0, api-1, etc. Group commands apply to all:
zpm stop apizpm restart apizpm purge apizpm daemon startzpm daemon stopzpm daemon reloadRegister the daemon to start on login:
zpm startup installzpm startup uninstall| Platform | Managed by | Enable command |
|---|---|---|
| Linux | systemd user service | systemctl --user enable zpmd |
| macOS | LaunchAgent | launchctl load ~/Library/LaunchAgents/com.zpm.daemon.plist |
| Windows | Task Scheduler | Auto-configured when installer is run as Administrator |
Create zpm.config.json:
{ "apps": [ { "name": "api", "command": "bun index", "cwd": ".", "instances": 2, "auto_restart": true, "restart_delay": 1000, "max_restarts": -1, "health_command": "curl -fsS http://127.0.0.1:3000/health", "log_max_bytes": 10485760, "log_backups": 5, "env": { "PORT": "3000" }, "env_production": { "NODE_ENV": "production" } } ]}Run it:
zpm ecosystem start zpm.config.json --env productionZPM stores state in your user config directory (typically ~/.config/zpm on Linux):
registry.jsondaemon.piddaemon.loglogs/<process>.logLinux
amd64, arm64 — auto-detected via uname -m.
Installs to ~/.local/bin/. Creates a systemd user service.
systemctl --user enable zpmd
macOS
amd64 (Intel), arm64 (Apple Silicon) — auto-detected.
Installs to ~/.local/bin/. Creates a LaunchAgent plist.
launchctl load ~/Library/LaunchAgents/com.zpm.daemon.plist
Windows
amd64 — installs to %LOCALAPPDATA%\zpm\bin.
Updates User PATH. Creates a Task Scheduler task when run as Administrator.
Push a tag to publish cross-platform builds via GitHub Actions:
git tag v0.1.0git push origin v0.1.0The pipeline builds: Linux amd64/arm64, macOS amd64/arm64, Windows amd64.
systemctl --user disable zpmdrm ~/.local/bin/{zpm,zpmd}# remove ZPM PATH export from ~/.bashrc or ~/.zshrclaunchctl unload ~/Library/LaunchAgents/com.zpm.daemon.plistrm -rf ~/.local/bin/{zpm,zpmd} ~/.zpm ~/Library/LaunchAgents/com.zpm.daemon.plist# remove ZPM PATH export from ~/.zshrc or ~/.bash_profileUnregister-ScheduledTask -TaskName "ZPM Daemon" -Confirm:$falseRemove-Item "$env:LOCALAPPDATA\zpm" -Recurse# remove from User PATH environment variables manuallyBuilt by shellhaki — haki.top · x.com/haki_xer