Add additive KDBX importer

This commit is contained in:
2026-08-11 09:04:48 +02:00
parent f84f7247d2
commit bf75465642
23 changed files with 1959 additions and 82 deletions

View File

@@ -9,8 +9,25 @@ use crate::action::{ACTIONS, Action};
const HISTORY_LIMIT: usize = 100;
const ROOT_COMMANDS: &[&str] = &[
"init", "list", "show", "find", "grep", "insert", "edit", "generate", "remove", "move", "copy",
"git", "otp", "lock", "unlock", "help", "version", "quit",
"init",
"list",
"show",
"find",
"grep",
"insert",
"edit",
"generate",
"remove",
"move",
"copy",
"import-kdbx",
"git",
"otp",
"lock",
"unlock",
"help",
"version",
"quit",
];
const GIT_COMMANDS: &[&str] = &[
"init",
@@ -31,8 +48,20 @@ const GIT_COMMANDS: &[&str] = &[
const GIT_REMOTE_COMMANDS: &[&str] = &["get-url", "add", "set-url", "remove"];
const OTP_COMMANDS: &[&str] = &["code", "insert", "append", "uri", "validate", "version"];
const HELP_TOPICS: &[&str] = &[
"init", "list", "show", "find", "grep", "insert", "edit", "generate", "remove", "move", "copy",
"git", "otp",
"init",
"list",
"show",
"find",
"grep",
"insert",
"edit",
"generate",
"remove",
"move",
"copy",
"import-kdbx",
"git",
"otp",
];
/// Auditable mapping from every milestone-01 command family to the TUI command surface.
@@ -54,6 +83,7 @@ pub const COMMAND_COVERAGE: &[CommandCoverage] = &[
"copy entries or directories",
":copy [OPTIONS] SOURCE DESTINATION",
),
coverage("import a KeePass database", ":import-kdbx [OPTIONS] SOURCE"),
coverage("initialize Git", ":git init"),
coverage("show Git status", ":git status"),
coverage("show Git log", ":git log [OPTIONS]"),
@@ -171,6 +201,12 @@ pub const TUI_COVERAGE: &[TuiCoverage] = &[
Some(Action::CopyEntry),
":copy [OPTIONS] SOURCE DESTINATION",
),
tui(
"import a KeePass database",
"KDBX import form",
Some(Action::ImportKdbx),
":import-kdbx [OPTIONS] SOURCE",
),
tui("initialize Git", "Git dashboard", None, ":git init"),
tui("show Git status", "Git dashboard", None, ":git status"),
tui("show Git log", "Git dashboard", None, ":git log [OPTIONS]"),
@@ -669,6 +705,7 @@ pub fn operation_name(request: &CommandRequest) -> &'static str {
CommandRequest::Remove(_) => "remove",
CommandRequest::Move(_) => "move",
CommandRequest::Copy(_) => "copy",
CommandRequest::ImportKdbx(_) => "KDBX import",
CommandRequest::Git(request) => match request {
GitRequest::Init => "Git init",
GitRequest::Status => "Git status",