CLI Reference

The package ships two binaries:

  • create-stackr — generate a new monorepo (run via npx).
  • stackr — operate inside an existing project (add services and entities, manage migrations, check for drift).

create-stackr <name>

npx create-stackr@latest my-app

Run with no flags to use the interactive wizard. The flags below shape a non-interactive run:

FlagDescription
--defaultsSkip all prompts; built-in default (Drizzle, auth + admin dashboard, one core service)
--service-name <name>Rename the initial base service (default: core)
--no-authSkip the auth service entirely
--with-services <list>Comma-separated extra base services, e.g. scout,manage
--no-testsSkip the Vitest scaffolding
--ci-workflowGenerate .github/workflows/test.yml
--verboseDetailed generation output
# Non-interactive default config
npx create-stackr@latest my-app --defaults

# Extra services + CI workflow
npx create-stackr@latest my-app --defaults --with-services scout,manage --ci-workflow

# Backend-only, no auth
npx create-stackr@latest my-app --no-auth --service-name api

stackr

Run inside a generated project. It reads and updates stackr.config.json.

stackr add service <name>

Add a new isolated microservice. Staged in a tempdir, dry-run validated, committed atomically. See the guide.

FlagDescription
--auth-middleware <type>standard | role-gated | flexible | none
--webAlso scaffold a Next.js frontend
--mobileAlso scaffold an Expo mobile app
--event-queue / --no-event-queueEnable / disable BullMQ + Redis
--port <n>Explicit REST API port (otherwise auto-allocated above 8080)
--no-installSkip the package-manager install
--no-testsSkip Vitest scaffolding for this service
--forceBypass the pending-migration refusal
--verboseDetailed output

stackr add entity <service> <entity>

Scaffold a domain slice — schema.ts, repository.ts, service.ts — and merge the ORM table, correct by construction. Records a pending migration. See the guide.

npx stackr add entity blog comment

stackr migrations ack <service>

Clear a pending-migration entry from stackr.config.json after you've run the migration by hand. Required after a schema change; other stackr subcommands refuse until it's cleared.

npx stackr migrations ack blog

stackr doctor

Report drift between stackr.config.json and the generated artifacts; exits non-zero on drift (CI-gateable). --fix re-renders to resolve it.

npx stackr doctor
npx stackr doctor --fix

stackr migrate context

Re-render every agent-facing harness artifact from stackr.config.json. Idempotent. --dry-run previews the changes.

npx stackr migrate context
npx stackr migrate context --dry-run

Package managers

npm, yarn, and bun are all first-class. You choose one at init and every generated script branches on it; bun is the recommended default.