bots-garden/razorbillpublic Fork
⑂ main
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/razorbill.git
git clone ssh://git@rickub.com/bots-garden/razorbill.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
🛟 Updated. 872a940 · on main · k33g · 3h ago
cli.md · 105 lines · 5.8 KBmarkdown
Blame HistoryOpen raw

Reference: command line

Every rzb command, option and exit code of razorbill 1.0.0.

rzb <command> [options]
rzb --help | --version
rzb help <command>
Command Purpose
rzb serve Start the OpenAI-compatible server
rzb tui Open the full-screen interface to the server on this machine
rzb config validate Check a server configuration file
rzb models List, download, delete models
rzb version Version and engines

rzb serve

rzb serve [--config <file>] [--host <address>] [--port <n>] [--api-key-env <name>] [--cors-origin <origin>]

Starts the server and runs until Ctrl-C or SIGTERM; then it stops accepting requests, unloads the models and exits with code 0. SIGHUP reads the --config file again (what changes) and writes the outcome to the log; without --config there is nothing to reload.

Option Type Default Description
--config <file> path none Server configuration file (reference). Without it: no declared models, built-in defaults
--host <address> string, not empty server.host, else 127.0.0.1 Address to listen on; 0.0.0.0 for every interface
--port <n> integer, 1–65535 server.port, else 7920 TCP port
--api-key-env <name> string server.api_key_env, else RZB_API_KEY Environment variable holding the API key. Set and not empty: every route but /health needs Authorization: Bearer <key>
--cors-origin <origin> string server.cors_origin, else none Let browser pages from this origin call the API; * for any origin

Options win over the server: section of the file. On start it prints, on standard error:

config: server.yaml (2 declared models)
rzb 1.0.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop

The first line appears only with --config. Warnings (warning: …) are printed before the banner when the server listens on a network address without an API key, or allows every CORS origin without one. Then one log line per request: method, path, status, duration, and the model and token counts (model=… tokens=<prompt>+<completion>, plus cached=<n> when part of the prompt was reused from the previous request); prompts and answers are never logged.

The engine is the first one of the build: mlx on the Mac, fake on Linux (which answers echo: <last message> without a model).

rzb tui

rzb tui [--url <url>] [--config <file>] [--api-key-env <name>]

Opens a full-screen interface to a rzb serve running on the same machine, and runs until Ctrl-Q or Ctrl-C; the terminal is then restored as it was. It never loads a model itself: it reads the server over HTTP, polling GET /rzb/status every second (poll_interval).

Option Type Default Description
--url <url> http://host:port or https://… from --config, else http://127.0.0.1:7920 The server; a trailing / or /v1 is dropped
--config <file> path none The server's configuration file: its server.host and server.port give the address (0.0.0.0 and :: become 127.0.0.1), its server.api_key_env the key variable
--api-key-env <name> string server.api_key_env, else RZB_API_KEY Environment variable holding the server's API key; unset or empty: no key

Precedence: these options, then the preferences file ~/.config/razorbill/tui.yaml, then the --config file, then the defaults. NO_COLOR turns colours off.

The screens, their keys and the preferences are described in the rzb tui reference.

Errors: a --url that is not an http(s) address gives exit code 64; an invalid --config or preferences file, exit code 2; no terminal on standard input and output, error: rzb tui needs a terminal … and exit code 1.

rzb config validate

rzb config validate <file>

Loads the file without starting anything. Prints <file> is valid: 2 models (qwen3, embed), any Hugging Face MLX id accepted on standard output, or every problem found with its line number (format) and exit code 2.

rzb models

Command Arguments and options Description
rzb models list --all: also show repositories that are not loadable (GGUF, unfinished downloads), with a status column Models in the cache, one per line: id, size, revisions. Prints the cache folder on standard error
rzb models pull <id> --revision <rev> (default main), --engine <name> Download or update a model (*.safetensors, *.json, *.jinja), with a progress bar
rzb models rm <id> -y, --yes: do not ask (required without a terminal) Delete a model from the cache

The cache is $HF_HUB_CACHE, else $HF_HOME/hub, else ~/.cache/huggingface/hub, shared with the Python Hugging Face tools.

rzb version

Prints rzb 1.0.0 (engines: fake, mlx) (the engines of this build, sorted). rzb --version prints 1.0.0.

Exit codes

Code Meaning
0 Success, or server stopped normally
1 Failure while running (download, model, port already in use…)
2 Configuration file missing or invalid
64 Invalid command line
130 Interrupted

Environment variables

Variable Effect
RZB_API_KEY (or the name given by --api-key-env / server.api_key_env) API key of the server
HF_HUB_CACHE, HF_HOME Location of the model cache
NO_COLOR Disables colours on standard error, and in rzb tui
RZB_TUI_PREFERENCES The preferences file of rzb tui, instead of ~/.config/razorbill/tui.yaml
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
# Reference: command line

> Every `rzb` command, option and exit code of razorbill 1.0.0.

```
rzb <command> [options]
rzb --help | --version
rzb help <command>
```

