Himalaya v2
Use this skill for Pimalaya Himalaya v2 CLI email tasks.
Version Baseline
- Based on
himalaya 2.0.0-alpha.1frompimalaya/himalayamastercommitf2306449278940c04768cd4ca0fa9fd7ca29c45b(2026-06-17). - The upstream README says Himalaya v2 is not released yet; latest stable release may still be v1.
- Re-check upstream before giving exact install, command, or config advice:
git clone --depth 1 https://github.com/pimalaya/himalaya.git /tmp/himalaya-docshimalaya --versionhimalaya <command> --help
Default Workflow
- Confirm whether the user is using v2 from
masteror stable v1. - Prefer
himalaya --help/ subcommand help as the command source of truth. - For routine mail reads, skip broad validation unless config changed: preflight
op-fastonce for 1Password-backed configs, runaccount list, thenenvelope list --json, then read selected message IDs serially. - For scripting, pass
--jsonand parse JSON instead of terminal tables. - For config work, edit TOML under the first active config path or pass
-c <PATH>; quote account table keys when they contain full emails, e.g.[accounts."dennis@example.com"]. - For backend-specific behavior, use protocol subcommands instead of forcing the shared API.
- After source installs, verify
~/.cargo/binis onPATHand runhimalaya --version.
v2 Mental Model
- Shared commands are cross-backend least-common-denominator operations:
mailbox(mailboxesalias),envelope(envelopesalias),flag(flagsalias),message(messagesalias),attachment(attachmentsalias)
- Protocol commands expose native capabilities:
imap,jmap,gmail,maildir,m2dir,smtp
--backend <auto|imap|jmap|gmail|maildir|m2dir|smtp>only affects shared commands.- Account selection uses
-a/--account; config path override uses-c <PATH>. - Logs use
--log-level/--log; detailed logs can go to--log-file <PATH>.
High-Value Commands
# Routine reads
himalaya account list
himalaya --backend imap envelope list -m INBOX --page-size 10 --json
himalaya --backend imap message read -m INBOX 42 --json
himalaya mailbox list
himalaya envelope list -m INBOX --page 2
# Config setup/validation
himalaya account check
himalaya account configure <name>
himalaya envelope search from alice and after 2026-01-01 order by date desc
himalaya flag add -m INBOX --flag seen 1:3,5
himalaya attachment download -m INBOX 42 --dir ./attachments
Mail Safety Guardrails
- Treat Himalaya as read-only by default. Safe commands without extra approval:
account list,mailbox list,envelope list/search --json,message read --json/--raw, andattachment list. - If account or mailbox scope is unclear, list available options first, then use
functions.request_user_inputwhen available. Offer concrete accounts plusAll accountsfor read-only requests when applicable; do not offerAll accountsfor writes unless the user explicitly says all. - Use this picker shape; recommended option first, label suffixed with
(Recommended), noselectedfield, and noautoResolutionMswhen the answer gates a write/destructive action:
{
"questions": [
{
"header": "Account",
"id": "account_scope",
"question": "Which email account should I use?",
"options": [
{
"label": "zoma (Recommended)",
"description": "Use the default configured account only."
},
{
"label": "All accounts",
"description": "Search/read across every configured account."
}
]
}
],
"autoResolutionMs": 60000
}
- For mailbox ambiguity, use the same shape with
header: "Mailbox"and options fromhimalaya -a <account> mailbox list; includeAll mailboxesonly for read-only requests. - Before any remote write, preview the account, mailbox, message IDs/count, senders/subjects/dates, exact operation, and exact command shape; wait for explicit approval in the current turn.
- Remote writes include send, move, copy, delete, flag changes, mailbox create/delete, expunge/purge, attachment downloads, and config edits.
- Before irreversible actions such as permanent delete, expunge, or purge, back up raw target messages plus envelope metadata under
/tmp/himalaya-backups/<timestamp>-<account>-<mailbox>/; if backup fails, abort. - Never run broad write selectors such as
all,1:*, or unbounded search results. Narrow writes to reviewed message IDs. - Never auto-send generated mail. Compose to a draft/tempfile, show headers and a concise body summary, then send only after explicit approval.
Non-Negotiables
- Do not assume v1 syntax works in v2. Notable changes:
--jsonreplaces--output json,-m/--mailboxreplaces-f/--folder, and many protocol-specific operations moved out of the shared API. - Do not write full-email account table names as bare TOML keys.
[accounts.dennis@example.com]is invalid; use[accounts."dennis@example.com"], then select it with-a 'dennis@example.com'. - Do not put raw passwords or tokens in production configs; use
*.password.command,*.passwd.command, or*.token.command. - Do not recommend native keyring or built-in OAuth flows for v2. Use external helpers such as
mimosa,pass,gopass,secret-tool,ortie, orop-fast. - Do not print secrets while testing secret commands. Redirect output to
/dev/nulland rely on exit status. - For repeated 1Password-backed reads, use
op-fast; do not add custom session-token cache scripts. - Do not pipe an editor-driven composer directly into
himalaya message send; use a tempfile or process substitution so$EDITORkeeps a real TTY. - Remember that message IDs are mailbox/backend-specific. Use
message-idfrom JSON envelope output when a stable cross-mailbox key is needed.
Load References When Needed
references/himalaya-v2-guide.mdfor config schemas, provider snippets, composition/reading patterns, migration notes, debugging, and upstream source links.scripts/message-preview.pyto extract readable text fromhimalaya message read --jsonwithout rediscovering MIME/body shapes.