Skip to main content

Units

Use sysg start -- <command...> to create and run a single managed unit without writing a full project config. When --name is omitted, systemg auto-generates a unit name.

Common examples

Keep a lightweight HTTP server alive.
$ sysg start --daemonize -- python3 -m http.server 8080
Keep a one-off script running.
$ sysg start --daemonize -- ./scripts/dev-health-check.sh
Tail application logs under supervision.
$ sysg start --daemonize -- tail -F ./logs/app.log
Run a frontend dev server.
$ sysg start --daemonize -- npm run dev
Run a backend API in reload mode.
$ sysg start --daemonize -- uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
Run a worker with explicit queue and concurrency settings.
$ sysg start --daemonize -- sh -lc 'QUEUE=critical CONCURRENCY=4 ./bin/worker'
Run a live TypeScript watcher and build loop.
$ sysg start --daemonize -- sh -lc 'pnpm install && pnpm run dev:watch'
Run a periodic heartbeat loop.
$ sysg start --daemonize -- sh -lc 'while true; do date; sleep 30; done'
Run a composed multi-step local pipeline.
$ sysg start --daemonize -- sh -lc 'pnpm db:migrate && pnpm run seed && pnpm run start:prod'

Where unit files are stored

Generated unit configs are saved under:
~/.local/share/systemg/units/*.yaml
systemg automatically prunes this folder to prevent unbounded growth.

Applying a newly staged unit

If a supervisor is already running, sysg start --daemonize -- <command...> stages the unit YAML and prints the explicit restart command. This keeps restart decisions under user control.
$ sysg restart --daemonize --config ~/.local/share/systemg/units/<unit>.yaml

Inspect and stop

$ sysg status
$ sysg logs --service <unit-name>
$ sysg stop --service <unit-name>