KeePassCore.CLI roadmap¶
src/KeePassCore.CLI, net10.0, terminal UI (Terminal.Gui 2.5). User doc and keys:
src/KeePassCore.CLI/README.md.
Goal and rules¶
- A cross-platform demo of the lib: it shows that the lib creates, reads and writes databases that other KeePass applications open.
DatabaseServiceholds all lib calls (UI-independent); the UI runs key derivation in the background and marshals back withIApplication.Invoke.- Never breaking KDBX 4 files also means never overwriting changes made by another application (see item 10).
Done¶
- Create / open a database: password and/or key file (a missing key file is created). New databases: AES-256 + Argon2d (the lib default), root group only.
- Browse: group tree (left), entries of the selected group (right),
Tabswitches panels. - Groups: create (
F9), edit name and notes (F10/Enter). Multi-line notes shown read-only and kept. - Entries: create (
F9), edit title, user name, password, URL, notes (F10/Enter). - The current password is never loaded into the dialog; an empty password keeps it.
- Edits keep the previous version in the history (
CreateBackup+Touch); custom fields, attachments and history are kept. - Saving: changes stay in memory until
F5; quitting or switching database with unsaved changes asks Cancel / Discard / Save. Saves are transacted (temporary file, then an atomic replace, see the lib roadmap) and keep the Unix permissions. - Weak key derivation: a warning in the log after opening a database whose KDF is reported weak by the lib (AES-KDF, or Argon2 below the defaults). Switching it waits for the database settings (To do).
NativeLib.AllowNative = falseworkaround dropped (it avoided a Mono assert in the lib, removed).- Checks: created files open in pykeepass (an independent KDBX 4 reader); password, key file, wrong key and input validation tested in a pseudo-terminal.
Known limitations¶
- Notes are edited on one line (
TextViewis obsolete in Terminal.Gui 2.5). - Tree labels must not contain emoji (non-BMP characters): Terminal.Gui's
TreeViewthrows. - Entry UUID, tags, expiry date and attachment names are not shown yet.
To do¶
"Lib" means KeePassCoreLib already provides the logic; the CLI only needs the UI.
Suggested order: 1, 2, 3, 10, 5, 4, 6, 8, then the rest.
Core¶
- Delete group / entry. To decide: move to the Recycle Bin (KeePass default; lib:
RecycleBinEnabled,RecycleBinUuid), delete permanently, or both (Delete= bin,Shift+Delete= permanent). Deletions must be recorded inDeletedObjects, otherwise a later sync with another copy brings them back. - Copy password, user name or URL to the clipboard, cleared after 10 s. Clear only if the
clipboard still holds the copied value. On Linux the Terminal.Gui clipboard needs
xclip,xselorwl-copy; over SSH only OSC 52 works. Show a message when no clipboard is available. - Password reveal (the former F4 toggle was removed).
- Password generator when creating or editing an entry (lib:
PwGenerator,PwProfile;QualityEstimationfor the strength). - Search across the whole database: title, user name, URL, notes, tags (lib:
SearchParameters,PwGroup.SearchEntries). - Entry details view: custom fields, tags, expiry, attachments, history.
- Move an entry or group to another group (target picked in a tree dialog).
Security¶
- Lock the database, manually and after X minutes idle: close it, keep the path, ask for the key again.
- Change the master key (password and/or key file).
- Detect external changes before saving. If KeePassXC or a sync tool changed the file since
it was opened, saving silently overwrites those changes. The lib keeps
HashOfFileOnDiskfor this check; then offer merge or overwrite. Matters early (never lose data). - Expired entries: mark them in the list, filter them.
Data¶
- Edit custom fields, tags, expiry date, icon.
- Attachments: list, export to a file, add from a file.
- History: show the versions, restore one.
- Database settings: name, description, cipher, KDF and its parameters, Recycle Bin, history limits. Also the place for the migration of old KeePass 2.x files whose Argon2 memory is below the RFC 9106 minimum (8 KiB × parallelism): they open, but cannot be saved as is (see the lib roadmap).
- TOTP codes for entries holding an OTP secret (lib:
HmacOtp). - Merge / sync with another copy of the file (lib:
PwDatabase.MergeIn). - Import / export: KeePass XML is in the lib; CSV and other formats are in the WinForms app (see its roadmap: move UI-free formats).
Comfort¶
- Sort entries by column, duplicate an entry, remember the last opened file.
- Non-interactive commands for scripts (
list,get,copy), likekeepassxc-cli; only if the CLI becomes more than a demo.
Not possible in a terminal: Auto-Type, browser integration.
Maintenance¶
- Test on Windows and macOS terminals (only tested on Linux).
- Dockerfile (Alpine, build stage + runtime stage).