@bolkauth/cli
v0.1.2
Published
Interactive CLI setup wizard for BolkAuth
Readme
@bolkauth/cli
Interactive CLI setup wizard, schema generator, and helper tool for the BolkAuth ecosystem.
Features
- 🪄 Interactive Setup Wizard: Rapidly initialize BolkAuth configuration and automatic dependency installation.
- 🗄️ Schema Generation: Add Drizzle ORM or Prisma models to your project with a single command.
- ⚙️ Env & Types Generators: Scaffolds
.env.exampletemplates and custom TypeScript type definitions. - 📦 Package Manager Detection: Automatic detection and installation via
npm,pnpm,yarn, orbun. - 🤖 CI/CD Integration: Streamlined commands suitable for build pipelines and automated repository initialization.
Installation & Usage
You can run bolkauth directly using npx, pnpm dlx, or bunx:
npx @bolkauth/cli <command>
# or globally
npm install -g @bolkauth/cli
bolkauth <command>Commands Reference
1. bolkauth init
Runs an interactive step-by-step setup wizard that prompts for your database adapter, authentication features, and onboarding preference.
npx bolkauth initWhat init does:
- Prompts for Database Adapter (
Drizzle ORMorPrisma). - Selects active Auth Features (
Password Auth,Magic Links,OAuth). - Prompts for onboarding flow preference.
- Generates standard configuration file at
lib/auth.ts. - Auto-detects package manager (
pnpm,npm,yarn,bun) and installs@bolkauth/coreand the appropriate adapter package.
2. bolkauth add <adapter>
Generates database schema definitions for your project.
# Add Drizzle schema to db/schema.ts
npx bolkauth add drizzle
# Add Prisma schema models to prisma/schema.prisma
npx bolkauth add prismaOutputs:
drizzle: Createsdb/schema.tswith PostgreSQL table definitions (users).prisma: Appends or createsprisma/schema.prismawithUsermodel definitions.
3. bolkauth generate <target>
Generates boilerplate files such as environment templates and TypeScript definitions.
# Generate .env.example
npx bolkauth generate env
# Generate TypeScript declarations at types/bolkauth.d.ts
npx bolkauth generate typesTargets:
env: Creates.env.examplepopulated withBOLKAUTH_SECRET,DATABASE_URL, and OAuth credentials placeholders.types: Generatestypes/bolkauth.d.tscontaining core TypeScript interface stubs.
4. bolkauth status
Verifies that @bolkauth/cli is correctly configured and operational.
npx bolkauth statusCI/CD & Automated Setup
In CI/CD automation pipelines (e.g. GitHub Actions, Docker builds), you can invoke specific non-interactive sub-commands directly to generate environment templates or type files automatically during build steps.
Example GitHub Actions Workflow Step:
name: Generate Auth Environment Template
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npx @bolkauth/cli generate env
- run: npx @bolkauth/cli generate typesCommand Overview Table
| Command | Arguments | Description |
| :--- | :--- | :--- |
| bolkauth init | None | Interactive configuration & package installation wizard. |
| bolkauth add | drizzle | prisma | Scaffolds database schemas for Drizzle or Prisma. |
| bolkauth generate | env | types | Generates .env.example or TypeScript definition files. |
| bolkauth status | None | Checks CLI availability and system status. |
License
MIT © BolkAuth
