[PR #5758] feat(CLI): init CLI refactor - inc plugins #14451

Closed
opened 2026-04-13 09:28:51 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5758

State: closed
Merged: No


WIP.

Current progress:

  • script to use types & JSDoc to generate plugin argument options.
    todo:
  • Should start work on CLI interactive UI to select plugins & DB & framework and whatnot.
  • Got to make route.ts framework endpoints file thing
  • Env update / create
  • etc

Summary by cubic

Refactors the init CLI into a modular auth.ts generator with interactive, nested plugin args, and auto-generates CLI plugin configs from plugin JSDoc. Adds database adapters, import utilities, and tests; the init command currently generates and prints the auth config.

  • New Features

    • Automatic plugin config generator (ts-morph + JSDoc @cli tags), wired into the build; generates configs for admin, twoFactor, username, anonymous, phoneNumber, magicLink, emailOTP, passkey, oneTap, siwe, genericOAuth, apiKey, mcp, oidcProvider, organization, sso, bearer, captcha, deviceAuthorization, haveIBeenPwned, lastLoginMethod, multiSession, oauthProxy, openAPI, oneTimeToken, and jwt.
    • Modular database adapter config (prisma, drizzle, kysely, mongodb) with imports, preCode, and code builders; Zod-backed validation for plugin prompts.
    • CLI init scaffold with Clack prompts and flag parsing; utilities for creating/grouping imports and formatting; tests for generator, imports, database, auth config, and plugins.
  • Refactors

    • Legacy init moved to OLD_init; generators import types from OLD_init.
    • Split the previous init logic into focused utility modules and auto-generated plugin configs.

Written for commit 9b15a730e7. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5758 **State:** closed **Merged:** No --- WIP. Current progress: - script to use types & JSDoc to generate plugin argument options. todo: - Should start work on CLI interactive UI to select plugins & DB & framework and whatnot. - Got to make `route.ts` framework endpoints file thing - Env update / create - etc <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Refactors the init CLI into a modular auth.ts generator with interactive, nested plugin args, and auto-generates CLI plugin configs from plugin JSDoc. Adds database adapters, import utilities, and tests; the init command currently generates and prints the auth config. - **New Features** - Automatic plugin config generator (ts-morph + JSDoc @cli tags), wired into the build; generates configs for admin, twoFactor, username, anonymous, phoneNumber, magicLink, emailOTP, passkey, oneTap, siwe, genericOAuth, apiKey, mcp, oidcProvider, organization, sso, bearer, captcha, deviceAuthorization, haveIBeenPwned, lastLoginMethod, multiSession, oauthProxy, openAPI, oneTimeToken, and jwt. - Modular database adapter config (prisma, drizzle, kysely, mongodb) with imports, preCode, and code builders; Zod-backed validation for plugin prompts. - CLI init scaffold with Clack prompts and flag parsing; utilities for creating/grouping imports and formatting; tests for generator, imports, database, auth config, and plugins. - **Refactors** - Legacy init moved to OLD_init; generators import types from OLD_init. - Split the previous init logic into focused utility modules and auto-generated plugin configs. <sup>Written for commit 9b15a730e7ef5e1d08b58d049089c27a2b9bfaa6. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:28:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14451