Lightweight, zero-dependency background process manager (pm2-style) with watch mode and auto-restart.
Project description
bgo — Background Go
Lightweight, zero-dep background process manager inspired by pm2. Detach any binary or script from your shell with one command.
PyPI: https://pypi.org/project/bgo-cli/
Features
- Simple syntax —
bgo <name> -- <command> - Unix-style aliases —
bgo open/kill/rm/ls - Status monitoring — CPU, memory, uptime; plain / normal / fancy tables with auto-detection
- Log management — stdout / stderr / watcher logs with follow mode
- Lifecycle — start, stop, restart, restart-stopped, restart-last, resurrect
- Watch mode — auto-restart crashed processes with fast-crash backoff
- Desktop notifications on errored transitions
- Login autostart via systemd-user (Linux) or LaunchAgent (macOS)
- Tray icon (optional) — PySide6, gear+dot status indicator, KDE/Hyprland/GNOME/macOS
- Scriptable —
--jsonoutput for any pipeline - Zero runtime dependencies in the core; one optional extra for the tray
Quick start
uv tool install bgo-cli # see docs/installation.md for alternatives
bgo myserver -- python3 -m http.server 8080
bgo ls
bgo logs myserver -f
bgo restart myserver
bgo stop myserver
bgo with no args prints help. bgo <unknown> errors out rather than
silently spawning something.
Documentation
Long-form docs live in docs/:
| Topic | Where |
|---|---|
| Install paths (uv / pipx / pip / install.sh / manual) | docs/installation.md |
| Full CLI reference | docs/commands.md |
| Watch mode (auto-restart + fast-crash policy) | docs/watch-mode.md |
| Desktop notifications | docs/notifications.md |
| Login autostart (systemd / launchd) | docs/autostart.md |
| Tray icon (optional, PySide6) | docs/tray.md |
| Module architecture | docs/architecture.md |
| FAQ | docs/faq.md |
| Contributing | docs/contributing.md |
Sample status table
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ NAME STATUS PID CPU MEM UPTIME WATCH COMMAND ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ web ● online 12345 2.5 0.1 00:05 ✓ 0 python3 -m http.server 8080 ┃
┃ api ● online 12346 0.0 0.0 01:23 ✓ 3 node server.js ┃
┃ worker ○ stopped - - - - ⚠ errored python3 worker.py ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Total: 3 | ● online: 2 | ○ stopped: 1
⚠ 1 errored:
worker — 4 consecutive fast-crashes
bgo logs worker --watcher | bgo restart worker
Override the rendering with --plain / --fancy or
BGO_TABLE=plain|normal|fancy.
Storage
- State:
~/.bgo/procs/<name>.json— one file per process, atomic writes. - Logs:
~/.bgo/logs/<name>.{out,err,watcher}.log.
Full layout: docs/architecture.md.
Testing
uv run pytest tests/ -v
169 tests covering state I/O, atomic writes, command-shape detection, name derivation, liveness + zombie filtering, watch-config inheritance, table rendering, desktop notifications, login autostart, and tray menu construction.
Requirements
- Python 3.10+
- Linux or macOS
- Optional
[tray]extra: PySide6 (Qt for Python, LGPL)
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bgo_cli-0.3.1.tar.gz.
File metadata
- Download URL: bgo_cli-0.3.1.tar.gz
- Upload date:
- Size: 57.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbe4d709f8f71c6e4a62af1663ae39202b91366cdc90c4ee3178c146987333ea
|
|
| MD5 |
efc062b8aeb8f0c08b095bb6df4989e3
|
|
| BLAKE2b-256 |
974b43e0dd732162a157c2ac6a8b71da856e8beb2ea459cdfbc2b80e3da67c45
|
File details
Details for the file bgo_cli-0.3.1-py3-none-any.whl.
File metadata
- Download URL: bgo_cli-0.3.1-py3-none-any.whl
- Upload date:
- Size: 50.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c42f51c77ee5cf64f1a61d1237375335385dd7cb593c4fdf3e9b2ebc0154bab
|
|
| MD5 |
85e99db6e66172863b9889cc58774d61
|
|
| BLAKE2b-256 |
cdd7d4a841749ab412d16ef50bd2bed53fca4451f54a62ff7175503a98bdf799
|