CLI Reference
The package ships two binaries:
create-stackr— generate a new monorepo (run vianpx).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:
| Flag | Description |
|---|---|
| --defaults | Skip all prompts; built-in default (Drizzle, auth + admin dashboard, one core service) |
| --service-name <name> | Rename the initial base service (default: core) |
| --no-auth | Skip the auth service entirely |
| --with-services <list> | Comma-separated extra base services, e.g. scout,manage |
| --no-tests | Skip the Vitest scaffolding |
| --ci-workflow | Generate .github/workflows/test.yml |
| --verbose | Detailed 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 apistackr
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.
| Flag | Description |
|---|---|
| --auth-middleware <type> | standard | role-gated | flexible | none |
| --web | Also scaffold a Next.js frontend |
| --mobile | Also scaffold an Expo mobile app |
| --event-queue / --no-event-queue | Enable / disable BullMQ + Redis |
| --port <n> | Explicit REST API port (otherwise auto-allocated above 8080) |
| --no-install | Skip the package-manager install |
| --no-tests | Skip Vitest scaffolding for this service |
| --force | Bypass the pending-migration refusal |
| --verbose | Detailed 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 commentstackr 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 blogstackr 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 --fixstackr 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-runPackage 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.