$npx -y skills add SafeAI-Lab-X/ClawKeeper --skill himalayaCLI to manage emails via IMAP/SMTP. Use himalaya to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
| 1 | # Himalaya Email CLI |
| 2 | |
| 3 | Himalaya is a CLI email client that lets you manage emails from the terminal using IMAP, SMTP, Notmuch, or Sendmail backends. |
| 4 | |
| 5 | ## References |
| 6 | |
| 7 | - `references/configuration.md` (config file setup + IMAP/SMTP authentication) |
| 8 | - `references/message-composition.md` (MML syntax for composing emails) |
| 9 | |
| 10 | ## Prerequisites |
| 11 | |
| 12 | 1. Himalaya CLI installed (`himalaya --version` to verify) |
| 13 | 2. A configuration file at `~/.config/himalaya/config.toml` |
| 14 | 3. IMAP/SMTP credentials configured (password stored securely) |
| 15 | |
| 16 | ## Configuration Setup |
| 17 | |
| 18 | Run the interactive wizard to set up an account: |
| 19 | |
| 20 | ```bash |
| 21 | himalaya account configure |
| 22 | ``` |
| 23 | |
| 24 | Or create `~/.config/himalaya/config.toml` manually: |
| 25 | |
| 26 | ```toml |
| 27 | [accounts.personal] |
| 28 | email = "you@example.com" |
| 29 | display-name = "Your Name" |
| 30 | default = true |
| 31 | |
| 32 | backend.type = "imap" |
| 33 | backend.host = "imap.example.com" |
| 34 | backend.port = 993 |
| 35 | backend.encryption.type = "tls" |
| 36 | backend.login = "you@example.com" |
| 37 | backend.auth.type = "password" |
| 38 | backend.auth.cmd = "pass show email/imap" # or use keyring |
| 39 | |
| 40 | message.send.backend.type = "smtp" |
| 41 | message.send.backend.host = "smtp.example.com" |
| 42 | message.send.backend.port = 587 |
| 43 | message.send.backend.encryption.type = "start-tls" |
| 44 | message.send.backend.login = "you@example.com" |
| 45 | message.send.backend.auth.type = "password" |
| 46 | message.send.backend.auth.cmd = "pass show email/smtp" |
| 47 | ``` |
| 48 | |
| 49 | ## Common Operations |
| 50 | |
| 51 | ### List Folders |
| 52 | |
| 53 | ```bash |
| 54 | himalaya folder list |
| 55 | ``` |
| 56 | |
| 57 | ### List Emails |
| 58 | |
| 59 | List emails in INBOX (default): |
| 60 | |
| 61 | ```bash |
| 62 | himalaya envelope list |
| 63 | ``` |
| 64 | |
| 65 | List emails in a specific folder: |
| 66 | |
| 67 | ```bash |
| 68 | himalaya envelope list --folder "Sent" |
| 69 | ``` |
| 70 | |
| 71 | List with pagination: |
| 72 | |
| 73 | ```bash |
| 74 | himalaya envelope list --page 1 --page-size 20 |
| 75 | ``` |
| 76 | |
| 77 | ### Search Emails |
| 78 | |
| 79 | ```bash |
| 80 | himalaya envelope list from john@example.com subject meeting |
| 81 | ``` |
| 82 | |
| 83 | ### Read an Email |
| 84 | |
| 85 | Read email by ID (shows plain text): |
| 86 | |
| 87 | ```bash |
| 88 | himalaya message read 42 |
| 89 | ``` |
| 90 | |
| 91 | Export raw MIME: |
| 92 | |
| 93 | ```bash |
| 94 | himalaya message export 42 --full |
| 95 | ``` |
| 96 | |
| 97 | ### Reply to an Email |
| 98 | |
| 99 | Interactive reply (opens $EDITOR): |
| 100 | |
| 101 | ```bash |
| 102 | himalaya message reply 42 |
| 103 | ``` |
| 104 | |
| 105 | Reply-all: |
| 106 | |
| 107 | ```bash |
| 108 | himalaya message reply 42 --all |
| 109 | ``` |
| 110 | |
| 111 | ### Forward an Email |
| 112 | |
| 113 | ```bash |
| 114 | himalaya message forward 42 |
| 115 | ``` |
| 116 | |
| 117 | ### Write a New Email |
| 118 | |
| 119 | Interactive compose (opens $EDITOR): |
| 120 | |
| 121 | ```bash |
| 122 | himalaya message write |
| 123 | ``` |
| 124 | |
| 125 | Send directly using template: |
| 126 | |
| 127 | ```bash |
| 128 | cat << 'EOF' | himalaya template send |
| 129 | From: you@example.com |
| 130 | To: recipient@example.com |
| 131 | Subject: Test Message |
| 132 | |
| 133 | Hello from Himalaya! |
| 134 | EOF |
| 135 | ``` |
| 136 | |
| 137 | Or with headers flag: |
| 138 | |
| 139 | ```bash |
| 140 | himalaya message write -H "To:recipient@example.com" -H "Subject:Test" "Message body here" |
| 141 | ``` |
| 142 | |
| 143 | ### Move/Copy Emails |
| 144 | |
| 145 | Move to folder: |
| 146 | |
| 147 | ```bash |
| 148 | himalaya message move 42 "Archive" |
| 149 | ``` |
| 150 | |
| 151 | Copy to folder: |
| 152 | |
| 153 | ```bash |
| 154 | himalaya message copy 42 "Important" |
| 155 | ``` |
| 156 | |
| 157 | ### Delete an Email |
| 158 | |
| 159 | ```bash |
| 160 | himalaya message delete 42 |
| 161 | ``` |
| 162 | |
| 163 | ### Manage Flags |
| 164 | |
| 165 | Add flag: |
| 166 | |
| 167 | ```bash |
| 168 | himalaya flag add 42 --flag seen |
| 169 | ``` |
| 170 | |
| 171 | Remove flag: |
| 172 | |
| 173 | ```bash |
| 174 | himalaya flag remove 42 --flag seen |
| 175 | ``` |
| 176 | |
| 177 | ## Multiple Accounts |
| 178 | |
| 179 | List accounts: |
| 180 | |
| 181 | ```bash |
| 182 | himalaya account list |
| 183 | ``` |
| 184 | |
| 185 | Use a specific account: |
| 186 | |
| 187 | ```bash |
| 188 | himalaya --account work envelope list |
| 189 | ``` |
| 190 | |
| 191 | ## Attachments |
| 192 | |
| 193 | Save attachments from a message: |
| 194 | |
| 195 | ```bash |
| 196 | himalaya attachment download 42 |
| 197 | ``` |
| 198 | |
| 199 | Save to specific directory: |
| 200 | |
| 201 | ```bash |
| 202 | himalaya attachment download 42 --dir ~/Downloads |
| 203 | ``` |
| 204 | |
| 205 | ## Output Formats |
| 206 | |
| 207 | Most commands support `--output` for structured output: |
| 208 | |
| 209 | ```bash |
| 210 | himalaya envelope list --output json |
| 211 | himalaya envelope list --output plain |
| 212 | ``` |
| 213 | |
| 214 | ## Debugging |
| 215 | |
| 216 | Enable debug logging: |
| 217 | |
| 218 | ```bash |
| 219 | RUST_LOG=debug himalaya envelope list |
| 220 | ``` |
| 221 | |
| 222 | Full trace with backtrace: |
| 223 | |
| 224 | ```bash |
| 225 | RUST_LOG=trace RUST_BACKTRACE=1 himalaya envelope list |
| 226 | ``` |
| 227 | |
| 228 | ## Tips |
| 229 | |
| 230 | - Use `himalaya --help` or `himalaya <command> --help` for detailed usage. |
| 231 | - Message IDs are relative to the current folder; re-list after folder changes. |
| 232 | - For composing rich emails with attachments, use MML syntax (see `references/message-composition.md`). |
| 233 | - Store passwords securely using `pass`, system keyring, or a command that outputs the password. |