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 rackattack

Every 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.

FlagDefaultMeaning
--seed-examplefalseGenerate 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 empty

mcp#

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 mcp

migrate#

Applies all pending database migrations (idempotent — a fully-migrated database is a no-op). No flags; reads DATABASE_URL.

rackattack migrate

fleet 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.

FlagDefaultMeaning
--preset(none)Named preset (e.g. example); overrides the scale flags.
--sites1Number of sites.
--rows-per-floor4Rows per floor.
--racks-per-row8Racks per row.
--oversub3Network oversubscription ratio.
--redundancyabPower redundancy: ab or none.
--seed1Deterministic seed.
rackattack fleet new --preset example          # the narrative fleet
rackattack fleet new --sites 2 --racks-per-row 12 --seed 7

example run#

Generates a fleet, mines incident scenarios, runs the prompts, and writes a guided-tour gallery (the end-to-end tour behind just example).

FlagDefaultMeaning
--preset(none)Named preset (e.g. example).
--outexample-outOutput directory (writes index.md + artifacts).
--sites1Number of sites.
--rows-per-floor4Rows per floor.
--racks-per-row8Racks per row.
--seed1Deterministic seed.
--llmfalseVary prompt phrasing via the LLM seam (deterministic stand-in by default).
rackattack example run --preset example --out ./tour

query#

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#

FlagDefaultMeaning
--feedsite-01-F1-BFeed code to compute the power blast radius for.

query cable-path#

FlagDefaultMeaning
--deviceR001-d01From device code.
--portet-0/0/0From port name.

query thermal#

FlagDefaultMeaning
--scopefloor:site-01/1Scope ref for the thermal-headroom query.

query floor-plan#

FlagDefaultMeaning
--scopefloor:site-01/1Floor 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