[PR #6381] [CLOSED] feat(cli): use "better-auth" as CLI bin name #6627

Closed
opened 2026-03-13 13:06:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6381
Author: @yoshifumi-kondo
Created: 11/28/2025
Status: Closed

Base: canaryHead: feat/cli-bin-name


📝 Commits (10+)

📊 Changes

112 files changed (+4577 additions, -1582 deletions)

View changed files

📝 .github/workflows/adapter-tests.yml (+1 -1)
📝 .github/workflows/ci.yml (+1 -1)
📝 demo/nextjs/.env.example (+2 -1)
📝 demo/nextjs/components/sign-in.tsx (+22 -0)
📝 demo/nextjs/lib/auth.ts (+4 -0)
📝 demo/nextjs/tsconfig.json (+1 -0)
📝 demo/nextjs/turbo.json (+3 -1)
📝 docs/app/blog/[[...slug]]/page.tsx (+9 -4)
📝 docs/app/changelogs/[[...slug]]/page.tsx (+7 -4)
📝 docs/app/community/_components/header.tsx (+3 -2)
📝 docs/app/community/_components/stats.tsx (+27 -1)
📝 docs/app/community/page.tsx (+39 -2)
📝 docs/app/global.css (+1 -0)
📝 docs/components/builder/social-provider.tsx (+15 -0)
docs/components/contributors.tsx (+34 -0)
📝 docs/components/floating-ai-search.tsx (+19 -0)
📝 docs/components/mobile-search-icon.tsx (+1 -1)
📝 docs/components/nav-bar.tsx (+1 -1)
📝 docs/components/nav-mobile.tsx (+2 -2)
📝 docs/components/sidebar-content.tsx (+186 -180)

...and 80 more files

📄 Description

Summary

  • Change the bin entry in @better-auth/cli package from a string to an object
  • Exposes the CLI as better-auth instead of generic cli name
  • Allows users to run yarn better-auth or pnpm better-auth when installed as dev dependency

Changes

  • packages/cli/package.json: Updated bin field format
  • packages/cli/test/utils.ts: Updated test utility to handle both string and object bin formats

Test plan

  • pnpm format - passed
  • pnpm lint - passed
  • pnpm --filter @better-auth/cli test - 60 tests passed

Closes #6353


Summary by cubic

Expose the CLI as the better-auth command by changing the bin to an object and updating related utilities. Also improved CLI config discovery and Prisma schema generation.

  • Refactors

    • Switched packages/cli package.json bin from a string to { "better-auth": "./dist/index.mjs" }.
    • Updated CLI test utils to read both string and object bin formats.
    • Enhanced get-config to search more paths (e.g., server/auth, auth).
    • Prevented duplicate index creation in Prisma schema generator.
    • Fixed docs to use npx @better-auth/cli@latest generate.
  • Migration

    • Replace any usage of cli with better-auth (e.g., better-auth generate).
    • For one-off runs, use npx @better-auth/cli@latest.
    • For local dev dependency, run pnpm better-auth or yarn better-auth.

Written for commit 67c26e26b2. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6381 **Author:** [@yoshifumi-kondo](https://github.com/yoshifumi-kondo) **Created:** 11/28/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat/cli-bin-name` --- ### 📝 Commits (10+) - [`bff00f6`](https://github.com/better-auth/better-auth/commit/bff00f6b7fb3d95363888186cd610ea3e4e0f174) chore: release v1.4.0 - [`e2c474f`](https://github.com/better-auth/better-auth/commit/e2c474f58cb803b36765200bf59d7743cc205d59) chore: update 1.4 og image - [`555e092`](https://github.com/better-auth/better-auth/commit/555e09235839dbe1f243ccbfeeaed1d0f6e6b7cc) commit - [`a1f05b1`](https://github.com/better-auth/better-auth/commit/a1f05b16894b4a8868ce3c8d3d39f25df6c6e47f) chore: lint - [`2f3577c`](https://github.com/better-auth/better-auth/commit/2f3577c55600b525727d64b54b7cf13cbd0bc9a7) docs: fix responsivness for changelog images - [`29564df`](https://github.com/better-auth/better-auth/commit/29564df59f89c1bc7c0aa43b82f8de5d40406480) chore: fix typo - [`9e2b5ce`](https://github.com/better-auth/better-auth/commit/9e2b5ce6322e3a36d6a191772fa47389027f5b4e) chore: fix typo - [`44308bf`](https://github.com/better-auth/better-auth/commit/44308bf20d431bd943a92a2ed4204a6b7d5a4182) feat(api-key): support secondary storage (#6014) - [`69c756a`](https://github.com/better-auth/better-auth/commit/69c756a4101edf805e82f0cd5841a9dbb594c750) chore(docs): fix invalid 1.4 blog links (#6191) - [`6aca409`](https://github.com/better-auth/better-auth/commit/6aca4094280322f7dff2057d1993c38470c3b124) fix(jwt): retrieve latest keys from storage properly (#6208) ### 📊 Changes **112 files changed** (+4577 additions, -1582 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/adapter-tests.yml` (+1 -1) 📝 `.github/workflows/ci.yml` (+1 -1) 📝 `demo/nextjs/.env.example` (+2 -1) 📝 `demo/nextjs/components/sign-in.tsx` (+22 -0) 📝 `demo/nextjs/lib/auth.ts` (+4 -0) 📝 `demo/nextjs/tsconfig.json` (+1 -0) 📝 `demo/nextjs/turbo.json` (+3 -1) 📝 `docs/app/blog/[[...slug]]/page.tsx` (+9 -4) 📝 `docs/app/changelogs/[[...slug]]/page.tsx` (+7 -4) 📝 `docs/app/community/_components/header.tsx` (+3 -2) 📝 `docs/app/community/_components/stats.tsx` (+27 -1) 📝 `docs/app/community/page.tsx` (+39 -2) 📝 `docs/app/global.css` (+1 -0) 📝 `docs/components/builder/social-provider.tsx` (+15 -0) ➕ `docs/components/contributors.tsx` (+34 -0) 📝 `docs/components/floating-ai-search.tsx` (+19 -0) 📝 `docs/components/mobile-search-icon.tsx` (+1 -1) 📝 `docs/components/nav-bar.tsx` (+1 -1) 📝 `docs/components/nav-mobile.tsx` (+2 -2) 📝 `docs/components/sidebar-content.tsx` (+186 -180) _...and 80 more files_ </details> ### 📄 Description ## Summary - Change the `bin` entry in `@better-auth/cli` package from a string to an object - Exposes the CLI as `better-auth` instead of generic `cli` name - Allows users to run `yarn better-auth` or `pnpm better-auth` when installed as dev dependency ## Changes - `packages/cli/package.json`: Updated `bin` field format - `packages/cli/test/utils.ts`: Updated test utility to handle both string and object bin formats ## Test plan - [x] `pnpm format` - passed - [x] `pnpm lint` - passed - [x] `pnpm --filter @better-auth/cli test` - 60 tests passed Closes #6353 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Expose the CLI as the better-auth command by changing the bin to an object and updating related utilities. Also improved CLI config discovery and Prisma schema generation. - **Refactors** - Switched packages/cli package.json bin from a string to { "better-auth": "./dist/index.mjs" }. - Updated CLI test utils to read both string and object bin formats. - Enhanced get-config to search more paths (e.g., server/auth, auth). - Prevented duplicate index creation in Prisma schema generator. - Fixed docs to use npx @better-auth/cli@latest generate. - **Migration** - Replace any usage of cli with better-auth (e.g., better-auth generate). - For one-off runs, use npx @better-auth/cli@latest. - For local dev dependency, run pnpm better-auth or yarn better-auth. <sup>Written for commit 67c26e26b2f9bdebb3bc2272365cba423d058350. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:06:01 -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#6627