Concepts
CLI Reference
Commands for scaffolding, migrations, and plan sync.
The BirrJS CLI helps you scaffold projects, run database migrations, and sync plans.
Commands
birrjs init
Scaffolds a new BirrJS project with interactive prompts.
npx @birrjs/cli initWhat it does:
- Detects your framework (Next.js, Hono, Express, Astro, SvelteKit, etc. — 13 supported)
- Selects a payment provider (Chapa active, more coming)
- Generates
birrjs.tsconfig file - Generates a route handler for your framework
- Generates
birrjs-client.ts(type-safe client) - Creates plan template files (SaaS Starter, Usage-Based, or Empty)
- Creates
.envwith required environment variables - Installs
@birrjs/coreand@birrjs/chapavia your package manager
Options:
| Flag | Description |
|---|---|
--defaults | Skip prompts, use all defaults |
--force | Overwrite existing files |
--skip-install | Skip package installation |
birrjs status
Check the health of your BirrJS setup.
birrjs statusPass --throw to exit with code 1 on failures, useful for CI pipelines:
birrjs status --throwChecks:
- Configuration file validity
- Database connection
- Pending migrations
- Plan sync status (code vs database diff)
birrjs push
Apply migrations and sync plans to the database.
birrjs pushWhat it does:
- Runs pending database migrations
- Syncs code-first plan definitions to the database (versioned, with SHA-256 change detection)
- Shows a summary of what changed
Plan Templates
The init command offers three plan templates:
| Template | Description |
|---|---|
| SaaS Starter | free (default) + pro ($29/month) |
| Usage Based | Metered features with usage limits |
| Empty | Start from scratch |
Framework Detection
BirrJS detects these frameworks: Next.js, Nuxt, SvelteKit, Solid Start, TanStack Start, Astro, Remix, React Router v7, Hono, Fastify, Express, Elysia, Nitro