Gathering detailed insights and metrics for completarr
Gathering detailed insights and metrics for completarr
Gathering detailed insights and metrics for completarr
Gathering detailed insights and metrics for completarr
npm install completarr
Typescript
Module System
Node Version
NPM Version
JavaScript (95.23%)
TypeScript (4.77%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
14 Commits
1 Forks
2 Watchers
1 Branches
1 Contributors
Updated on May 16, 2020
Latest Version
0.2.2
Package Id
completarr@0.2.2
Unpacked Size
9.55 kB
Size
4.34 kB
File Count
7
NPM Version
6.9.0
Node Version
12.1.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
1
Completarr is a zero config way to add shell auto completion for your yargs-based CLI applications.
You may want to use this over yargs' built-in solution if you need to support a wider range of shells (including zsh and fish).
npm install --save completarr
To use Completarr, perform the following rather simple steps:
Integrate it into your CLI app:
1require('completarr')() 2 3// Your yargs-related code
Add install/uninstall hooks to your package.json
to automatically attach the completion script the user's shell init file:
1{ 2 "scripts": { 3 "postinstall": "install-yargs-completion", 4 "uninstall": "uninstall-yargs-completion" 5 } 6}
There are some things to consider:
.help()
to make Completarr work.Completarr should work without any config 99% of the time, but there might be some edge cases in your app you want to handle:
By default, Completarr adds completion for all commands it finds in your package.json
's bin
field. If you got more commands there than you want completion for, you need to pass them to the install/uninstall hook explicitely:
1// Your CLI app's package.json 2{ 3 // We got three binaries: 4 "bin": { 5 "a": "./src/a", 6 "b": "./src/b" 7 "c": "./src/c" 8 }, 9 "scripts": { 10 // But we only want to install completions for "b" and "c": 11 "postinstall": "install-yargs-completion b c", 12 "uninstall": "uninstall-yargs-completion b c" 13 } 14}
Completarr needs to know the name of your yargs root command to provide completions. By default it derives that from the binary where Completarr is included:
1// file: src/hello 2require('completarr')() 3 4// Completarr assumes the command name is "hello"
However if for some reason your command name does not equal your file's name, you may pass Completarr the command name manually:
1// file: src/foo.js 2require('completarr')({ 3 name: 'hello' 4})
By default, yargs' option for showing the help output is --help
. However, should you decide to publish the help under a different option (which yargs allows you to do) you'll have to tell Completarr about it:
1// We use --info instead of --help 2require('completarr')({ 3 helpOption: 'info' 4}) 5 6// yargs-related code 7require('yargs') 8 .help('info') 9 // ...
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/14 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More