auto
is a CLI tool that wraps npm, yarn, pnpm, bun, and other package managers to automatically detect the package manager and forward commands. It simplifies working with multiple JavaScript and TypeScript package managers by detecting the appropriate one based on the project files.
- Automatically detects the package manager based on lock or configuration files.
- Forwards commands and arguments to the detected package manager.
- Supports npm, yarn, pnpm, bun, Deno, jspm, and Rome.
- Clone the repository:
git clone https://github.com/doomedramen/auto cd auto
- Build the binary:
go build -o auto
- Add the binary to your PATH:
export PATH="$PATH:$(pwd)"
Run auto
followed by the desired command. For example:
auto install
auto add lodash
auto run build
auto
detects the package manager by checking for the following files in the current directory:
yarn.lock
→ yarnpackage-lock.json
→ npmpnpm-lock.yaml
→ pnpmbun.lockb
orbun.lock
→ bundeno.json
ordeno.jsonc
→ Denojspm.config.js
→ jspmrome.json
→ Rome
It then forwards the command and arguments to the detected package manager. For commands like x
, it automatically appends the appropriate prefix (npx
, pnpx
, or bunx
) based on the detected package manager.
- Standard Commands: Any command supported by the detected package manager (e.g.,
install
,add
,run
). - Binary Execution: Use
auto x <binary>
to execute binaries (e.g.,auto x create-react-app
). This works withnpx
,pnpx
, andbunx
depending on the package manager.
If you encounter the following warning when running the auto
binary on macOS:
"Apple could not verify 'auto' is free of malware that may harm your Mac or compromise your privacy."
-
Locate the Application:
- Open Finder and navigate to the directory containing the
auto
binary (e.g.,release/darwin-amd64/auto
).
- Open Finder and navigate to the directory containing the
-
Manually Allow the App:
- Right-click (or Control-click) on the
auto
binary and select Open. - A dialog will appear asking if you want to open the app. Click Open.
- Right-click (or Control-click) on the
-
Disable Gatekeeper Temporarily (Optional):
- If you want to disable Gatekeeper for testing purposes, you can run the following command in the terminal:
sudo spctl --master-disable
- After testing, re-enable Gatekeeper with:
sudo spctl --master-enable
- If you want to disable Gatekeeper for testing purposes, you can run the following command in the terminal:
-
Code Signing (Long-Term Solution):
- To avoid this issue in the future, you can sign the binary with an Apple Developer ID.
This project is licensed under the MIT License.