@bolkauth/cli automates common setup tasks in an existing project.
Run Without Installing
Install command
$ pnpm dlx @bolkauth/cli <command>Or install globally:
Install command
$ pnpm add -g @bolkauth/clibolkauth init
Starts the interactive setup wizard:
Install command
$ pnpm dlx @bolkauth/cli initThe wizard can create:
| File | Purpose |
|---|---|
lib/auth.ts | createBolkAuth configuration. |
app/api/auth/[...bolkauth]/route.ts | Next.js route handler. |
middleware.ts | Route protection. |
.env.example | Required environment variable names. |
bolkauth add
Scaffold adapter-specific setup:
Install command
$ pnpm dlx @bolkauth/cli add drizzleInstall command
$ pnpm dlx @bolkauth/cli add prismaUse the generated files as a starting point and adjust them to your project's database layout.
bolkauth generate
Generate supporting files:
Install command
$ pnpm dlx @bolkauth/cli generate envInstall command
$ pnpm dlx @bolkauth/cli generate typesCommands
| Command | Description |
|---|---|
bolkauth init | Interactive project setup. |
bolkauth add drizzle | Add Drizzle adapter files. |
bolkauth add prisma | Add Prisma adapter files. |
bolkauth generate env | Create an .env.example. |
bolkauth generate types | Create TypeScript declaration scaffolding. |
bolkauth --help | Print CLI help. |
bolkauth --version | Print the installed version. |
After Running the CLI
- Install any new dependencies.
- Fill in
.env.local. - Run database migrations.
- Start the Next.js app and test sign-up, sign-in, sign-out, and middleware redirects.