| Command | Purpose |
| --- | --- |
| [`rzb serve`](#rzb-serve) | Start the OpenAI-compatible server |
| [`rzb tui`](#rzb-tui) | Open the full-screen interface to the server on this machine |
| [`rzb config validate`](#rzb-config-validate) | Check a server configuration file |
| [`rzb models`](#rzb-models) | List, download, delete models |
| [`rzb version`](#rzb-version) | Version and engines |

## rzb serve

```
rzb serve [--config <file>] [--host <address>] [--port <n>] [--api-key-env <name>] [--cors-origin <origin>]
```

Starts the server and runs until Ctrl-C or SIGTERM; then it stops accepting requests, unloads the models and exits with code 0. `SIGHUP` reads the `--config` file again ([what changes](configuration.md#reloading)) and writes the outcome to the log; without `--config` there is nothing to reload.

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `--config <file>` | path | none | Server configuration file ([reference](configuration.md)). Without it: no declared models, built-in defaults |
| `--host <address>` | string, not empty | `server.host`, else `127.0.0.1` | Address to listen on; `0.0.0.0` for every interface |
| `--port <n>` | integer, 1–65535 | `server.port`, else `7920` | TCP port |
| `--api-key-env <name>` | string | `server.api_key_env`, else `RZB_API_KEY` | Environment variable holding the API key. Set and not empty: every route but `/health` needs `Authorization: Bearer <key>` |
| `--cors-origin <origin>` | string | `server.cors_origin`, else none | Let browser pages from this origin call the API; `*` for any origin |

Options win over the `server:` section of the file. On start it prints, on standard error:

```
config: server.yaml (2 declared models)
rzb 1.0.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop
```

The first line appears only with `--config`. Warnings (`warning: …`) are printed before the banner when the server listens on a network address without an API key, or allows every CORS origin without one. Then one log line per request: method, path, status, duration, and the model and token counts (`model=… tokens=<prompt>+<completion>`, plus `cached=<n>` when part of the prompt was reused from the previous request); prompts and answers are never logged.

The engine is the first one of the build: `mlx` on the Mac, `fake` on Linux (which answers `echo: <last message>` without a model).

## rzb tui

```
rzb tui [--url <url>] [--config <file>] [--api-key-env <name>]
```

Opens a full-screen interface to a `rzb serve` running on the same machine, and runs until Ctrl-Q or Ctrl-C; the terminal is then restored as it was. It never loads a model itself: it reads the server over HTTP, polling [`GET /rzb/status`](http-api.md#get-rzbstatus) every second (`poll_interval`).

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `--url <url>` | `http://host:port` or `https://…` | from `--config`, else `http://127.0.0.1:7920` | The server; a trailing `/` or `/v1` is dropped |
| `--config <file>` | path | none | The server's configuration file: its `server.host` and `server.port` give the address (`0.0.0.0` and `::` become `127.0.0.1`), its `server.api_key_env` the key variable |
| `--api-key-env <name>` | string | `server.api_key_env`, else `RZB_API_KEY` | Environment variable holding the server's API key; unset or empty: no key |

Precedence: these options, then the [preferences file](tui.md#preferences-file-tuiyaml) `~/.config/razorbill/tui.yaml`, then the `--config` file, then the defaults. `NO_COLOR` turns colours off.

The screens, their keys and the preferences are described in the [`rzb tui` reference](tui.md).

Errors: a `--url` that is not an http(s) address gives exit code 64; an invalid `--config` or preferences file, exit code 2; no terminal on standard input and output, `error: rzb tui needs a terminal …` and exit code 1.

## rzb config validate

```
rzb config validate <file>
```

Loads the file without starting anything. Prints `<file> is valid: 2 models (qwen3, embed), any Hugging Face MLX id accepted` on standard output, or every problem found with its line number ([format](configuration.md#errors)) and exit code 2.

## rzb models

| Command | Arguments and options | Description |
| --- | --- | --- |
| `rzb models list` | `--all`: also show repositories that are not loadable (GGUF, unfinished downloads), with a status column | Models in the cache, one per line: id, size, revisions. Prints the cache folder on standard error |
| `rzb models pull <id>` | `--revision <rev>` (default `main`), `--engine <name>` | Download or update a model (`*.safetensors`, `*.json`, `*.jinja`), with a progress bar |
| `rzb models rm <id>` | `-y`, `--yes`: do not ask (required without a terminal) | Delete a model from the cache |

The cache is `$HF_HUB_CACHE`, else `$HF_HOME/hub`, else `~/.cache/huggingface/hub`, shared with the Python Hugging Face tools.

## rzb version

Prints `rzb 1.0.0 (engines: fake, mlx)` (the engines of this build, sorted). `rzb --version` prints `1.0.0`.

## Exit codes

| Code | Meaning |
| --- | --- |
| `0` | Success, or server stopped normally |
| `1` | Failure while running (download, model, port already in use…) |
| `2` | Configuration file missing or invalid |
| `64` | Invalid command line |
| `130` | Interrupted |

## Environment variables

| Variable | Effect |
| --- | --- |
| `RZB_API_KEY` (or the name given by `--api-key-env` / `server.api_key_env`) | API key of the server |
| `HF_HUB_CACHE`, `HF_HOME` | Location of the model cache |
| `NO_COLOR` | Disables colours on standard error, and in `rzb tui` |
| `RZB_TUI_PREFERENCES` | The preferences file of `rzb tui`, instead of `~/.config/razorbill/tui.yaml` |