small terminal browser for KeePassXC databases
Find a file
2026-08-18 17:54:00 +03:00
src Add username generation 2026-08-18 17:54:00 +03:00
.gitignore Add KeePassXC-Browser integration with kpcli as native messaging host 2026-08-05 06:14:36 +03:00
Cargo.lock Harden CLI security boundaries 2026-08-07 14:57:17 +03:00
Cargo.toml Harden CLI security boundaries 2026-08-07 14:57:17 +03:00
README.md Add username generation 2026-08-18 17:54:00 +03:00

kpcli

A small terminal browser for KeePassXC databases.

It opens KeePass databases directly in Rust, so you can search entries, inspect or edit them, copy credentials or TOTP codes, and lock the database without leaving the terminal. It can also serve and save logins for the KeePassXC-Browser extension.

Requirements

  • macOS
  • Rust toolchain

Install

cargo install --path .

Usage

Pass a database directly:

kpcli --database ~/Passwords.kdbx

Or set a default database:

export KEEPASS_DB=~/Passwords.kdbx
kpcli

The database password is requested interactively.

Options

-d, --database PATH       KeePassXC database; overrides KEEPASS_DB
--lock-timeout SECONDS    Lock after inactivity; default 300, 0 disables

KEEPASS_LOCK_TIMEOUT sets the default lock timeout.

Keys

Key Action
/ , j / k Select an entry
gg / G Jump to first / last entry
Enter Show the selected entry
n Create a new entry
e Edit the selected entry
d Delete the selected entry (confirm)
/ Search
p / u / t Copy password / username / TOTP
Ctrl+G Open the password generator
r Reload entries
l Lock the database
q Quit

In the editor, use Tab or / to change fields, Ctrl+G to generate and insert a password, username, or both, Ctrl+S to save, and Esc to cancel. In the generator, use m to switch between password, username, and bundle modes, / to set the length, l/u/d/s to toggle character sets, r to regenerate, and Enter to insert into the editor or copy standalone (bundle mode copies username:password). Copied values are cleared from the clipboard after 10 seconds.

Browser integration

kpcli can serve logins and TOTP codes to the KeePassXC-Browser extension while the terminal app is running and unlocked.

kpcli browser-install

Restart the browser, then connect the extension when prompted. The first association displays an approval request in the kpcli terminal; press y only for a connection you initiated. To restore the original KeePassXC native messaging manifests:

kpcli browser-uninstall

Browser integration supports reading and saving logins, plus TOTP codes, through the macOS Chrome, Helium, and Firefox manifest locations.

Development

cargo test