Files
better-auth/packages/cli
Gustavo Valverde 225976c7d2 chore: main to next conflict resolution
Resolve the main to next sync discrepancies after the v1.6.4 release.

Conflict resolution:
- keep next package versions at 1.7.0-beta.1
- keep both changelog streams by inserting the stable 1.6.4 sections below the 1.7.0-beta entries
- restore the next pre-release accumulator changesets that the stable release deleted on main
2026-04-15 15:40:35 +01:00
..
2026-04-15 13:00:42 +01:00

Better Auth CLI

Better Auth comes with a built-in CLI to help you manage the database schema needed for both core functionality and plugins.

Init

The CLI includes an init command to add Better Auth to your project.

npx auth@latest init

Generate

The generate command creates the schema required by Better Auth. If youre using a database adapter like Prisma or Drizzle, this command will generate the right schema for your ORM. If youre using the built-in Kysely adapter, it will generate an SQL file you can run directly on your database.

npx auth@latest generate

Migrate

The migrate command applies the Better Auth schema directly to your database. This is available if youre using the built-in Kysely adapter. For other adapters, youll need to apply the schema using your ORMs migration tool.

npx auth@latest migrate

Secret

The CLI also provides a way to generate a secret key for your Better Auth instance.

npx auth@latest secret

License

MIT