|
1 | | -CLI Reference |
2 | | -============= |
| 1 | +# CLI Reference |
3 | 2 |
|
4 | | -> Note: the user-facing CLI lives in `lb_ui` (invoke via `lb` or `python -m lb_ui.cli`). Runner/controller packages no longer import the UI or expose separate entrypoints. |
| 3 | +> Note: the user-facing CLI lives in `lb_ui` (invoke via `lb` or `python -m lb_ui.cli`). Runner/controller packages do not expose separate entrypoints. |
| 4 | +
|
| 5 | +## Setup |
5 | 6 |
|
6 | | -Setup |
7 | | ------ |
8 | 7 | - Install in a venv: `uv venv && uv pip install -e .` |
9 | 8 | - Make `lb` globally available (optional): `uv tool install -e .` |
10 | | -- Enable shell completion: `lb --install-completion` (bash/zsh/fish) and restart your shell. |
| 9 | +- Enable shell completion: `lb --install-completion` (bash/zsh/fish) |
| 10 | + |
| 11 | +## Global flags |
| 12 | + |
| 13 | +- `--headless` forces headless output (useful in CI or pipes). |
| 14 | + |
| 15 | +## Config resolution |
11 | 16 |
|
12 | | -Config resolution |
13 | | ------------------ |
14 | 17 | Order used by commands that need a config: |
| 18 | + |
15 | 19 | 1. `-c/--config` flag |
16 | 20 | 2. Saved default at `~/.config/lb/config_path` (set via `lb config set-default` or `lb config init`) |
17 | 21 | 3. `./benchmark_config.json` if present |
18 | 22 | 4. Built-in defaults |
19 | 23 |
|
20 | | -Top-level commands |
21 | | ------------------- |
22 | | -- `lb plugin list|ls [--select] [--enable NAME | --disable NAME] [-c FILE] [--set-default]` |
23 | | - Show plugins with enabled state; optionally enable/disable a workload in the config or open an interactive selector (arrows + space). (`lb plugins` remains as a compatibility alias.) |
24 | | -- `lb plugin select [-c FILE] [--set-default]` |
25 | | - Directly open the interactive selector to toggle plugins with arrows + space. |
26 | | -- `lb plugin install PATH|URL [--manifest FILE] [--force] [--regen-assets/--no-regen-assets]` |
27 | | - Install a plugin from a .py file, directory, archive (.zip/.tar.gz), or git repository URL. |
28 | | -- `lb plugin uninstall NAME [--purge-config/--keep-config] [--regen-assets/--no-regen-assets]` |
29 | | - Remove a user plugin and optionally delete its config entries. |
30 | | -- `lb hosts [-c FILE]` |
31 | | - Show remote hosts from the resolved config. |
32 | | -- `lb run [TEST ...] [-c FILE] [--run-id ID] [--remote/--no-remote] [--repetitions N]` |
33 | | - Run workloads locally or remotely (auto-follows config unless overridden). Use `--repetitions` to temporarily change how many times each workload runs. |
34 | | -- `lb run ... --docker [--docker-image TAG] [--docker-engine docker|podman] [--docker-no-build] [--docker-no-cache]` |
35 | | - Build/use the container image and run the CLI inside it. Mounts the repo read-only and writes artifacts to the container’s `benchmark_results`. |
36 | | -- `lb runs list [--root PATH] [-c FILE]` / `lb runs show RUN_ID [--root PATH] [-c FILE]` |
37 | | - List past runs stored under `benchmark_results/` and inspect a single run (hosts, workloads, paths). |
38 | | -- `lb analyze [RUN_ID] [--root PATH] [--kind aggregate] [--workload NAME] [--host NAME]` |
39 | | - Run post-processing analytics on an existing run. If `RUN_ID` or selectors are omitted and you are in an interactive TTY, prompts will guide selection. |
40 | | - |
41 | | -Config management (`lb config ...`) |
42 | | ------------------------------------ |
| 24 | +## Top-level commands |
| 25 | + |
| 26 | +- `lb run [WORKLOAD ...] [-c FILE] [--run-id ID] [--resume [latest|ID]] [--remote/--no-remote] [--repetitions N] [--intensity LEVEL] [--setup/--no-setup] [--stop-file PATH] [--debug]` |
| 27 | + Run workloads remotely via Ansible. Local execution is not supported by the CLI. |
| 28 | +- `lb run ... --docker [--docker-engine docker|podman] [--nodes N]` |
| 29 | + Dev-only: provision containers and run via Ansible (requires `.lb_dev_cli` or `LB_ENABLE_TEST_CLI=1`). |
| 30 | +- `lb run ... --multipass [--nodes N]` |
| 31 | + Dev-only: provision Multipass VMs and run via Ansible (requires `.lb_dev_cli` or `LB_ENABLE_TEST_CLI=1`). |
| 32 | +- `lb runs list [--root PATH] [-c FILE]` / `lb runs show RUN_ID [--root PATH] [-c FILE]` |
| 33 | + Inspect stored runs under `benchmark_results/`. |
| 34 | +- `lb analyze [RUN_ID] [--root PATH] [--workload NAME] [--host NAME]` |
| 35 | + Run analytics on an existing run (currently `aggregate`). |
| 36 | +- `lb plugin ...` / `lb plugins ...` |
| 37 | + Inspect and manage workload plugins. |
| 38 | +- `lb config ...` |
| 39 | + Create and manage benchmark configuration files. |
| 40 | +- `lb doctor ...` |
| 41 | + Run prerequisite checks. |
| 42 | +- `lb test multipass ...` (dev-only) |
| 43 | + Helper to run integration tests. |
| 44 | + |
| 45 | +## Plugin management (`lb plugin ...`) |
| 46 | + |
| 47 | +- `lb plugin list|ls [--select] [--enable NAME | --disable NAME] [-c FILE] [--set-default]` |
| 48 | +- `lb plugin select [-c FILE] [--set-default]` |
| 49 | +- `lb plugin install PATH|URL [--manifest FILE] [--force]` |
| 50 | +- `lb plugin uninstall NAME [--purge-config/--keep-config] [-c FILE]` |
| 51 | + |
| 52 | +## Config management (`lb config ...`) |
| 53 | + |
43 | 54 | - `lb config init [-i] [--path FILE] [--set-default/--no-set-default]` |
44 | | - Create a config (prompt for a remote host with `-i`). |
45 | 55 | - `lb config set-repetitions N [-c FILE] [--set-default/--no-set-default]` |
46 | | - Persist the desired number of repetitions to a config file (defaults to `~/.config/lb/config.json`). |
47 | 56 | - `lb config set-default FILE` / `lb config unset-default` / `lb config show-default` |
48 | | -- `lb config edit [-p FILE]` |
49 | | - Open the config in `$EDITOR`. |
50 | | -- `lb config workloads [-c FILE]` |
51 | | - List workloads and enabled status. |
52 | | -- `lb config enable-workload NAME [-c FILE] [--set-default]` |
53 | | - (creates if missing) |
| 57 | +- `lb config edit [-p FILE]` |
| 58 | +- `lb config workloads [-c FILE]` |
| 59 | +- `lb config enable-workload NAME [-c FILE] [--set-default]` |
54 | 60 | - `lb config disable-workload NAME [-c FILE] [--set-default]` |
| 61 | +- `lb config select-workloads [-c FILE] [--set-default]` |
| 62 | + |
| 63 | +## Doctor checks (`lb doctor ...`) |
55 | 64 |
|
56 | | -Doctor checks (`lb doctor ...`) |
57 | | -------------------------------- |
58 | | -- `lb doctor controller` — Python deps + ansible/ansible-runner + config resolution. |
59 | | -- `lb doctor local-tools` — stress-ng, fio, sysstat tools, perf (needed only for local runs). |
60 | | -- `lb doctor multipass` — check presence of multipass (optional). |
61 | | -- `lb doctor all` — run all checks. |
| 65 | +- `lb doctor controller` - Python deps + Ansible requirements |
| 66 | +- `lb doctor local` - local workload tools (stress-ng, fio, sysstat) |
| 67 | +- `lb doctor multipass` - Multipass availability |
| 68 | +- `lb doctor all` - run all checks |
| 69 | + |
| 70 | +## Test helpers (`lb test ...`, dev installs only) |
62 | 71 |
|
63 | | -Integration helper (`lb test ...`, dev installs only) |
64 | | ------------------------------------------------------ |
65 | 72 | - Available when `.lb_dev_cli` exists in the project root or `LB_ENABLE_TEST_CLI=1` is set. |
66 | | -- `lb test multipass [-o DIR] [--vm-count {1,2}] [--multi-workloads] [-- EXTRA_PYTEST_ARGS...]` |
67 | | - Runs the Multipass integration test. Artifacts go to `tests/results` by default (override with `-o` or `LB_TEST_RESULTS_DIR`). `--vm-count` (or `LB_MULTIPASS_VM_COUNT`) launches 1–2 VMs. Use `--multi-workloads` to run the stress_ng + dd + fio variant. Requires multipass + ansible/ansible-runner locally. |
| 73 | +- `lb test multipass [-o DIR] [--vm-count {1,2}] [--multi-workloads] [-- EXTRA_PYTEST_ARGS...]` |
| 74 | + |
| 75 | +## Environment variables |
| 76 | + |
| 77 | +- `LB_ENABLE_TEST_CLI=1` enables `lb test` and provisioning flags in the CLI. |
| 78 | +- `LB_USER_PLUGIN_DIR` overrides the user plugin install directory. |
| 79 | +- `LB_STOP_FILE` sets a stop sentinel path if `--stop-file` is omitted. |
| 80 | +- `LB_TEST_RESULTS_DIR`, `LB_MULTIPASS_VM_COUNT` customize test helpers. |
0 commit comments