agent_first_mail/cli/message.rs
1use clap::Subcommand;
2
3#[derive(Subcommand, Debug)]
4pub enum MessageAction {
5 /// Show the full local message metadata, body text, and attachment metadata.
6 Show {
7 /// Message id, for example message_inbox_607146690_22.
8 message_id: String,
9 },
10 /// File this message into a direct-message archive category and queue eligible IMAP moves.
11 Archive {
12 /// Message id, for example message_inbox_607146690_22.
13 message_id: String,
14 /// Direct-message archive category ref: aYYYYMMDDNNN or aYYYYMMDDNNN-any-suffix.
15 archive_ref: String,
16 /// Human/agent-authored summary for this archive entry.
17 #[arg(long)]
18 summary: String,
19 /// Why this disposition is correct; required by default.
20 #[arg(long)]
21 reason: Option<String>,
22 },
23 /// Mark junk/phishing/malware/suspicious mail locally, show it under spam/, and queue a Junk move.
24 Spam {
25 /// Message id, for example message_inbox_607146690_22.
26 message_id: String,
27 /// Why this disposition is correct; required by default.
28 #[arg(long)]
29 reason: Option<String>,
30 },
31 /// Undo a local spam mark before queued remote effects are pushed.
32 Unspam {
33 /// Message id, for example message_inbox_607146690_22.
34 message_id: String,
35 /// Why this spam mark should be undone; required by default.
36 #[arg(long)]
37 reason: Option<String>,
38 },
39 /// Explicitly discard this message locally, show it under trash/, and queue a Trash move.
40 Trash {
41 /// Message id, for example message_inbox_607146690_22.
42 message_id: String,
43 /// Why this disposition is correct; required by default.
44 #[arg(long)]
45 reason: Option<String>,
46 },
47 /// Undo a local trash mark before queued remote effects are pushed.
48 Untrash {
49 /// Message id, for example message_inbox_607146690_22.
50 message_id: String,
51 /// Why this trash mark should be undone; required by default.
52 #[arg(long)]
53 reason: Option<String>,
54 },
55 /// Restore a directly archived message to triage.
56 Unarchive {
57 /// Message id, for example message_inbox_607146690_22.
58 message_id: String,
59 /// Why this archive should be undone; required by default.
60 #[arg(long)]
61 reason: Option<String>,
62 },
63 /// Fetch an attachment for this message.
64 Attachment {
65 #[command(subcommand)]
66 action: MessageAttachmentAction,
67 },
68}
69
70#[derive(Subcommand, Debug)]
71pub enum MessageAttachmentAction {
72 /// Fetch one attachment by MIME part id, or all attachments when omitted.
73 Fetch {
74 /// Message id, for example message_inbox_607146690_22.
75 message_id: String,
76 part_id: Option<String>,
77 },
78}