14 releases (8 breaking)

0.8.0 Jan 24, 2024
0.7.0 Dec 3, 2023
0.6.0 Nov 18, 2023

#461 in Command line utilities

Download history 12/week @ 2023-11-06 39/week @ 2023-11-13 40/week @ 2023-11-20 60/week @ 2023-11-27 23/week @ 2023-12-04 14/week @ 2023-12-11 1/week @ 2023-12-18 28/week @ 2023-12-25 14/week @ 2024-01-01 2/week @ 2024-01-08 32/week @ 2024-01-22 30/week @ 2024-01-29 5/week @ 2024-02-05 65/week @ 2024-02-12 370/week @ 2024-02-19

470 downloads per month

MIT license

51KB
1.5K SLoC

Keepass CLI

Crates.io

A secure hole for your passwords (Keepass CLI)

Features

  • MacOS, Linux
  • master password is stored in OS's keyring

Install

Download

cargo install kdbx
curl -fsSL https://raw.githubusercontent.com/daxartio/kdbx/master/install.sh | sh -s

Please take a backup of your database before updating the application.

Usage

Examples

Display selector and then print entry's info:

kdbx show

Copy password/totp if only single entry found otherwise display selector:

kdbx pwd /root/emails/gmail
kdbx totp /root/emails/gmail

Print password/totp to STDOUT:

kdbx pwd github.com | cat
kdbx totp github.com | cat

Read password from STDIN:

cat /mnt/usb/key | kdbx pwd

Generate shell completions:

kdbx completion --shell=zsh > /usr/local/share/zsh/site-functions/_kdbx
kdbx completion --shell=fish > ~/.config/fish/completions/kdbx.fish

commands

A secure hole for your passwords (Keepass CLI)

Usage: kdbx <COMMAND>

Commands:
  pwd         Copy password and clear clipboard after specified amount of time
  totp        Copy totp
  show        Display entry's info
  add         Add new entry
  init        Init new database
  list        List all entries
  completion  Outputs the completion file for given shell
  help        Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

pwd

Copy password and clear clipboard after specified amount of time

Usage: kdbx pwd [OPTIONS] --database <DATABASE> [ENTRY]

Arguments:
  [ENTRY]

Options:
  -t, --timeout <TIMEOUT>    Timeout in seconds before clearing the clipboard. 0 means no clean-up [default: 15]
  -G, --no-group             Show entries without group(s)
  -n, --no-interaction       Do not ask any interactive question
  -v, --preview              Preview entry during picking
  -f, --full-screen          Use all available screen for picker
  -p, --use-keyring          Store password for the database in the OS's keyring
  -P, --remove-key           Remove database's password from OS's keyring and exit
  -d, --database <DATABASE>  KDBX file path [env: KDBX_DATABASE=]
  -k, --key-file <KEY_FILE>  Path to the key file unlocking the database [env: KDBX_KEY_FILE=]
  -h, --help                 Print help

totp

Copy totp

Usage: kdbx totp [OPTIONS] --database <DATABASE> [ENTRY]

Arguments:
  [ENTRY]

Options:
  -G, --no-group             Show entries without group(s)
  -n, --no-interaction       Do not ask any interactive question
  -v, --preview              Preview entry during picking
      --raw                  Show the secret instead of code
  -f, --full-screen          Use all available screen for picker
  -p, --use-keyring          Store password for the database in the OS's keyring
  -P, --remove-key           Remove database's password from OS's keyring and exit
  -d, --database <DATABASE>  KDBX file path [env: KDBX_DATABASE=]
  -k, --key-file <KEY_FILE>  Path to the key file unlocking the database [env: KDBX_KEY_FILE=]
  -h, --help                 Print help

show

Display entry's info

Usage: kdbx show [OPTIONS] --database <DATABASE> [ENTRY]

Arguments:
  [ENTRY]

Options:
  -G, --no-group             Show entries without group(s)
  -n, --no-interaction       Do not ask any interactive question
  -v, --preview              Preview entry during picking
  -f, --full-screen          Use all available screen for picker
  -p, --use-keyring          Store password for the database in the OS's keyring
  -P, --remove-key           Remove database's password from OS's keyring and exit
  -d, --database <DATABASE>  KDBX file path [env: KDBX_DATABASE=]
  -k, --key-file <KEY_FILE>  Path to the key file unlocking the database [env: KDBX_KEY_FILE=]
  -h, --help                 Print help

add

Add new entry

Usage: kdbx add [OPTIONS] --database <DATABASE>

Options:
  -p, --use-keyring          Store password for the database in the OS's keyring
  -P, --remove-key           Remove database's password from OS's keyring and exit
  -d, --database <DATABASE>  KDBX file path [env: KDBX_DATABASE=]
  -k, --key-file <KEY_FILE>  Path to the key file unlocking the database [env: KDBX_KEY_FILE=]
  -h, --help                 Print help

init

Init new database

Usage: kdbx init [OPTIONS] --database <DATABASE>

Options:
  -d, --database <DATABASE>  KDBX file path [env: KDBX_DATABASE=]
  -k, --key-file <KEY_FILE>  Path to the key file unlocking the database [env: KDBX_KEY_FILE=]
  -h, --help                 Print help

list

List all entries

Usage: kdbx list [OPTIONS] --database <DATABASE>

Options:
  -G, --no-group             Show entries without group(s)
  -p, --use-keyring          Store password for the database in the OS's keyring
  -P, --remove-key           Remove database's password from OS's keyring and exit
  -d, --database <DATABASE>  KDBX file path [env: KDBX_DATABASE=]
  -k, --key-file <KEY_FILE>  Path to the key file unlocking the database [env: KDBX_KEY_FILE=]
  -h, --help                 Print help

completion

Outputs the completion file for given shell

Usage: kdbx completion --shell <SHELL>

Options:
  -s, --shell <SHELL>  [possible values: bash, elvish, fish, powershell, zsh]
  -h, --help           Print help

License

MIT

Dependencies

~15–30MB
~476K SLoC