@doomedramen/auto
is a CLI tool that automatically detects the package manager (npm, yarn, pnpm, bun, deno) in your project and runs commands accordingly. This allows you to use a consistent command (auto
) across different projects without worrying about which package manager is in use.
- Automatically detects npm, yarn, pnpm, bun, and deno.
- Seamlessly runs package manager commands.
- Supports executing packages with
auto x <package>
(equivalent tonpx
,yarn dlx
,pnpm dlx
,bun x
,deno run -A
).
Install @doomedramen/auto
globally to use the auto
command in any project:
npm install -g @doomedramen/auto
You can also install @doomedramen/auto
as a dev dependency in a specific project:
npm install --save-dev @doomedramen/auto
Then you can run it via npx auto ...
or by adding it to your package.json
scripts.
Once installed globally, you can use the auto
command in any project directory that uses a supported package manager.
auto install
: Installs project dependencies (e.g., runsnpm install
,yarn install
, etc.).auto add <package>
: Adds a new package (e.g., runsnpm install <package>
,yarn add <package>
, etc.).auto remove <package>
: Removes a package (e.g., runsnpm uninstall <package>
,yarn remove <package>
, etc.).auto run <script>
: Runs a script defined in yourpackage.json
(e.g., runsnpm run <script>
,yarn <script>
, etc.).
The auto x
command allows you to execute packages without installing them globally, similar to npx
, yarn dlx
, pnpm dlx
, bun x
, or deno run -A
.
auto x create-react-app my-app
auto x cowsay "Hello World"
Arguments are passed through to the underlying package manager command:
auto add typescript --dev
auto run build --watch
@doomedramen/auto
detects the package manager by looking for specific lock files or configuration files in the current directory and its parent directories:
yarn.lock
for Yarnpackage-lock.json
for npmpnpm-lock.yaml
for pnpmbun.lockb
orbun.lock
for Bundeno.json
ordeno.jsonc
for Deno
If no lock file is found, it will throw an error.
- npm
- Yarn
- pnpm
- Bun
- Deno
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have suggestions or find a bug.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.