doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
620 stars 83 forks source link

Shell autocompletion #18

Closed albakham closed 3 years ago

albakham commented 4 years ago

It's indirectly related to rbw, but it would be really good to have autocompletion in the most used shells, at least bash and zsh.

If someone is motivated/interested in doing this, please do so. It really is a must have in my opinion, and I unfortunately don't have (yet) the skills needed to implement this in these respective programs.

xPMo commented 3 years ago

I'm going to dig into Zsh completion. EDIT: Will publish to this gist while I'm building it.

img

Initial completion done, I parse the output of rbw --help which should help make sure completion stays current with any new commands or aliases. The _tmux implementation is a big help here.

hoshsadiq commented 3 years ago

Probably better/easier to generate it using the used built in library (see example). Though this seems to only support bash, and zsh can also run bash completions.

xPMo commented 3 years ago

Oh, cool. Clap also supports Zsh completions.

doy commented 3 years ago

i've implemented this as part of version 1.2.0 (and the debian and arch packages now also ship with completion files)