From ab8839a46a6be09a5ae5bf92f45ddee5af3800cb Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Wed, 29 Apr 2026 23:12:44 -0400 Subject: [PATCH] feat(cli): clap surface for `import lastpass` Adds the Import command group with a Lastpass subcommand. Stub returns `not implemented` so the help text is reachable ahead of the body landing in Task 8. Co-Authored-By: Claude Opus 4.7 --- crates/relicario-cli/src/main.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crates/relicario-cli/src/main.rs b/crates/relicario-cli/src/main.rs index 54009ed..0244dee 100644 --- a/crates/relicario-cli/src/main.rs +++ b/crates/relicario-cli/src/main.rs @@ -100,6 +100,12 @@ enum Commands { action: BackupAction, }, + /// Import items from another password manager into the unlocked vault. + Import { + #[command(subcommand)] + action: ImportAction, + }, + /// Attach a file to an item. Attach { query: String, file: PathBuf }, @@ -309,6 +315,18 @@ enum BackupAction { }, } +#[derive(Subcommand)] +enum ImportAction { + /// Import a LastPass CSV export into the unlocked vault. + /// Each row creates a new item with a freshly-minted ID; title + /// collisions are kept (no dedup). Failed rows are skipped and + /// reported on stderr. + Lastpass { + /// Path to the LastPass-format CSV export. + csv: PathBuf, + }, +} + fn main() -> Result<()> { let cli = Cli::parse(); match cli.command { @@ -323,6 +341,7 @@ fn main() -> Result<()> { Commands::Purge { query } => cmd_purge(query), Commands::Trash { action } => cmd_trash(action), Commands::Backup { action } => cmd_backup(action), + Commands::Import { action } => cmd_import(action), Commands::Attach { query, file } => cmd_attach(query, file), Commands::Attachments { query } => cmd_attachments(query), Commands::Extract { query, aid, out } => cmd_extract(query, aid, out), @@ -1539,6 +1558,16 @@ fn cmd_backup_restore(input: PathBuf, target: PathBuf) -> Result<()> { Ok(()) } +fn cmd_import(action: ImportAction) -> Result<()> { + match action { + ImportAction::Lastpass { csv } => cmd_import_lastpass(csv), + } +} + +fn cmd_import_lastpass(_csv: PathBuf) -> Result<()> { + bail!("not implemented yet — Task 8 lands the body") +} + fn cmd_trash_empty() -> Result<()> { use relicario_core::time::now_unix;