Architecture
Overview
Urus separates three concerns:
- Registry — JSON file at
~/.config/urus/registry.jsonlisting bots (name, runtime, paths, optional venv and deps command metadata). - Systemd — Unit files under
/etc/systemd/system/<name>.service, installed with sudo viaurus add’s install step. - CLI — Commander.js commands, Inquirer prompts, and thin wrappers around
systemctl/journalctl.
Registry
Each bot row includes runtime, botDir, entryFile, optional venvPath, optional depsInstallCommand, and timestamps. The registry is the source of truth for what Urus manages.
Systemd
Templates live in src/core/systemd/templates/ (copied to dist/ on build). ServiceGenerator fills ExecStart from the resolved runtime and entry path.
Delete behavior
urus delete removes the registry row and uninstalls the unit Urus installed (stop, disable, remove the file under /etc/systemd/system/, reload). It does not delete the bot’s source tree or working directory.
Python venv
When enabled, Urus creates botDir/venv if missing, or reuses it when venv/bin/python already exists (no destructive recreate). Dependency install commands run with venv activation appropriate for the user’s shell (bash vs fish).
Dependency installs
depsInstallCommand is stored on each bot. Urus runs it during add (after venv) and on restart when the command changed since the last successful run (tracked by lastDepsInstallCommand), or when --install-deps is passed.