Files
better-auth/packages/cli
Maxwell 9d3d1d4c61 fix: array field handling across adapters and schema generation (#6601)
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-12-08 15:50:52 -08:00
..
2025-12-01 10:33:38 -08:00
2025-11-29 09:18:23 -08: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 @better-auth/cli@latest init

Generate

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

npx @better-auth/cli@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, you'll need to apply the schema using your ORM's migration tool.

npx @better-auth/cli@latest migrate

Secret

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

npx @better-auth/cli@latest secret

License

MIT