[READ-ONLY] Mirror of https://github.com/bombshell-dev/tab. shell autocompletions for javascript CLIs
4

Configure Feed

Select the types of activity you want to include in your feed.

fix(cli): use the globally installed version for shell script generation (#84)

* global install tab

* readme

* changeset

authored by

AmirHossein Sakhravi and committed by
GitHub
(Nov 3, 2025, 5:59 PM +0330) d6cdbe44 5d9340d4

+34 -3
+5
.changeset/lemon-crabs-bathe.md
··· 1 + --- 2 + '@bomb.sh/tab': patch 3 + --- 4 + 5 + fix(cli): use the globally installed version for shell completions
+22
README.md
··· 14 14 15 15 ## Installation 16 16 17 + ### For Package Manager Completions (Global install is recommended) 18 + 19 + ```bash 20 + npm install -g @bomb.sh/tab 21 + ``` 22 + 23 + Then enable completions permanently: 24 + 25 + ```bash 26 + # For zsh 27 + echo 'source <(tab pnpm zsh)' >> ~/.zshrc 28 + source ~/.zshrc 29 + 30 + # For bash 31 + echo 'source <(tab pnpm bash)' >> ~/.bashrc 32 + source ~/.bashrc 33 + 34 + # The same can be done for other shells! 35 + ``` 36 + 37 + ### For CLI Library (Adding Completions to Your CLI) 38 + 17 39 ```bash 18 40 npm install @bomb.sh/tab 19 41 # or
+7 -3
bin/cli.ts
··· 64 64 65 65 function generateCompletionScript(packageManager: string, shell: string) { 66 66 const name = packageManager; 67 - const executable = process.env.npm_config_user_agent 68 - ? `npx --yes @bomb.sh/tab ${packageManager}` 69 - : `node ${process.argv[1]} ${packageManager}`; 67 + 68 + const isLocalDev = process.argv[1].endsWith('dist/bin/cli.js'); 69 + 70 + const executable = isLocalDev 71 + ? `node ${process.argv[1]} ${packageManager}` 72 + : `tab ${packageManager}`; 73 + 70 74 script(shell as any, name, executable); 71 75 } 72 76