kbs2 ==== [![CI](https://github.com/woodruffw/kbs2/actions/workflows/ci.yml/badge.svg)](https://github.com/woodruffw/kbs2/actions/workflows/ci.yml) [![Crates.io](https://img.shields.io/crates/v/kbs2)](https://crates.io/crates/kbs2) [![Packaging status](https://repology.org/badge/tiny-repos/kbs2.svg)](https://repology.org/project/kbs2/versions) **Warning! `kbs2` is beta-quality software! Using `kbs2` means accepting that your secrets may be lost or compromised at any time!** `kbs2` is a command line utility for managing *secrets*. Quick links: * [Installation](#installation) * [Quick start guide](#quick-start-guide) * [CLI documentation](#cli-documentation) * [`kbs2 init`](#kbs2-init) * [`kbs2 new`](#kbs2-new) * [`kbs2 list`](#kbs2-list) * [`kbs2 rm`](#kbs2-rm) * [`kbs2 rename`](#kbs2-rename) * [`kbs2 dump`](#kbs2-dump) * [`kbs2 pass`](#kbs2-pass) * [`kbs2 env`](#kbs2-env) * [`kbs2 edit`](#kbs2-edit) * [`kbs2 generate`](#kbs2-generate) * [`kbs2 agent`](#kbs2-agent) * [`kbs2 agent flush`](#kbs2-agent-flush) * [`kbs2 agent unwrap`](#kbs2-agent-unwrap) * [`kbs2 rewrap`](#kbs2-rewrap) * [`kbs2 rekey`](#kbs2-rekey) * [`kbs2 config`](#kbs2-config) * [`kbs2 config dump`](#kbs2-config-dump) * [Configuration](#configuration) * [Generators](#generators) * [Customization](#customization) * [Custom commands](#custom-commands) * [Hooks](#hooks) * [Managing your key and master password](#managing-your-key-and-master-password) * [Why another password manager?](#why-another-password-manager) * [Technical details](#technical-details) * [Hacking](#hacking) * [History](#history) ## Installation ### Packages `kbs2` is available via a variety of official and community-supplied packages. See the matrix below for a list of repositories containing `kbs2`. [![Packaging status](https://repology.org/badge/vertical-allrepos/kbs2.svg)](https://repology.org/project/kbs2/versions) **These packages are the recommended way to install `kbs2` if you are not developing it.** #### Debian/Ubuntu *This is an official package.* If you're running a Debian or Ubuntu distribution on AMD64, you can use the `.deb` packages attached to the [latest release](https://github.com/woodruffw/kbs2/releases/latest). By way of example: ```console $ wget https://github.com/woodruffw/kbs2/releases/download/v0.7.2/kbs2_0.7.2_amd64.deb $ sudo dpkg -i kbs2_0.7.2_amd64.deb # don't forget to request kbs2's dependencies $ sudo apt-get -f install ``` #### Arch Linux *This is a community-maintained package.* `kbs2` can be installed from available [AUR packages](https://aur.archlinux.org/packages/?O=0&SeB=b&K=kbs2&outdated=&SB=n&SO=a&PP=50&do_Search=Go) using an [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers). For example, ```console $ yay -S kbs2 ``` Other distributions will be supported sooner or later. Help us by looking at the [open packaging issues](https://github.com/woodruffw/kbs2/labels/C%3Apackaging)! #### Nix *This is a community-maintained package.* `kbs2` can be installed through Nix: ```console $ nix-env -iA nixpkgs.kbs2 ``` #### Cargo If you're a Linux user, you'll need some X11 libraries. For Debian-based distributions: ```console $ sudo apt install -y libxcb-shape0-dev libxcb-xfixes0-dev ``` `kbs2` itself is most easily installed via `cargo`: ```console $ cargo install kbs2 ``` After installation, `kbs2` is completely ready for use. See the [Configuration](#configuration) section for some *optional* changes that you can make. ## Quick start guide Initialize a new `kbs2` configuration: ```console $ kbs2 init ``` By default, a fresh `kbs2` configuration will store records in `$HOME/.local/share/kbs2`. Users can override this by passing `--store-dir DIR` to `kbs2 init`, or at any point by modifying `store` in the config itself. `kbs2 init` will automatically generate a configuration file and keypair, prompting you for a "master" password. **Note**: By default, most `kbs2` commands will start the authentication agent (`kbs2 agent`) in the background if it isn't already running. Create a new (login) record: ```console $ kbs2 new amazon ? Username? jonf-bonzo ? Password? [hidden] ``` List available records: ```console $ kbs2 list amazon facebook ``` Pull the password from a record: ```console $ kbs2 pass -c amazon # alternatively, pipeline it $ kbs2 pass facebook | pbcopy ``` Remove a record: ```console $ kbs2 rm facebook ``` `kbs2`'s subcommands are substantially more featured than the above examples demonstrate; run each with `--help` to see a full set of supported options. ## CLI documentation ### `kbs2 init` #### Usage ``` initialize kbs2 with a new config and keypair USAGE: kbs2 init [FLAGS] [OPTIONS] FLAGS: -f, --force overwrite the config and keyfile, if already present -h, --help Prints help information --insecure-not-wrapped don't wrap the keypair with a master password OPTIONS: -s, --store-dir the directory to store encrypted kbs2 records in [default: $HOME/.local/share/kbs2] ``` #### Examples Create a new config and keypair, prompting the user for a master password: ```console $ kbs2 init ``` Create a new config and keypair **without** a master password: ```console $ kbs2 init --insecure-not-wrapped ``` Create a new config and keypair in a different location: ```console $ kbs2 -c /some/config/dir init ``` Create a new config keypair in a different location and specify a non-default store: ```console $ kbs2 -c /home/config/dir init --store-dir /some/store/dir ``` ### `kbs2 new` #### Usage ``` create a new record USAGE: kbs2 new [FLAGS] [OPTIONS]