- Rust 100%
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
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