> ## Documentation Index
> Fetch the complete documentation index at: https://docs.musterbox.org/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> The musterbox CLI — configuration, session, diagnostics, packaging, and certification.

The CLI is the developer entry point for the SDK: scaffolding, configuration,
session management, transport diagnostics, packaging, and certification.
This page summarizes the command groups; run `musterbox <command> --help` for
the authoritative help of your installed version.

```bash theme={"dark"}
Usage: musterbox <COMMAND>

Commands:
  version         Display SDK version information
  workspace-info  Display workspace crate inventory and status
  config          Configuration management commands
  transport       Transport commands
  protocol        Protocol management commands
  session         Session security commands
  web-socket      WebSocket event plane commands
  pipeline        Outbound pipeline commands
  storage         Storage journal commands
  sdk             SDK introspection commands
  init            Interactive project initialization
  login           Authenticate against the MusterBox backend
  logout          Logout and clear local session
  configure       Configuration management
  validate        Validate configuration file
  doctor          Environment diagnostics
  build           Build native libraries
  package         Package management commands
  testkit         Testkit operations
  diagnostics     Diagnostics commands
  security        Security commands
  certify         Run the production certification suite
```

## Project setup

```bash theme={"dark"}
musterbox init                              # interactive scaffold
musterbox init --non-interactive \
  --project-name my-game \
  --game-id my-arena-game \
  --environment sandbox \
  -o ./musterbox-integration                 # CI-friendly scaffold

musterbox config generate                   # default musterbox.toml
musterbox config validate -f musterbox.toml # fail fast
musterbox validate --strict --json          # CI-friendly validation
musterbox sdk smoke-test                    # full local lifecycle check
```

## Session & auth

```bash theme={"dark"}
musterbox login [--config path]             # interactive backend login
musterbox login --token <TOKEN>             # non-interactive
musterbox session authenticate \
  --game-id my-arena-game \
  --identifier player@example.com \
  --password secret
musterbox session status
musterbox session logout
musterbox logout
```

The session is stored in `~/.musterbox/session.json`.

## Diagnostics

```bash theme={"dark"}
musterbox doctor [--verbose]                # toolchain/workspace/config checks
musterbox transport ping <url> --count 3 --timeout 5
musterbox transport diagnose                # connectivity from config
musterbox web-socket diagnose               # event-plane connectivity
musterbox web-socket resume-simulate
musterbox pipeline status / drain           # outbound queue health
musterbox diagnostics health [--watch]      # health checks
musterbox diagnostics generate              # support bundle
```

## Storage journal

```bash theme={"dark"}
musterbox storage inspect --db ./musterbox.db --json
musterbox storage verify --db ./musterbox.db   # integrity + schema
musterbox storage smoke                        # append→claim→ack→release
musterbox storage recover --db ./musterbox.db  # release stale claims
musterbox storage compact --db ./musterbox.db --dry-run
```

## Packaging & certification

```bash theme={"dark"}
musterbox build --target all --release            # native libs
musterbox package unity                           # → ./dist/musterbox-unity-1.0.0.tgz
musterbox package godot
musterbox security audit --json                   # secrets/licenses/advisories
musterbox security sbom -o target/musterbox-sbom.spdx.json
musterbox testkit run-contracts --suite all --json
musterbox testkit start-headless --port 0
musterbox certify --suite all --matrix --json     # production gate
```

## SDK introspection

```bash theme={"dark"}
musterbox version
musterbox workspace-info
musterbox sdk version          # SDK + protocol + ABI
musterbox sdk abi-version      # ABI 1.2.0
musterbox protocol version     # protocol 1.0
musterbox protocol registry    # registered message kinds
musterbox protocol validate -f msg.json
musterbox protocol canonicalize -f msg.json
musterbox protocol fingerprint -f msg.json
musterbox protocol negotiate -l 1.0 -r 1.0
```

## CI integration

The CLI is CI-friendly: `--json` everywhere that matters, `--strict` for
validation, and a zero-exit certification gate. Wire these three into your
release pipeline:

```bash theme={"dark"}
musterbox validate --strict --json
musterbox security audit --json
musterbox certify --suite all --matrix --json
```
