CLI
The Fabricator CLI is a small Click program for system-level service management on a standard Linux install. It drives systemctl, reads the installed version marker, talks to the local HTTP API for status, runs the bundled update script, and can remove an installation.
Source code lives in the main repo: tools/cli.py.
Prerequisites
Section titled “Prerequisites”Commands assume a standard deployment where:
- Fabricator runs as the
fabricatorsystemd service. - The app lives under
/opt/fabricator/app. - The virtualenv lives under
/opt/fabricator/venv. - The local API is reachable at
http://localhost:5000. /usr/local/bin/fabricatorpoints to the CLI entry point installed bypip install -e /opt/fabricator/app.
Commands
Section titled “Commands”fabricator start
Section titled “fabricator start”Runs systemctl start fabricator.
- Success: prints a green success message and exits
0. - Failure: prints a red error and exits with the
systemctlreturn code.
fabricator stop
Section titled “fabricator stop”Runs systemctl stop fabricator.
The command does not call a Flask shutdown endpoint; it delegates service shutdown to systemd.
fabricator update
Section titled “fabricator update”Updates Fabricator to the latest GitHub release.
- Reads
/opt/fabricator/app/.fabricator_versionwhen present. - Fetches
https://api.github.com/repos/philderks/Fabricator/releases/latest. - If already up to date, exits successfully.
- Otherwise runs
bash /opt/fabricator/app/tools/install.sh --updatewithFABRICATOR_VERSIONset to the latest tag.
fabricator status
Section titled “fabricator status”Shows systemd state and local Flask/API reachability.
Options:
| Option | Description |
|---|---|
--json | Print a JSON object instead of formatted text. |
Human output includes:
Service: result ofsystemctl is-active fabricator.Flask: whetherGET http://localhost:5000/api/statusresponds within five seconds.- Optional Minecraft-ish keys (
players,tps,uptime) when the API response includes them.
JSON shape:
{ "systemd_state": "active", "flask_up": true, "api_status_code": 200, "api_body": {}}fabricator version
Section titled “fabricator version”Prints the installed Fabricator release tag from /opt/fabricator/app/.fabricator_version.
Options:
| Option | Description |
|---|---|
--json | Print { "version": "<tag or null>" }. |
fabricator uninstall
Section titled “fabricator uninstall”Destructively removes Fabricator. It prompts for yes before proceeding.
The command attempts, in order:
- Stop the service.
- Disable the service.
- Remove
/opt/fabricator. - Remove
/var/lib/fabricator. - Remove
/etc/fabricator. - Remove the
fabricatorservice user. - Remove the systemd unit.
- Run
systemctl daemon-reload.
Individual removal steps report warnings rather than aborting the whole sequence.
fabricator help
Section titled “fabricator help”Lists every registered subcommand and short description.
Options:
| Option | Description |
|---|---|
--json | Print a JSON array of { "command", "description" } objects. |
Use Click’s built-in help for command-specific flags:
fabricator status --helpfabricator update --helpSummary
Section titled “Summary”| Command | Purpose |
|---|---|
start | Start the systemd service. |
stop | Stop the systemd service. |
update | Update to latest GitHub release via installer update mode. |
status | Show service/API health, optionally as JSON. |
version | Read installed release marker, optionally as JSON. |
uninstall | Interactive destructive removal. |
help | List commands, optionally as JSON. |