CLI reference#
The rackattack binary is a single CLI with six subcommands. Runtime behaviour
is configured through environment variables (see Configuration);
the flags below control per-invocation inputs.
rackattack [command]
serve Run the gRPC service and the REST (grpc-gateway) endpoint
mcp Run the MCP adapter over stdio
migrate Apply database migrations
fleet Generate a synthetic datacenter fleet
example Generate a sample fleet and a guided-tour gallery
query Run a single query and print a summary
-h, --help help for rackattack
-v, --version version for rackattackEvery subcommand reads DATABASE_URL (default
postgres://root@localhost:26257/rackattack?sslmode=disable). All commands that
need a schema (serve, fleet, example) auto-migrate first, so a separate
migrate run is optional.
serve#
Runs the gRPC server (GRPC_ADDR, default :8080) and the HTTP server
(HTTP_ADDR, default :8081) that hosts the REST gateway, GraphQL, /metrics,
/healthz, /readyz, and /audit/*. Auto-migrates on startup and drains
gracefully on SIGTERM/SIGINT. The bulk of its behaviour (auth, cache, audit,
TLS, production guardrail, timeouts) is environment-driven — see
Configuration.
| Flag | Default | Meaning |
|---|---|---|
--seed-example | false | Generate the example fleet on startup if the database is empty (dev convenience; never overwrites an existing fleet). |
rackattack serve # serve against $DATABASE_URL
rackattack serve --seed-example # also seed the example fleet if emptymcp#
Runs the MCP (Model Context Protocol) adapter over stdio, exposing the read tools
1:1 over the service core for an LLM agent. No flags; reads DATABASE_URL. See
MCP (agent interface) for setup and the tool list.
rackattack mcpmigrate#
Applies all pending database migrations (idempotent — a fully-migrated database
is a no-op). No flags; reads DATABASE_URL.
rackattack migratefleet new#
Generates a synthetic datacenter fleet into the database. Deterministic for a
given --seed: the same seed reproduces the same fleet. --preset example
reproduces the narrative entities exactly and overrides the scale flags.
| Flag | Default | Meaning |
|---|---|---|
--preset | (none) | Named preset (e.g. example); overrides the scale flags. |
--sites | 1 | Number of sites. |
--rows-per-floor | 4 | Rows per floor. |
--racks-per-row | 8 | Racks per row. |
--oversub | 3 | Network oversubscription ratio. |
--redundancy | ab | Power redundancy: ab or none. |
--seed | 1 | Deterministic seed. |
rackattack fleet new --preset example # the narrative fleet
rackattack fleet new --sites 2 --racks-per-row 12 --seed 7example run#
Generates a fleet, mines incident scenarios, runs the prompts, and writes a
guided-tour gallery (the end-to-end tour behind just example).
| Flag | Default | Meaning |
|---|---|---|
--preset | (none) | Named preset (e.g. example). |
--out | example-out | Output directory (writes index.md + artifacts). |
--sites | 1 | Number of sites. |
--rows-per-floor | 4 | Rows per floor. |
--racks-per-row | 8 | Racks per row. |
--seed | 1 | Deterministic seed. |
--llm | false | Vary prompt phrasing via the LLM seam (deterministic stand-in by default). |
rackattack example run --preset example --out ./tourquery#
Runs a single hot query and prints a one-line summary — a CLI probe and the
target of the benchmarks (scripts/bench.sh). Reads
DATABASE_URL; expects a fleet to already exist.
query blast-radius#
| Flag | Default | Meaning |
|---|---|---|
--feed | site-01-F1-B | Feed code to compute the power blast radius for. |
query cable-path#
| Flag | Default | Meaning |
|---|---|---|
--device | R001-d01 | From device code. |
--port | et-0/0/0 | From port name. |
query thermal#
| Flag | Default | Meaning |
|---|---|---|
--scope | floor:site-01/1 | Scope ref for the thermal-headroom query. |
query floor-plan#
| Flag | Default | Meaning |
|---|---|---|
--scope | floor:site-01/1 | Floor scope ref for the floor-plan health overview. |
rackattack query blast-radius --feed site-01-F1-B
rackattack query cable-path --device R001-d01 --port et-0/0/0
rackattack query thermal --scope floor:site-01/1
rackattack query floor-plan --scope floor:site-01/1