File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,21 @@ tab solves this complexity by providing autocompletions that work consistently a
1414
1515## Installation
1616
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:
24+
25+ ``` bash
26+ source <( tab pnpm zsh) # for zsh
27+ source <( tab pnpm bash) # for bash
28+ ```
29+
30+ ### For CLI Library (Adding Completions to Your CLI)
31+
1732``` bash
1833npm install @bomb.sh/tab
1934# or
Original file line number Diff line number Diff line change @@ -64,9 +64,13 @@ async function main() {
6464
6565function generateCompletionScript ( packageManager : string , shell : string ) {
6666 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+
7074 script ( shell as any , name , executable ) ;
7175}
7276
You can’t perform that action at this time.
0 commit comments