cli — Architecture
The @mnemose/cli package is the mnemose command-line entry point (bin/mnemose). It is a thin orchestrator that translates CLI flags into bootstrap commands and executes them via @mnemose/bootstrap, writing state to Postgres via @mnemose/db.
Responsibilities
- Provide
mnemose bootstrap organization|cloud-project|localsubcommands for operator-driven onboarding - Parse argv flags, validate them, and construct
BootstrapOrganizationCommand/BootstrapCloudProjectCommandpayloads via@mnemose/domainZod schemas - Delegate planning + execution to
@mnemose/bootstrap - Persist bootstrap run state to
bootstrap_statesvia@mnemose/db
Key Components
| File | Role |
|---|---|
src/index.ts | Argv parser, subcommand dispatch, plan construction, execute* calls, exit codes |
Dependencies
@mnemose/bootstrap— plan creation + execution@mnemose/db—createDbfor bootstrap state persistence@mnemose/domain— command Zod schemas + identifier types
Data Flow
operator → mnemose bootstrap <subcommand> --flags ↓ parse argv → command payload (Zod-validated) ↓ createDb() → DbClient ↓ createBootstrap*Plan(command) → plan ↓ execute*Plan(plan, db) → cloud resources provisioned, state persisted ↓ exit code