⚡ BolkAuth

@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/cli
bolkauth <command>

bolkauth init

Starts the interactive setup wizard:

Install command
$ pnpm dlx @bolkauth/cli init

The wizard can create:

FilePurpose
lib/auth.tscreateBolkAuth configuration.
app/api/auth/[...bolkauth]/route.tsNext.js route handler.
middleware.tsRoute protection.
.env.exampleRequired environment variable names.

bolkauth add

Scaffold adapter-specific setup:

Install command
$ pnpm dlx @bolkauth/cli add drizzle
Install command
$ pnpm dlx @bolkauth/cli add prisma

Use 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 env
Install command
$ pnpm dlx @bolkauth/cli generate types

Commands

CommandDescription
bolkauth initInteractive project setup.
bolkauth add drizzleAdd Drizzle adapter files.
bolkauth add prismaAdd Prisma adapter files.
bolkauth generate envCreate an .env.example.
bolkauth generate typesCreate TypeScript declaration scaffolding.
bolkauth --helpPrint CLI help.
bolkauth --versionPrint the installed version.

After Running the CLI

  1. Install any new dependencies.
  2. Fill in .env.local.
  3. Run database migrations.
  4. Start the Next.js app and test sign-up, sign-in, sign-out, and middleware redirects.

On this page