1
0
mirror of https://github.com/bitwarden/help synced 2025-12-06 00:03:30 +00:00

Add CLI shell completion documentation (#112)

* Add CLI shell completion documentation

* Update cli.md

Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
This commit is contained in:
Munif Tanjim
2020-05-26 20:07:15 +06:00
committed by GitHub
parent ab62bcfe02
commit f13f49ebbf

View File

@@ -45,6 +45,8 @@ Bitwarden provides a powerful, full-featured command-line interface (CLI) tool t
- [Version](#version)
- [Working with JSON](#working-with-json)
- [Self-signed Certificates](#self-signed-certificates)
- [Shell Completion](#shell-completion)
- [ZSH](#zsh)
- [Source Code](#source-code)
- [Appendix](#appendix)
- [Templates](#templates)
@@ -427,6 +429,40 @@ If your self-hosted Bitwarden server exposes as self-signed TLS certificate, spe
$env:NODE_EXTRA_CA_CERTS="absolute/path/to/your/certificates.pem"
## Shell Completion
Bitwarded CLI comes with support for shell completion. It can generate shell completion scripts that you can use to enable completion for `bw` in your shell.
### ZSH
You can enable `bw` completion for ZSH using various methods. A few of them are mentioned below:
**vanilla (.zshrc)**:
Add the following line in your `.zshrc` file:
```
eval "$(bw completion --shell zsh); compdef _bw bw;"
```
**vanilla (vendor-completions)**:
Run the following command:
```
bw completion --shell zsh | sudo tee /usr/share/zsh/vendor-completions/_bw
```
[**zinit**](https://github.com/zdharma/zinit):
Run the following commands:
```
bw completion --shell zsh > ~/.local/share/zsh/completions/_bw
zinit creinstall ~/.local/share/zsh/completions
```
## Source Code
As with everything here at Bitwarden, the CLI is fully open source and hosted on GitHub at <https://github.com/bitwarden/cli>.