Specify a proper name for CLI entry #2406

Closed
opened 2026-03-13 09:50:55 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @cometkim on GitHub (Nov 27, 2025).

Is this suited for github?

  • Yes, this is suited for github

I prefer to pre-install @better-auth/cli as a dev dependency rather than using npx or yarn dlx.

However, @better-auth/cli is installed as cli (node_modules/.bin/cli), which is a confusing name and might conflict with others.

Describe the solution you'd like

-  "bin": "./dist/index.mjs",
+  "bin": {
+    "better-auth": "./dist/index.mjs"
+  },

This change allows executing yarn better-auth ... with the pre-installed dev dependencies and still allows using npx or yarn dlx, since it has a single entry.

Describe alternatives you've considered

None.

I'm currently using yarn dlx @better-auth/cli for it. But it's slower because it needs to check the version and cache for every execution.

Additional context

No response

Originally created by @cometkim on GitHub (Nov 27, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I prefer to pre-install `@better-auth/cli` as a dev dependency rather than using `npx` or `yarn dlx`. However, `@better-auth/cli` is installed as `cli` (`node_modules/.bin/cli`), which is a confusing name and might conflict with others. ### Describe the solution you'd like ```diff - "bin": "./dist/index.mjs", + "bin": { + "better-auth": "./dist/index.mjs" + }, ``` This change allows executing `yarn better-auth ...` with the pre-installed dev dependencies and still allows using `npx` or `yarn dlx`, since it has a single entry. ### Describe alternatives you've considered None. I'm currently using `yarn dlx @better-auth/cli` for it. But it's slower because it needs to check the version and cache for every execution. ### Additional context _No response_
GiteaMirror added the enhancement label 2026-03-13 09:50:55 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 27, 2025):

(tag @better-auth-agent if you would like an answer from the Agent)

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Nov 27, 2025): (tag @better-auth-agent if you would like an answer from the Agent) <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@Ridhim-RR commented on GitHub (Nov 27, 2025):

@better-auth-agent could to look into this

@Ridhim-RR commented on GitHub (Nov 27, 2025): @better-auth-agent could to look into this
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 27, 2025):

Thanks for your suggestion! We understand that having the CLI installed as simply "cli" can lead to confusion and possible conflicts, especially when pre-installing it as a dev dependency. Your proposed change to use a bin object to expose the command as "better-auth" is clear and would allow users to execute commands with "yarn better-auth ..." as well as using npx or yarn dlx without extra overhead [1].

We’re going to review this request and consider how it fits into our roadmap for improving the CLI experience. In the meantime, could you share any other CLI usability improvements you’d like to see?

tag @better-auth-agent if you would like an answer from the Agent

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Nov 27, 2025): Thanks for your suggestion! We understand that having the CLI installed as simply "cli" can lead to confusion and possible conflicts, especially when pre-installing it as a dev dependency. Your proposed change to use a bin object to expose the command as "better-auth" is clear and would allow users to execute commands with "yarn better-auth ..." as well as using npx or yarn dlx without extra overhead [[1]](https://www.better-auth.com/docs/reference/contributing). We’re going to review this request and consider how it fits into our roadmap for improving the CLI experience. In the meantime, could you share any other CLI usability improvements you’d like to see? tag @better-auth-agent if you would like an answer from the Agent <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2406