A lightweight, systemd-managed continuous integration tool for Git-based projects. zlorb monitors repositories, detects changes, and triggers builds using Bun, keeping your projects up-to-date effortlessly.
zlorb is a Rust-based system with three components: zlorb-service (the monitoring daemon), zlorb-ctl (a CLI for easy management), and zlorb-lib (shared functionality).
It watches Git repositories for updates, performs safe fast-forward merges, and runs build commands when changes are detected or build artifacts are missing.
- 🔍 Automatic Change Detection: Tracks repository updates using the
git2library. - 🔒 Safe Git Operations: Ensures only fast-forward merges are applied.
- 🏗️ Build Triggering: Executes Bun builds when changes occur or
dist/is missing. - ⚙️ Systemd Integration: Runs reliably with automatic restarts.
- 🖥️ CLI Management: Easily add, remove, or list repositories without service restarts.
Prerequisites: a Rust toolchain (via rustup) and Linux with systemd.
Install both binaries with Cargo — no clone and no just required:
cargo install --git https://github.com/Klectr/zlorb zlorb-ctl
cargo install --git https://github.com/Klectr/zlorb zlorb-serviceThen set up the daemon:
zlorb-ctl setupsetup does the rest in one step:
- creates the config directory and an empty
repositories.tomlin it (existing files are left untouched), - writes a systemd unit whose
ExecStartis the installedzlorb-servicebinary and which pinsZLORB_CONFIG_DIRto the config directory resolved at setup time, - runs
systemctl daemon-reloadandsystemctl enable --now zlorb.service(the--uservariants for a normal user; runsetupas root only if you deliberately want a system service), and for user services also tries to enable linger so the daemon starts at boot and keeps running after logout, - exits non-zero and prints the exact commands to finish by hand when registration does not complete.
Use zlorb-ctl setup --print-only to write the config and unit files and print the unit and the systemctl commands without running them.
The unit pins the config directory resolved when setup runs. If you change ZLORB_CONFIG_DIR or XDG_CONFIG_HOME afterwards, re-run zlorb-ctl setup so the daemon and zlorb-ctl keep reading the same directory. Run zlorb-ctl start / watch at the same scope you ran setup (both as your user, or both as root). The checked-in zlorb.service in this repo is only a fallback template for the default user layout; the unit setup generates is the one that counts.
From a source checkout, the equivalent is cargo install --path zlorb-ctl and cargo install --path zlorb-service, followed by zlorb-ctl setup — or simply just install, which runs exactly those steps.
zlorb-ctl and the daemon resolve the config directory the same way, in this order:
$ZLORB_CONFIG_DIR, when set (the generated systemd unit sets it explicitly),$XDG_CONFIG_HOME/zlorb,~/.config/zlorb.
<config dir>/service-config.toml — created by the daemon with defaults on first run:
sleep_time = 5
username = "NO USERNAME PROVIDED"
token = "NO TOKEN PROVIDED"sleep_time is the number of seconds the daemon waits between polling cycles. The daemon re-reads this file and repositories.toml every cycle, so edits take effect without a restart.
<config dir>/repositories.toml:
[[repository]]
name = "SomeRepo"
path = "/home/you/SomeRepo"
remote = "origin"
branch = "master"
build_strategy = "bun"
build_command = ""
restart_command = "./deploy.sh"Set build_strategy (and branch/remote when they differ) after adding a repo; the daemon picks the change up on its next cycle.
restart_command is optional. When it is set, the daemon runs it through the shell in the repo directory after a cycle in which the repo's HEAD changed and the build (when one was needed) succeeded — the hook a long-lived app uses to restart itself on the new code. It also runs in the cycle where a build that failed in an earlier cycle finally succeeds for the current commit. It does not run when nothing changed or when the build failed. The command must return: the project's own script owns stopping the old process and starting the new one in the background (a backgrounded process does not block the daemon, even if it keeps writing to the captured output). Zlorb runs the command, logs its output, and treats a non-zero exit as a failed cycle, retrying the command on later cycles until it succeeds. Valid strategies are "bun" and "rust" ("cargo" is accepted as an alias for "rust"). The selected manager owns dependency installation and the build itself, so build_strategy is the only build choice to make. An unknown or missing strategy is a config error for that repo: the daemon logs it on every reload, and when a build is triggered for that repo it fails with that error instead of guessing a manager.
Migration from older configs: a repo with no build_strategy keeps working only when its legacy build_command is "bun", "cargo", or "cargo build" (matched exactly, ignoring case and surrounding whitespace). Any other legacy value (for example "cargo build --release" or "bun run build") no longer selects a manager by substring; add an explicit build_strategy line to that repo instead.
Manage repositories with zlorb-ctl commands:
# Add the current git repository
zlorb-ctl add
# List all configured repositories
zlorb-ctl list
# Remove a repository
zlorb-ctl remove --repo-name my-repoThe daemon is the systemd service registered by zlorb-ctl setup: a per-user service for normal installs, running in the foreground with automatic recovery on failure.
- Install zlorb as described above and run
zlorb-ctl setup. - From inside a git repository, run
zlorb-ctl add. - Edit
build_strategyfor the repo in<config dir>/repositories.toml("bun"or"rust"). - Monitor build logs via
journalctl --user -u zlorb(journalctl -u zlorbfor a system service).
zlorb will automatically keep your repositories updated and built, saving you time and effort.
Zlorb ships build managers for Bun and Rust today. Managers are built on demand for a real project that needs them, not prebuilt for every stack.
If a project needs a package manager or build system Zlorb does not have yet, the path is a new manager module: implement the shared Manager interface, modeled on the existing Bun and Rust managers. The contract, registration steps, and conformance checklist are in docs/build-managers.md, and a copyable starting point is at zlorb-service/src/build_system_executor/managers/template.rs.
Want to contribute? See CONTRIBUTING.md for the branch model, the build and test requirements, and how changes are reviewed. Pull requests and feedback are welcome! To add support for a new build toolchain, follow Adding a build manager: it covers the strategy pattern, the copyable manager template, and the conformance checklist a new manager must pass.
Zlorb is licensed under the MIT License.
- watch ctl flag that triggers journalctl log watcher
- web output ctl flag that spins up web server
- need to load configs into memory so daemon doesnt need to keep reading file system every iteration