Skip to main content

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 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)
  • Per-proc autostart policy — always, unless-stopped (default), or never; controls what bgo resurrect brings back at login
  • 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

# Control login autostart behavior
bgo autostart set myserver never
bgo autostart install            # run bgo resurrect at login

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 / source checkout) 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

227 tests covering state I/O, atomic writes, command-shape detection, name derivation, liveness + zombie filtering, watch-config inheritance, watch loop behavior, table rendering, desktop notifications, login autostart, autostart policy, direct-mode parsing, core command handlers, and tray menu construction.

Requirements

  • Python 3.10+
  • Linux or macOS
  • Optional [tray] extra: PySide6 (Qt for Python, LGPL)

License

MIT.

Metadata

Release files for bgo-cli 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bgo-cli 0.4.1
File Size Uploaded Provenance Actions
bgo_cli-0.4.1.tar.gz 81.5 kB Without provenance Details for bgo_cli-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bgo-cli 0.4.1
File Interpreter ABI Platform Actions
bgo_cli-0.4.1-py3-none-any.whl Python 3 none any Details for bgo_cli-0.4.1-py3-none-any.whl

Total release size: 140.0 kB

Release files / bgo_cli-0.4.1.tar.gz

Download URL bgo_cli-0.4.1.tar.gz
Size 81.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6d9c0fc84a92c16fdbf1cb716f729e855caa49ead2b06604e3729b5285325408
BLAKE2b-256 checksum
How to use checksums
7cb480692acf915c202c7de0a701973b88162ca633f55fcf1377e3d6ea00b48f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / bgo_cli-0.4.1-py3-none-any.whl

Download URL bgo_cli-0.4.1-py3-none-any.whl
Size 58.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fa17e5fe96df12635ce2c99b5a6e06cd220208c78735cce78bfbe020e45de9a
BLAKE2b-256 checksum
How to use checksums
06d1582fa7848ae52d6e3ec55a023ace13aa23992f94bce8e99b509e1ec572f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for bgo-cli 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page