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 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)
  • Per-proc autostart policyalways, 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.

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.1.tar.gz (81.5 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.1-py3-none-any.whl (58.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bgo_cli-0.4.1.tar.gz
  • Upload date:
  • Size: 81.5 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.1.tar.gz
Algorithm Hash digest
SHA256 6d9c0fc84a92c16fdbf1cb716f729e855caa49ead2b06604e3729b5285325408
MD5 65857805a5b606aa00c545de9968a26a
BLAKE2b-256 7cb480692acf915c202c7de0a701973b88162ca633f55fcf1377e3d6ea00b48f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bgo_cli-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 58.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fa17e5fe96df12635ce2c99b5a6e06cd220208c78735cce78bfbe020e45de9a
MD5 73d090038c26c1110dc88095da7b2311
BLAKE2b-256 06d1582fa7848ae52d6e3ec55a023ace13aa23992f94bce8e99b509e1ec572f5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 files

0.4.0

2 files

0.3.1

2 files

0.2.0

2 files

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