Skip to content

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|local subcommands for operator-driven onboarding
  • Parse argv flags, validate them, and construct BootstrapOrganizationCommand / BootstrapCloudProjectCommand payloads via @mnemose/domain Zod schemas
  • Delegate planning + execution to @mnemose/bootstrap
  • Persist bootstrap run state to bootstrap_states via @mnemose/db

Key Components

FileRole
src/index.tsArgv parser, subcommand dispatch, plan construction, execute* calls, exit codes

Dependencies

  • @mnemose/bootstrap — plan creation + execution
  • @mnemose/db — createDb for 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