Skip to main content

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 Python License

PyPI: https://pypi.org/project/bgo-cli/

Features

  • Simple syntaxbgo <name> -- <command>
  • Unix-style aliasesbgo 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--json output 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bgo_cli-0.4.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bgo_cli-0.4.0-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

Details for the file bgo_cli-0.4.0.tar.gz.

File metadata

  • Download URL: bgo_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for bgo_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2d94be96f1a5257709a287b9f2e41452e5aa6e77db9970ca0fc64b47a631c4b0
MD5 77554e9f8b3e7a96cd541d8c83840432
BLAKE2b-256 7612c66a4fffdbdc136ffe9d91d14bf51b01066958e38d3062ff4d800c6a5294

See more details on using hashes here.

File details

Details for the file bgo_cli-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: bgo_cli-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for bgo_cli-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fd2116bfa03004b116f29d0b9701d60b6e96f918b3c9fb865b5e962d7877a6a
MD5 aa51de8ea2d3f6b4063f956f7b1c57a0
BLAKE2b-256 3a02ec09fde338bea87e1058c47b3a962dea9387addcfb09fc66e04d8867a24a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page