From b4dd27bb15be97d5ccf0162fca1cefb8ddcacd10 Mon Sep 17 00:00:00 2001
From: "Sara (Codex)" <musketeer@sara>
Date: Tue, 19 May 2026 03:02:48 +0000
Subject: [PATCH 1/3] feat(cli): add archive-email alias for delete-email

---
 README.md    |  4 +++-
 docs/help.md |  3 +++
 src/main.rs  | 23 +++++++++++++++++++++--
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 3d209ef..6de7b8e 100644
--- a/README.md
+++ b/README.md
@@ -190,11 +190,13 @@ inboxapi get-email "<message-id>"
 
 ### `delete-email`
 
-Soft-deletes a received email by message ID. It prompts for confirmation by default, and scripted or piped use must pass `--force`.
+Archives (soft-deletes) a received email by message ID. It prompts for confirmation by default, and scripted or piped use must pass `--force`.
+`archive-email` is available as an alias for `delete-email`.
 
 ```bash
 inboxapi delete-email "<message-id>"
 inboxapi delete-email "<message-id>" --force
+inboxapi archive-email "<message-id>" --force
 ```
 
 ### `search-emails`
diff --git a/docs/help.md b/docs/help.md
index a8cd816..e7e0721 100644
--- a/docs/help.md
+++ b/docs/help.md
@@ -21,6 +21,7 @@ inboxapi send-email --to user@example.com --subject "Hello" --body "Hi there"
 inboxapi send-email --to user@example.com --subject "Newsletter" --body-file ./body.txt --html-body-file ./newsletter.html
 inboxapi get-emails --limit 5 --human
 inboxapi delete-email "<message-id>" --force
+inboxapi archive-email "<message-id>" --force
 inboxapi search-emails --subject "invoice"
 inboxapi help
 ```
@@ -78,6 +79,7 @@ Your InboxAPI email address (from `whoami`) is **the agent's own inbox** for rec
 ## Deleting Received Email
 
 Use `delete_email` to hide a received message from the normal inbox views. This is a soft delete: the message is removed from `get_last_email`, `get_emails`, `get_email`, `search_emails`, `get_email_count`, and `get_thread`, but there is no restore or trash command yet.
+For CLI usage, `archive-email` is an alias for `delete-email`.
 
 The CLI prompts for confirmation by default. If stdin is not a TTY, you must pass `--force` or it will error instead of deleting.
 
@@ -86,6 +88,7 @@ CLI example:
 ```bash
 inboxapi delete-email "<message-id>"
 inboxapi delete-email "<message-id>" --force
+inboxapi archive-email "<message-id>" --force
 ```
 
 ---
diff --git a/src/main.rs b/src/main.rs
index 5197e56..04c08c0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -151,7 +151,8 @@ enum Commands {
         /// The message ID to retrieve
         message_id: String,
     },
-    /// Soft-delete a received email by message ID
+    /// Archive (soft-delete) a received email by message ID
+    #[command(visible_alias = "archive-email")]
     DeleteEmail {
         /// The message ID to delete
         message_id: String,
@@ -2513,7 +2514,7 @@ Commands:
   send-email     Send an email (supports --attachment and --attachment-ref)
   get-emails     List inbox emails
   get-email      Get a single email by message ID
-  delete-email   Soft-delete a received email by message ID
+  delete-email   Soft-delete a received email by message ID (alias: archive-email)
   get-last-email  Get the most recent email
   get-email-count  Get inbox email count
   get-sent-emails  List sent emails
@@ -2549,6 +2550,7 @@ Examples:
   inboxapi get-emails --limit 5
   inboxapi get-emails --limit 5 --human
   inboxapi delete-email \"<msg-id>\" --force
+  inboxapi archive-email \"<msg-id>\" --force
   inboxapi get-last-email
   inboxapi get-email-count
   inboxapi get-sent-emails --limit 10
@@ -8129,6 +8131,19 @@ mod tests {
         );
     }
 
+    #[test]
+    fn test_archive_email_alias_parses_positional_message_id() {
+        let cli = Cli::try_parse_from(["inboxapi", "archive-email", "<msg-id>", "--force"]).unwrap();
+
+        assert!(
+            matches!(
+                cli.command,
+                Some(Commands::DeleteEmail { message_id, force: true }) if message_id == "<msg-id>"
+            ),
+            "CLI arguments for archive-email alias should be parsed correctly"
+        );
+    }
+
     #[test]
     fn test_delete_email_prompt_mode() {
         assert!(
@@ -8830,6 +8845,10 @@ mod tests {
             CLI_HELP_TEXT.contains("delete-email"),
             "CLI help text should include the delete-email command"
         );
+        assert!(
+            CLI_HELP_TEXT.contains("archive-email"),
+            "CLI help text should include the archive-email alias"
+        );
         assert!(
             CLI_HELP_TEXT.contains("search-emails"),
             "help should include search-emails"

From 293ea2e1c671ff833670804752f90bce90135a47 Mon Sep 17 00:00:00 2001
From: "Sara (Codex)" <musketeer@sara>
Date: Tue, 19 May 2026 03:05:39 +0000
Subject: [PATCH 2/3] style(cli): format archive-email alias test

---
 src/main.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index 04c08c0..6e10859 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8133,7 +8133,8 @@ mod tests {
 
     #[test]
     fn test_archive_email_alias_parses_positional_message_id() {
-        let cli = Cli::try_parse_from(["inboxapi", "archive-email", "<msg-id>", "--force"]).unwrap();
+        let cli =
+            Cli::try_parse_from(["inboxapi", "archive-email", "<msg-id>", "--force"]).unwrap();
 
         assert!(
             matches!(

From c47c36fc8f46e8b880a028dffa28d88582cc16b4 Mon Sep 17 00:00:00 2001
From: "Sara (Codex)" <musketeer@sara>
Date: Tue, 19 May 2026 03:06:22 +0000
Subject: [PATCH 3/3] docs(cli): align delete-email help wording with archive
 alias

---
 src/main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index 6e10859..8deed90 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2514,7 +2514,7 @@ Commands:
   send-email     Send an email (supports --attachment and --attachment-ref)
   get-emails     List inbox emails
   get-email      Get a single email by message ID
-  delete-email   Soft-delete a received email by message ID (alias: archive-email)
+  delete-email   Archive (soft-delete) a received email by message ID (alias: archive-email)
   get-last-email  Get the most recent email
   get-email-count  Get inbox email count
   get-sent-emails  List sent emails
