# Binaries and operator subcommands

# Binaries and operator subcommands

The crate builds two binaries, and one of them doubles as an operator CLI.

| Binary | Purpose |
| --- | --- |
| `mokosh-server` | Long-running HTTP API (Axum). |
| `mokosh-bootstrap` | One-shot CLI that performs first-run setup of a fresh Infisical instance and writes the resulting Universal Auth credentials into `.env`. |

## Operator subcommands

`mokosh-server` inspects `argv` before binding a port (`src/cli/mod.rs`): when the first token is one of these it runs the task and exits instead of serving.

| Subcommand | Purpose |
| --- | --- |
| `bootstrap-infisical` | First-run setup of a fresh Infisical instance. Driven by `just infisical-bootstrap`; see step 7 of [`quickstart.md`](../quickstart.md). |
| `qa-seed` | Load the QA walkthrough dataset into the tenant named by `--tenant <uuid>` or `MOKOSH_QA_TENANT_ID`. |
| `qa-teardown` | Remove that dataset from the same tenant. |
| `showcase-seed` | Create the richer showcase demo dataset in the tenant named by `--tenant <uuid>` or `MOKOSH_SHOWCASE_TENANT_ID`. |
| `showcase-refresh` | Tear the showcase dataset down and re-seed it in one step. |
| `showcase-teardown` | Remove the showcase dataset. |
| `provider-status` | Render the per-key, per-provider presence matrix: every declared key, per provider, plus which provider is currently serving each. Values are never printed. |
| `provider-set` | Write ONE application-tier secret into the provider the deployment declares, reading the value from the environment variable named by `--from-env` so it never reaches an argument, then read it back and compare. No `--to`: a secret held by a provider the deployment did not declare ends boot. An application-tier secret is read once at boot, so the process needs a restart before the value is served. |
| `provider-migrate` | Copy every key the source provider holds into the target, one key at a time, with a write-then-read-back compare. The source is never cleared. |
| `provider-purge` | Delete every key a named provider holds, but only where the provider is disabled and the key is verified live in the provider serving it now. Dry-run by default. |
| `verify-providers` | Boot every provider seam (configuration, application-tier secrets, tenant-tier secrets, storage, authentication, email) and report whether each capability is live. |

Both seeds are fail-closed and write nothing unless the target tenant is explicitly marked: `settings.is_qa` for `qa-*`, `settings.is_showcase` for `showcase-*`. That is what keeps them off a production tenant. Each needs a privileged `DATABASE_URL`.

`mokosh-bootstrap` dispatches its own overlapping set (`bootstrap-infisical`, `qa-seed`, `qa-teardown`, plus `dev-seed-portal` and `normalize-company-industries`); it has no `showcase-*` subcommands. Run `mokosh-bootstrap` with no arguments for its help text.
