@ghostpaw/email 0.2.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  [![license](https://img.shields.io/npm/l/@ghostpaw/email)](LICENSE)
6
6
  [![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](package.json)
7
7
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue?logo=typescript&logoColor=white)](https://www.typescriptlang.org)
8
+ [![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.GhostPawJS%2Femail-06d6a0)](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.GhostPawJS%2Femail/versions/latest)
8
9
 
9
10
  A standalone email engine for Node.js, built on SQLite.
10
11
 
@@ -16,6 +17,77 @@ code, LLM agents operating through a structured `soul` / `tools` / `skills`
16
17
  runtime, and agent operators who want a ready-to-use `email` CLI binary
17
18
  without writing any wiring code.
18
19
 
20
+ ## MCP server
21
+
22
+ Every client below starts the same stdio server: `npx -y @ghostpaw/email mcp`.
23
+ Cached messages live in `~/.ghostpaw/email.db` unless the `GHOSTPAW_EMAIL_DB`
24
+ environment variable (absolute path) or `--db <path>` says otherwise.
25
+
26
+ **Claude Code**
27
+
28
+ ```bash
29
+ claude mcp add ghostpaw-email -- npx -y @ghostpaw/email mcp
30
+ ```
31
+
32
+ or as a plugin, which also installs the skill:
33
+
34
+ ```bash
35
+ /plugin marketplace add GhostPawJS/email
36
+ /plugin install ghostpaw-email@ghostpaw-email
37
+ ```
38
+
39
+ **Email CLI** (`~/.email/config.toml`)
40
+
41
+ ```toml
42
+ [mcp_servers.ghostpaw-email]
43
+ command = "npx"
44
+ args = ["-y", "@ghostpaw/email", "mcp"]
45
+ ```
46
+
47
+ **Cursor** (`.cursor/mcp.json`), **Claude Desktop** (`claude_desktop_config.json`)
48
+ or a project `.mcp.json`:
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "ghostpaw-email": {
54
+ "command": "npx",
55
+ "args": ["-y", "@ghostpaw/email", "mcp"]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ Claude Desktop users can also install `server.mcpb` from the
62
+ [latest GitHub release](https://github.com/GhostPawJS/email/releases/latest).
63
+ A Dockerfile is included for container hosts:
64
+ `docker build -t ghostpaw-email . && docker run -i --rm -v email:/data ghostpaw-email`.
65
+
66
+ The server speaks MCP 2026-07-28 (stateless, `server/discover`) and the
67
+ initialize-based revisions 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05.
68
+
69
+ Network operations use the existing CLI account configuration (`email account add`) or
70
+ `EMAIL_IMAP_HOST`, `EMAIL_SMTP_HOST`, `EMAIL_USER` and `EMAIL_PASS` (or
71
+ `EMAIL_ACCESS_TOKEN`). Discovery and cached reads need no account or credentials.
72
+ The surface database defaults to `~/.ghostpaw/email.db`; point `--db` at an
73
+ existing account cache to read it. Each network call opens and closes its IMAP
74
+ session. Connection commands do not retain a session between calls.
75
+
76
+ ## Tool CLI
77
+
78
+ ```bash
79
+ npx -y @ghostpaw/email tools
80
+ npx -y @ghostpaw/email call mail_read '{"view":"folders"}' --db :memory:
81
+ npx -y @ghostpaw/email call mail_search '{"query":"invoice"}'
82
+ ```
83
+
84
+ Both `email` and `ghostpaw-email` run the same CLI. Existing account, read,
85
+ search, compose, organize and sync commands remain available. The full guide
86
+ is preserved in [skills/email/references/cli.md](skills/email/references/cli.md).
87
+
88
+ Agent Skill: `SKILL.md` and `skills/email/` ship in the package; print the skill
89
+ with `npx -y @ghostpaw/email skill`.
90
+
19
91
  ## Install
20
92
 
21
93
  ```bash
@@ -117,8 +189,8 @@ surface designed to minimise LLM cognitive load:
117
189
  import { skills, soul, tools } from '@ghostpaw/email';
118
190
 
119
191
  // 5 intent-shaped tools covering the full mailbox lifecycle
120
- const allTools = tools.emailTools;
121
- const readTool = tools.getEmailToolByName('mail_read');
192
+ const allTools = tools.aligned.emailTools;
193
+ const readTool = tools.aligned.getEmailToolByName('mail_read');
122
194
 
123
195
  // 8 reusable workflow skills for multi-step scenarios
124
196
  const triageSkill = skills.getEmailSkillByName('triage-inbox');
@@ -127,8 +199,28 @@ const triageSkill = skills.getEmailSkillByName('triage-inbox');
127
199
  const systemPrompt = soul.renderEmailSoulPromptFoundation();
128
200
  ```
129
201
 
130
- Every tool returns a structured result with `outcome`, `summary`, `entities`,
131
- and `nextSteps` — no thrown exceptions to parse, no ambiguous prose.
202
+ The shared facade exposes `name`, `description`, `whenToUse`, `whenNotToUse`,
203
+ `inputSchema`, `readOnly`, and `sideEffects`. Handlers take a context containing
204
+ `read`, `write`, and `network` surfaces and the existing tool input. They return
205
+ `{ ok, outcome, summary, next, data }`; `data.entities` contains the message or
206
+ mailbox references, and `next` contains follow-up hints. Errors map to `ok: false`.
207
+ Read operations may refresh the local cache, so metadata conservatively marks
208
+ all tools as writing state.
209
+
210
+ ```ts
211
+ const definitions = tools.aligned.listEmailToolDefinitions();
212
+ const tool = tools.aligned.getEmailToolByName('mail_read');
213
+ if (!tool) throw new Error('mail_read is unavailable');
214
+ const result = await tool.handler(
215
+ { read: mailbox.read, write: mailbox.write, network: mailbox.network },
216
+ { view: 'folders' },
217
+ );
218
+ console.log(result.ok, result.summary);
219
+ ```
220
+
221
+ The deprecated `tools.emailTools` and `tools.getEmailToolByName()` remain
222
+ available with the original `{ outcome, summary, entities, nextSteps }` result
223
+ and unchanged inputs. Migrate to `tools.aligned` to use the shared shape.
132
224
 
133
225
  See [LLM.md](docs/LLM.md) for the full AI-facing guide covering soul, tools,
134
226
  and skills.
package/SKILL.md CHANGED
@@ -1,283 +1,131 @@
1
- # SKILL.md — `email` CLI as an Agent Tool Surface
2
-
3
- The `email` binary is a local-first email CLI built on top of `@ghostpaw/email`. It exposes five
4
- intent-shaped commands that map directly to the library's tool layer. Agents invoke it as a
5
- subprocess via bash; no MCP server or standing process is needed.
6
-
7
- ---
8
-
9
- ## Prerequisites
10
-
11
- - Node.js ≥ 24
12
- - Install once:
13
- ```bash
14
- npm install -g @ghostpaw/email # global install, `email` in PATH
15
- npx @ghostpaw/email account add ... # or zero-install via npx
16
- ```
17
-
18
- ---
19
-
20
- ## Account Setup
21
-
22
- ```bash
23
- email account add \
24
- --name work \
25
- --imap-host imap.fastmail.com --imap-port 993 \
26
- --smtp-host smtp.fastmail.com --smtp-port 587 \
27
- --user me@fastmail.com --pass "app-password"
28
-
29
- email account list # see all accounts
30
- email account set-default --name work
31
- email account show # shows config (password redacted)
32
- ```
33
-
34
- ### Environment variables (no config file needed — useful in CI)
35
-
36
- | Variable | Purpose |
37
- |---|---|
38
- | `EMAIL_ACCOUNT` | Select account by slug |
39
- | `EMAIL_IMAP_HOST` | IMAP hostname |
40
- | `EMAIL_IMAP_PORT` | IMAP port (default: 993) |
41
- | `EMAIL_IMAP_TLS` | `"false"` to disable TLS |
42
- | `EMAIL_SMTP_HOST` | SMTP hostname |
43
- | `EMAIL_SMTP_PORT` | SMTP port (default: 587) |
44
- | `EMAIL_SMTP_TLS` | `"false"` to disable TLS |
45
- | `EMAIL_USER` | Auth username |
46
- | `EMAIL_PASS` | Password auth |
47
- | `EMAIL_ACCESS_TOKEN` | OAuth2 access token |
48
- | `EMAIL_REFRESH_TOKEN` | OAuth2 refresh token |
49
- | `EMAIL_CONFIG_DIR` | Override config directory (full path) |
50
- | `EMAIL_DATA_DIR` | Override SQLite data directory (full path) |
51
- | `NO_COLOR` | Disable ANSI color output |
52
-
53
1
  ---
54
-
55
- ## `--json` — Machine-Readable Output
56
-
57
- **Always use `--json` when invoking from an agent.** Every command outputs a JSON object:
58
-
59
- ```json
60
- {
61
- "outcome": "success",
62
- "summary": "42 message(s) in INBOX.",
63
- "entities": [
64
- { "kind": "message", "id": "1921", "title": "Re: Q2 roadmap" }
65
- ],
66
- "nextSteps": [
67
- "Use view: \"message\" with folder and uid to read a specific message."
68
- ]
69
- }
70
- ```
71
-
72
- `outcome` values:
73
- - `"success"` — operation completed
74
- - `"no_op"` — nothing to do (not an error)
75
- - `"needs_clarification"` — more information required; check `nextSteps`
76
- - `"error"` — operation failed; check `summary` for details and `nextSteps` for guidance
77
-
78
- **On error, `--json` output still goes to stdout** (not stderr) so downstream parsers can always
79
- parse stdout unconditionally.
80
-
81
- ---
82
-
83
- ## Exit Codes
84
-
85
- | Code | When |
86
- |---|---|
87
- | `0` | `success` or `no_op` |
88
- | `1` | Missing required flag, invalid value, body required |
89
- | `2` | No config, malformed config, unknown account, no default account |
90
- | `3` | Authentication failure |
91
- | `4` | Network / connection failure |
92
- | `5` | Tool returned `outcome: "error"` |
93
- | `6` | Tool returned `outcome: "needs_clarification"` |
94
- | `127` | Unexpected / unhandled error |
95
-
2
+ name: email
3
+ description: "Read, search, compose, organize and synchronize email with a local SQLite cache. Use when managing email or searching cached messages."
4
+ license: "MIT"
5
+ compatibility: "Node.js 24 or newer. MCP stdio or email CLI."
96
6
  ---
97
7
 
98
- ## Commands
99
-
100
- ### `email read [view]`
8
+ # email
101
9
 
102
- Read mailbox state. Default view: `queue` (INBOX).
10
+ Read and search cached email offline. Configure live accounts with email account add before network operations. Inspect messages before replying or changing folders. Confirm recipients and content before sending; trash and folder deletion can remove mail. Credentials use the existing email CLI account configuration or EMAIL_* environment variables.
103
11
 
104
- ```bash
105
- email read --json # queue view, INBOX
106
- email read folders --json # list all folders
107
- email read queue --folder Sent --limit 20 --json
108
- email read queue --unread-only --json
109
- email read thread --thread-id <id> --json
110
- email read message --folder INBOX --uid 1921 --json
111
- email read attachment --folder INBOX --uid 1921 --json # list attachments
112
- email read eml --folder INBOX --uid 1921 # raw EML bytes to stdout
113
- ```
12
+ ## Calling tools
114
13
 
115
- **`eml` view:** writes raw EML bytes to stdout. In `--json` mode the bytes are base64-encoded
116
- under a `"data"` key.
14
+ MCP: connect to ghostpaw-email, then call a tool by name with its JSON arguments.
117
15
 
118
- ```bash
119
- email read eml --folder INBOX --uid 42 > message.eml
120
- email read eml --folder INBOX --uid 42 --json | jq -r '.data' | base64 -d > message.eml
121
- ```
16
+ CLI: `ghostpaw-email call <tool> '<JSON object>'` or `ghostpaw-email <tool> --parameter value` (without a global install: `npx -y @ghostpaw/email <tool> ...`).
122
17
 
123
- ### `email search <query>`
18
+ Inspect schemas with `ghostpaw-email describe <tool>`. Use `--db <path>` to select a database.
124
19
 
125
- Search messages via local FTS5 (default) or remote IMAP SEARCH.
20
+ ## mail_read
126
21
 
127
- ```bash
128
- email search "invoice" --json
129
- email search "from:boss@work.com subject:quarterly" --json
130
- email search "budget 2026" --folder Archive --limit 10 --json
131
- email search "urgent" --mode remote --json
132
- email search "report" --since 2026-01-01 --before 2026-04-01 --json
133
- email search "contract" --has-attachments --json
134
- ```
22
+ Read mailbox state: folder list, message queue, thread view, single message body, attachment metadata, or raw EML export.
135
23
 
136
- ### `email compose <action>`
24
+ Use when: Inspect folders, cached messages, threads, attachments or raw message content.
137
25
 
138
- Compose and send email. Body comes from `--body` or piped stdin.
26
+ Not for: Use mail_search to find messages by query or mail_organize to change them.
139
27
 
140
- ```bash
141
- # Send
142
- email compose send --to alice@example.com --subject "Hello" --body "Hi there" --json
143
- echo "Meeting at 3pm?" | email compose send --to alice@example.com --subject "Quick question"
28
+ Writes: writes_state.
144
29
 
145
- # Reply (body from stdin)
146
- echo "Sounds good!" | email compose reply --folder INBOX --uid 1921
30
+ | Parameter | Type | Required | Values / description |
31
+ | --- | --- | --- | --- |
32
+ | view | string | yes | folders, queue, thread, message, attachment, eml. What to read. |
33
+ | folder | string | no | Folder path (required for queue/message/attachment/eml). |
34
+ | uid | integer | no | Message UID (required for message/attachment/eml). |
35
+ | threadId | string | no | Thread ID (required for thread view). |
36
+ | partPath | string | no | Part path for a specific attachment (optional for attachment view). |
37
+ | limit | integer | no | Maximum messages to return (queue view). |
38
+ | unreadOnly | boolean | no | Filter to unread messages only (queue view). |
39
+ | refresh | boolean | no | Fetch live folder list from server before returning (folders/queue view). |
147
40
 
148
- # Reply-all
149
- email compose reply --folder INBOX --uid 1921 --body "Thanks all" --reply-all --json
41
+ ## mail_search
150
42
 
151
- # Forward
152
- email compose forward --folder INBOX --uid 1921 --to bob@example.com --body "FYI" --json
43
+ Search for messages locally via FTS or remotely via IMAP SEARCH. Returns matching message references.
153
44
 
154
- # Attach files (comma-separated paths)
155
- email compose send --to a@b.com --subject "Report" --body "See attached" \
156
- --attach /path/to/report.pdf,/path/to/data.csv --json
45
+ Use when: Find messages by a local full-text query or a remote IMAP search.
157
46
 
158
- # Drafts
159
- email compose draft --save --to a@b.com --subject "Draft" --body "WIP" --json
160
- email compose draft --send-draft 42 --json
161
- ```
47
+ Not for: Use mail_read when the folder and message UID are already known.
162
48
 
163
- ### `email organize <action>`
49
+ Writes: writes_state.
164
50
 
165
- Organize messages and folders. `--uids` accepts comma-separated UIDs.
51
+ | Parameter | Type | Required | Values / description |
52
+ | --- | --- | --- | --- |
53
+ | query | string | yes | Free-text search query or FTS5 expression. |
54
+ | folder | string | no | Restrict search to a specific folder. |
55
+ | mode | string | no | local, remote. local (default) or remote IMAP SEARCH. |
56
+ | since | string | no | ISO date string — only messages after this date. |
57
+ | before | string | no | ISO date string — only messages before this date. |
58
+ | hasAttachments | boolean | no | Filter to messages with attachments. |
59
+ | unreadOnly | boolean | no | Filter to unread messages. |
60
+ | limit | integer | no | Maximum number of results. |
166
61
 
167
- ```bash
168
- email organize mark-read --folder INBOX --uids 1,2,3 --json
169
- email organize star --folder INBOX --uids 42 --json
170
- email organize archive --folder INBOX --uids 1921,1922 --json
171
- email organize trash --folder INBOX --uids 1800 --json
172
- email organize move --folder INBOX --uids 100 --destination Archive --json
173
- email organize set-labels --folder INBOX --uids 42 --labels "work,priority" --json
174
- email organize create-folder --path "Projects/2026" --json
175
- email organize rename-folder --old-path "Projects" --new-path "Work/Projects" --json
176
- email organize delete-folder --path "OldFolder" --json
177
- ```
62
+ ## mail_compose
178
63
 
179
- ### `email sync [action]`
64
+ Compose and send email: send new message, reply, forward, save/update/send a draft.
180
65
 
181
- Manage IMAP connection and sync local SQLite state. Default action: `sync`.
66
+ Use when: Send, reply, forward, or save and manage a draft after its content is agreed.
182
67
 
183
- ```bash
184
- email sync --json # sync all folders (default)
185
- email sync sync --folders INBOX,Sent --json
186
- email sync sync --bodies all --json # fetch all bodies
187
- email sync refresh-folders --json
188
- email sync connect --json
189
- email sync disconnect --json
190
- email sync watch --json # syncs then exits; continuous watching needs the library
191
- ```
192
-
193
- ---
68
+ Not for: Use mail_read to inspect an existing message without sending or saving content.
194
69
 
195
- ## Multi-Step Workflow Examples
70
+ Writes: writes_state.
196
71
 
197
- ### Triage inbox
72
+ | Parameter | Type | Required | Values / description |
73
+ | --- | --- | --- | --- |
74
+ | action | string | yes | send, reply, forward, save_draft, update_draft, send_draft. |
75
+ | folder | string | no | Source folder (required for reply/forward). |
76
+ | uid | integer | no | Source message UID (required for reply/forward/update_draft/send_draft). |
77
+ | input | object | no | ComposeInput / ReplyInput / ForwardInput payload. |
198
78
 
199
- ```bash
200
- # Get unread messages
201
- UNREAD=$(email read queue --unread-only --json)
202
- echo "$UNREAD" | jq '.entities[].id'
79
+ ## mail_organize
203
80
 
204
- # Archive a batch
205
- email organize archive --folder INBOX --uids 1,2,3 --json
206
- ```
81
+ Organize messages: mark read/unread/starred/answered, copy, move, archive, trash, junk, label, or manage folders.
207
82
 
208
- ### Read and reply
83
+ Use when: Change message flags, labels, destinations or folder organization.
209
84
 
210
- ```bash
211
- # Read a specific message
212
- MSG=$(email read message --folder INBOX --uid 1921 --json)
213
- echo "$MSG" | jq '.summary'
85
+ Not for: Use mail_read or mail_search when only inspection is requested.
214
86
 
215
- # Reply
216
- echo "Thanks, will do." | email compose reply --folder INBOX --uid 1921 --json
217
- ```
87
+ Writes: writes_state.
218
88
 
219
- ### Search and act
89
+ | Parameter | Type | Required | Values / description |
90
+ | --- | --- | --- | --- |
91
+ | action | string | yes | mark_read, mark_unread, star, unstar, mark_answered, copy, move, archive, trash, junk, not_junk, set_labels, add_labels, remove_labels, create_folder, rename_folder, delete_folder, subscribe_folder, unsubscribe_folder. |
92
+ | folder | string | no | Source folder (required for message actions). |
93
+ | uids | array | no | Message UIDs to act on. |
94
+ | destination | string | no | Destination folder (required for copy/move). |
95
+ | labels | array | no | Labels to set/add/remove. |
96
+ | path | string | no | Folder path (required for folder actions). |
97
+ | oldPath | string | no | Old folder path (required for rename_folder). |
98
+ | newPath | string | no | New folder path (required for rename_folder). |
220
99
 
221
- ```bash
222
- # Find all invoices from last month
223
- RESULTS=$(email search "invoice" --since 2026-02-01 --before 2026-03-01 --json)
224
- UIDS=$(echo "$RESULTS" | jq -r '.entities[].id' | tr '\n' ',' | sed 's/,$//')
100
+ ## mail_sync
225
101
 
226
- # Move them to an Archive folder
227
- email organize move --folder INBOX --uids "$UIDS" --destination Archive --json
228
- ```
102
+ Manage the IMAP connection lifecycle and sync local state: connect, disconnect, reconnect, sync folders, or refresh the folder list.
229
103
 
230
- ### Full sync then read
104
+ Use when: Connect, disconnect, reconnect, refresh folders or synchronize the cache.
231
105
 
232
- ```bash
233
- email sync --json
234
- email read queue --limit 20 --json
235
- ```
106
+ Not for: Use mail_read for cached content or the network watch stream for continuous monitoring.
236
107
 
237
- ### Export an attachment
238
-
239
- ```bash
240
- # List attachments
241
- ATTS=$(email read attachment --folder INBOX --uid 1921 --json)
242
- PART=$(echo "$ATTS" | jq -r '.entities[0].id')
243
-
244
- # Download raw bytes
245
- email read attachment --folder INBOX --uid 1921 --part-path "$PART" > attachment.pdf
246
- ```
247
-
248
- ---
108
+ Writes: writes_state.
249
109
 
250
- ## Error Handling for Agents
110
+ | Parameter | Type | Required | Values / description |
111
+ | --- | --- | --- | --- |
112
+ | action | string | yes | connect, disconnect, reconnect, sync, refresh_folders, watch. |
113
+ | folders | array | no | Folders to sync or watch (optional — defaults to all subscribed folders). |
114
+ | bodies | string | no | none, missing, all. Body fetch strategy for sync (default: missing). |
251
115
 
252
- - **Always check `outcome`** before acting on `entities`. Even exit code 0 can return `"no_op"`.
253
- - **Do not retry auth errors** (exit 3) — they require credential changes.
254
- - **On `needs_clarification`** (exit 6) — read `nextSteps` and ask the user for more information.
255
- - **On `error`** (exit 5) — the tool's `summary` and `nextSteps` contain actionable guidance.
256
- - **Network errors** (exit 4) — retry after a brief pause; check host/port if it persists.
116
+ ## Workflow guides
257
117
 
258
- ---
259
-
260
- ## Piping Patterns
261
-
262
- ```bash
263
- # Pipe body from stdin
264
- echo "Hello" | email compose send --to x@y.com --subject "Hi"
265
-
266
- # Export EML and forward to another tool
267
- email read eml --folder INBOX --uid 42 | mail -s "fwd" target@example.com
268
-
269
- # JSON pipeline
270
- email read queue --json | jq '.entities[] | select(.title | test("invoice"; "i")) | .id'
271
-
272
- # Quiet mode — only exit code matters
273
- email organize archive --folder INBOX --uids 42 --quiet && echo "archived"
274
- ```
275
-
276
- ---
118
+ - [triage-inbox](skills/email/references/triage-inbox.md): Process a full inbox from scratch: sync to get latest state, read message queue, selectively fetch bodies for decisions, then bulk-organize by priority.
119
+ - [read-and-reply](skills/email/references/read-and-reply.md): Read a message with full thread context, then compose and send a properly-threaded reply with quoted attribution.
120
+ - [connect-and-sync](skills/email/references/connect-and-sync.md): Establish or restore an IMAP connection, refresh the folder list, and pull new messages — handling first-run vs incremental scenarios.
121
+ - [search-and-act](skills/email/references/search-and-act.md): Find messages matching criteria (local FTS first, remote IMAP SEARCH as fallback), verify targets, then act — organize, reply, or present.
122
+ - [compose-and-send](skills/email/references/compose-and-send.md): Full draft lifecycle — save, review, update, then send — plus direct send, reply, and forward with proper threading and forwarded-header blocks.
123
+ - [organize-bulk](skills/email/references/organize-bulk.md): Bulk organize messages across folders — flagging, moving, archiving, labelling — and manage the folder hierarchy as part of the flow.
124
+ - [attachment-workflow](skills/email/references/attachment-workflow.md): Discover, inspect, and fetch email attachments on demand; embed attachments in outbound messages; and export or import full .eml files.
125
+ - [recover-from-disruption](skills/email/references/recover-from-disruption.md): Detect and recover from connection loss or IMAP/SMTP failures — reconnect with back-off, re-sync to reconcile state, and handle auth vs transient errors distinctly.
126
+ - [cli](skills/email/references/cli.md): Complete existing email CLI guide.
277
127
 
278
- ## What the CLI Does NOT Do
128
+ ## Principles
279
129
 
280
- - **No persistent daemon.** Every invocation opens a fresh IMAP connection and closes it cleanly.
281
- - **No continuous IDLE watch.** `email sync watch` syncs once and exits. For push-style updates,
282
- use `Mailbox.network.watch()` from the library directly.
283
- - **No interactive prompts.** All input comes from flags or stdin.
130
+ - Inspect before changing messages.
131
+ - Confirm recipients and content before sending.