Gathering detailed insights and metrics for @densebrain/completarr
Gathering detailed insights and metrics for @densebrain/completarr
Gathering detailed insights and metrics for @densebrain/completarr
Gathering detailed insights and metrics for @densebrain/completarr
Zero config autocompletions for yargs apps (bash, zsh, fish)
npm install @densebrain/completarr
Typescript
Module System
68.9
Supply Chain
98.3
Quality
75.5
Maintenance
100
Vulnerability
100
License
TypeScript (98.06%)
JavaScript (1.94%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
39 Commits
1 Branches
Updated on Feb 06, 2021
Latest Version
1.0.19
Package Id
@densebrain/completarr@1.0.19
Unpacked Size
20.66 kB
Size
7.22 kB
File Count
25
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
Forked from completarr
and converted to typescript
.
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).
yarn add @densebrain/completarr
To use Completarr, perform the following rather simple steps:
Integrate it into your CLI app:
1import completer from "@densebrain/completarr" 2 3completer() 4 5// 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.ts 2import completer from "@densebrain/completarr" 3 4completer() 5 6 7// 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.ts 2import completer from "@densebrain/completarr" 3 4completer({ 5name: 'hello' 6}) 7 8
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 2import completer from "@densebrain/completarr" 3 4completer({ 5 helpOption: 'info' 6}) 7 8// yargs-related code 9import Yargs from "yargs" 10Yargs.help('info') 11// ...
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
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
Found 0/30 approved changesets -- 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
Reason
14 existing vulnerabilities detected
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