@inboxapi/cli 0.3.0 → 0.3.2

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.
Files changed (34) hide show
  1. package/README.md +21 -9
  2. package/package.json +7 -7
  3. package/{claude/skills → skills/claude}/check-inbox/SKILL.md +5 -5
  4. package/{claude/skills → skills/claude}/compose/SKILL.md +8 -4
  5. package/{claude/skills → skills/claude}/email-digest/SKILL.md +5 -4
  6. package/{claude/skills → skills/claude}/email-forward/SKILL.md +8 -4
  7. package/{claude/skills → skills/claude}/email-reply/SKILL.md +8 -4
  8. package/{claude/skills → skills/claude}/email-search/SKILL.md +11 -7
  9. package/{claude/skills → skills/claude}/setup-inboxapi/SKILL.md +18 -5
  10. package/skills/codex/check-inbox/SKILL.md +37 -0
  11. package/skills/codex/compose/SKILL.md +54 -0
  12. package/skills/codex/email-digest/SKILL.md +57 -0
  13. package/skills/codex/email-forward/SKILL.md +54 -0
  14. package/skills/codex/email-reply/SKILL.md +55 -0
  15. package/skills/codex/email-search/SKILL.md +43 -0
  16. package/skills/codex/setup-inboxapi/SKILL.md +47 -0
  17. package/skills/gemini/check-inbox/SKILL.md +37 -0
  18. package/skills/gemini/compose/SKILL.md +54 -0
  19. package/skills/gemini/email-digest/SKILL.md +57 -0
  20. package/skills/gemini/email-forward/SKILL.md +54 -0
  21. package/skills/gemini/email-reply/SKILL.md +55 -0
  22. package/skills/gemini/email-search/SKILL.md +43 -0
  23. package/skills/gemini/setup-inboxapi/SKILL.md +56 -0
  24. package/{claude → skills}/hooks/email-activity-logger.js +16 -4
  25. package/skills/hooks/email-send-guard.js +93 -0
  26. package/skills/opencode/check-inbox.md +36 -0
  27. package/skills/opencode/compose.md +53 -0
  28. package/skills/opencode/email-digest.md +56 -0
  29. package/skills/opencode/email-forward.md +53 -0
  30. package/skills/opencode/email-reply.md +54 -0
  31. package/skills/opencode/email-search.md +36 -0
  32. package/skills/opencode/setup-inboxapi.md +55 -0
  33. package/claude/hooks/email-send-guard.js +0 -69
  34. /package/{claude → skills}/hooks/credential-check.js +0 -0
package/README.md CHANGED
@@ -147,11 +147,13 @@ inboxapi restore ./my-backup
147
147
 
148
148
  ### `setup-skills`
149
149
 
150
- Installs Claude Code skills (slash commands) and hooks into the current project. Skills add email workflows like `/check-inbox`, `/compose`, and `/email-search` directly into Claude Code. Hooks provide automatic credential checks, email send guardrails, and activity logging.
150
+ Installs InboxAPI skills for AI coding agents. Supports **Claude Code**, **Codex CLI**, **Gemini CLI**, and **OpenCode**. Auto-detects installed agents and prompts for confirmation, or use flags for non-interactive installation.
151
151
 
152
152
  ```bash
153
- inboxapi setup-skills
154
- inboxapi setup-skills --force # Overwrite existing skills and hooks
153
+ inboxapi setup-skills # Auto-detect agents, interactive prompt
154
+ inboxapi setup-skills --all # Install for all 4 agents
155
+ inboxapi setup-skills --claude --codex # Install for specific agents
156
+ inboxapi setup-skills --force # Overwrite existing skills and hooks
155
157
  ```
156
158
 
157
159
  ## CLI Commands
@@ -279,14 +281,24 @@ When prompted, enter:
279
281
  codex mcp add inboxapi inboxapi
280
282
  ```
281
283
 
282
- ## Skills for Claude Code
284
+ ## Skills for AI Coding Agents
283
285
 
284
- InboxAPI includes a set of skills — Claude Code slash commands that add guided email workflows to your project. Install them with:
286
+ InboxAPI includes skills — slash commands and guided workflows for multiple AI coding agents. Install them with:
285
287
 
286
288
  ```bash
287
- inboxapi setup-skills
289
+ inboxapi setup-skills # Auto-detect and install
290
+ inboxapi setup-skills --all # Install for all agents
288
291
  ```
289
292
 
293
+ Skills are installed to agent-specific directories:
294
+
295
+ | Agent | Install Directory |
296
+ |-------|-------------------|
297
+ | Claude Code | `.claude/skills/` |
298
+ | Codex CLI | `.agents/skills/` |
299
+ | Gemini CLI | `.gemini/skills/` |
300
+ | OpenCode | `.opencode/commands/` |
301
+
290
302
  ### Available Skills
291
303
 
292
304
  | Skill | Description |
@@ -297,11 +309,11 @@ inboxapi setup-skills
297
309
  | `/email-reply` | Reply to an email with full thread context and preview before sending |
298
310
  | `/email-digest` | Generate a structured digest of recent email activity grouped by threads |
299
311
  | `/email-forward` | Forward an email to another recipient with an optional note |
300
- | `/setup-inboxapi` | Configure InboxAPI MCP server and install skills into a Claude Code project |
312
+ | `/setup-inboxapi` | Configure InboxAPI MCP server and install skills for your AI coding agent |
301
313
 
302
- ### Hooks
314
+ ### Hooks (Claude Code only)
303
315
 
304
- The `setup-skills` command also installs three hooks that run automatically:
316
+ The `setup-skills` command also installs three hooks for Claude Code that run automatically:
305
317
 
306
318
  | Hook | Type | Description |
307
319
  |------|------|-------------|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inboxapi/cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "📧 Email for your AI 🤖",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "files": [
10
10
  "index.js",
11
- "claude"
11
+ "skills"
12
12
  ],
13
13
  "repository": {
14
14
  "type": "git",
@@ -28,10 +28,10 @@
28
28
  "test": "cargo test"
29
29
  },
30
30
  "optionalDependencies": {
31
- "@inboxapi/cli-darwin-arm64": "0.3.0",
32
- "@inboxapi/cli-darwin-x64": "0.3.0",
33
- "@inboxapi/cli-linux-arm64": "0.3.0",
34
- "@inboxapi/cli-linux-x64": "0.3.0",
35
- "@inboxapi/cli-win32-x64": "0.3.0"
31
+ "@inboxapi/cli-darwin-arm64": "0.3.2",
32
+ "@inboxapi/cli-darwin-x64": "0.3.2",
33
+ "@inboxapi/cli-linux-arm64": "0.3.2",
34
+ "@inboxapi/cli-linux-x64": "0.3.2",
35
+ "@inboxapi/cli-win32-x64": "0.3.2"
36
36
  }
37
37
  }
@@ -11,10 +11,9 @@ Fetch and display a summary of recent emails from the user's InboxAPI inbox.
11
11
 
12
12
  ## Steps
13
13
 
14
- 1. Call the `mcp__inboxapi__whoami` tool to identify the current account and email address
15
- 2. Call `mcp__inboxapi__get_email_count` to show the total number of emails
16
- 3. Call `mcp__inboxapi__get_emails` with:
17
- - `limit`: Use `$ARGUMENTS` if provided, otherwise default to `20`
14
+ 1. Run: `npx -y @inboxapi/cli whoami` to identify the current account and email address
15
+ 2. Run: `npx -y @inboxapi/cli get-email-count` to show the total number of emails
16
+ 3. Run: `npx -y @inboxapi/cli get-emails --limit <N>` where `<N>` is `$ARGUMENTS` if provided, otherwise `20`
18
17
  4. Present results in a formatted table with columns:
19
18
  - **From** — sender name or address
20
19
  - **Subject** — email subject line (truncated to 60 chars)
@@ -35,5 +34,6 @@ If the inbox is empty, display: "Your inbox is empty. Your email address is <ema
35
34
 
36
35
  ## Notes
37
36
 
37
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
38
38
  - Do NOT read full email bodies — only show the summary list
39
- - If the user asks to read a specific email after seeing the list, use `mcp__inboxapi__get_email` with the email ID
39
+ - If the user asks to read a specific email after seeing the list, run `npx -y @inboxapi/cli get-email "<message-id>"` with the email ID
@@ -12,11 +12,11 @@ Guide the user through composing and sending an email safely.
12
12
 
13
13
  ## Steps
14
14
 
15
- 1. **Identify sender**: Call `mcp__inboxapi__whoami` to get the current account email address
15
+ 1. **Identify sender**: Run: `npx -y @inboxapi/cli whoami` to get the current account email address
16
16
 
17
17
  2. **Resolve recipient**:
18
18
  - If `$ARGUMENTS` is provided, use it as the recipient hint
19
- - Call `mcp__inboxapi__get_addressbook` to check for matching contacts
19
+ - Run: `npx -y @inboxapi/cli get-addressbook` to check for matching contacts
20
20
  - If multiple matches found, ask the user to pick one
21
21
  - If no match, ask the user to confirm or provide the full email address
22
22
 
@@ -41,13 +41,17 @@ Guide the user through composing and sending an email safely.
41
41
 
42
42
  6. **Confirm**: Ask the user to confirm: "Send this email? (yes/no)"
43
43
 
44
- 7. **Send**: Call `mcp__inboxapi__send_email` with `to`, `subject`, and `body`
44
+ 7. **Send**: Run: `npx -y @inboxapi/cli send-email --to "<recipient>" --subject "<subject>" --body "<body>"`
45
45
 
46
46
  8. **Confirm delivery**: Report the result to the user
47
47
 
48
+ ## Notes
49
+
50
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
51
+
48
52
  ## Rules
49
53
 
50
54
  - ALWAYS show a preview before sending
51
- - ALWAYS ask for explicit confirmation before calling send_email
55
+ - ALWAYS ask for explicit confirmation before calling send-email
52
56
  - NEVER send an email without the user confirming
53
57
  - If the user cancels, acknowledge and do not send
@@ -13,13 +13,13 @@ Generate a structured digest of recent email activity.
13
13
 
14
14
  1. **Determine timeframe**: Use `$ARGUMENTS` if provided (e.g., "today", "this week", "last 3 days"), otherwise default to "last 24 hours"
15
15
 
16
- 2. **Get account info**: Call `mcp__inboxapi__whoami` for the account email
16
+ 2. **Get account info**: Run: `npx -y @inboxapi/cli whoami` for the account email
17
17
 
18
- 3. **Get total count**: Call `mcp__inboxapi__get_email_count` for inbox statistics
18
+ 3. **Get total count**: Run: `npx -y @inboxapi/cli get-email-count` for inbox statistics
19
19
 
20
- 4. **Fetch recent emails**: Call `mcp__inboxapi__get_emails` with an appropriate limit (50 for digest)
20
+ 4. **Fetch recent emails**: Run: `npx -y @inboxapi/cli get-emails --limit 50`
21
21
 
22
- 5. **Group by thread**: For threads with multiple emails, call `mcp__inboxapi__get_thread` to understand the conversation
22
+ 5. **Group by thread**: For threads with multiple emails, run `npx -y @inboxapi/cli get-thread --message-id "<message-id>"` to understand the conversation
23
23
 
24
24
  6. **Generate digest** with these sections:
25
25
 
@@ -53,6 +53,7 @@ Generate a structured digest of recent email activity.
53
53
 
54
54
  ## Notes
55
55
 
56
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
56
57
  - Focus on actionable insights, not raw data
57
58
  - Highlight emails that likely need a response
58
59
  - Keep the digest concise — summarize, don't reproduce full emails
@@ -13,8 +13,8 @@ Help the user forward an email to another recipient.
13
13
  ## Steps
14
14
 
15
15
  1. **Find the email to forward**:
16
- - If `$ARGUMENTS` looks like an email ID, call `mcp__inboxapi__get_email` directly
17
- - Otherwise, call `mcp__inboxapi__search_emails` with the argument
16
+ - Try `npx -y @inboxapi/cli get-email "$ARGUMENTS"` first if it succeeds, use that email
17
+ - If it fails (e.g., not a valid message ID), fall back to `npx -y @inboxapi/cli search-emails --subject "<query>"` with the argument
18
18
  - If multiple results, show them and ask the user to pick one
19
19
 
20
20
  2. **Show email content**: Display the email being forwarded:
@@ -29,7 +29,7 @@ Help the user forward an email to another recipient.
29
29
 
30
30
  3. **Resolve recipient**:
31
31
  - Ask "Who do you want to forward this to?"
32
- - Call `mcp__inboxapi__get_addressbook` to check for matching contacts
32
+ - Run: `npx -y @inboxapi/cli get-addressbook` to check for matching contacts
33
33
  - Confirm the recipient email address
34
34
 
35
35
  4. **Optional message**: Ask "Add a message? (or press enter to skip)"
@@ -44,7 +44,11 @@ Help the user forward an email to another recipient.
44
44
 
45
45
  6. **Confirm**: Ask "Forward this email? (yes/no)"
46
46
 
47
- 7. **Send**: Call `mcp__inboxapi__forward_email` with the email ID, recipient, and optional message
47
+ 7. **Send**: Run: `npx -y @inboxapi/cli forward-email --message-id "<id>" --to "<recipient>"` (add `--note "<message>"` if provided)
48
+
49
+ ## Notes
50
+
51
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
48
52
 
49
53
  ## Rules
50
54
 
@@ -13,11 +13,11 @@ Help the user reply to an email with full thread context.
13
13
  ## Steps
14
14
 
15
15
  1. **Find the email**:
16
- - If `$ARGUMENTS` looks like an email ID (alphanumeric string), call `mcp__inboxapi__get_email` directly
17
- - Otherwise, call `mcp__inboxapi__search_emails` with the argument as subject/keyword
16
+ - Try `npx -y @inboxapi/cli get-email "$ARGUMENTS"` first — if it succeeds, use that email
17
+ - If it fails (e.g., not a valid message ID), fall back to `npx -y @inboxapi/cli search-emails --subject "<query>"` with the argument as subject/keyword
18
18
  - If multiple results, present them and ask the user to pick one
19
19
 
20
- 2. **Load thread context**: Call `mcp__inboxapi__get_thread` with the email's thread ID to show the full conversation
20
+ 2. **Load thread context**: Run: `npx -y @inboxapi/cli get-thread --message-id "<message-id>"` with the email's message ID to show the full conversation
21
21
 
22
22
  3. **Display thread**: Show the conversation history in chronological order:
23
23
  ```
@@ -45,7 +45,11 @@ Help the user reply to an email with full thread context.
45
45
 
46
46
  6. **Confirm**: Ask "Send this reply? (yes/no)"
47
47
 
48
- 7. **Send**: Call `mcp__inboxapi__send_reply` with the email ID and reply body
48
+ 7. **Send**: Run: `npx -y @inboxapi/cli send-reply --message-id "<id>" --body "<reply>"`
49
+
50
+ ## Notes
51
+
52
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
49
53
 
50
54
  ## Rules
51
55
 
@@ -14,13 +14,13 @@ Search emails using natural language and present results clearly.
14
14
  1. Take the user's query from `$ARGUMENTS`
15
15
  - If no arguments provided, ask: "What are you looking for?"
16
16
 
17
- 2. Translate the natural language query into a `mcp__inboxapi__search_emails` call:
18
- - Extract sender hints (e.g., "from John" -> search by sender)
19
- - Extract subject hints (e.g., "about invoices" -> search by subject)
20
- - Extract date hints (e.g., "last week", "yesterday")
21
- - Use the full query as the search term
17
+ 2. Translate the natural language query into CLI flags for `search-emails`:
18
+ - Extract sender hints (e.g., "from John" -> `--sender "John"`)
19
+ - Extract subject hints (e.g., "about invoices" -> `--subject "invoices"`)
20
+ - Extract date hints (e.g., "last week", "yesterday" -> `--since "..."`, `--until "..."`)
21
+ - Combine with `--limit` as needed
22
22
 
23
- 3. Call `mcp__inboxapi__search_emails` with the interpreted parameters
23
+ 3. Run: `npx -y @inboxapi/cli search-emails` with the appropriate flags (`--sender "..."`, `--subject "..."`, `--since "..."`, `--until "..."`)
24
24
 
25
25
  4. Present results in a formatted table:
26
26
  ```
@@ -30,10 +30,14 @@ Search emails using natural language and present results clearly.
30
30
 
31
31
  5. After showing results, offer: "Would you like to read any of these emails? Provide the number."
32
32
 
33
- 6. If the user picks one, call `mcp__inboxapi__get_email` with the email ID
33
+ 6. If the user picks one, run `npx -y @inboxapi/cli get-email "<message-id>"` with the email ID
34
34
 
35
35
  7. If no results, suggest alternative searches or broader terms
36
36
 
37
+ ## Notes
38
+
39
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
40
+
37
41
  ## Examples
38
42
 
39
43
  - `/email-search invoices from accounting` -> search for "invoices" filtered by sender containing "accounting"
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: setup-inboxapi
3
- description: Set up InboxAPI email tools in your Claude Code project. Adds MCP server config, installs skills, and configures safety hooks. Use when the user wants to configure InboxAPI for their project.
3
+ description: Set up InboxAPI email tools in your AI coding agent. Adds MCP server config, installs skills, and configures safety hooks. Use when the user wants to configure InboxAPI for their project.
4
4
  user-invocable: true
5
5
  disable-model-invocation: true
6
6
  ---
7
7
 
8
8
  # Setup InboxAPI
9
9
 
10
- Configure InboxAPI email tools for this Claude Code project.
10
+ Configure InboxAPI email tools for this project. Supports Claude Code, Codex CLI, Gemini CLI, and OpenCode.
11
11
 
12
12
  ## Steps
13
13
 
@@ -28,10 +28,22 @@ Configure InboxAPI email tools for this Claude Code project.
28
28
  }
29
29
  ```
30
30
 
31
- 3. **Install skills**: Run `npx -y @inboxapi/cli setup-skills` to copy bundled skills and hooks into the project's `.claude/` directory
31
+ **For other agents:**
32
+ - **Codex CLI**: `codex mcp add inboxapi -- npx -y @inboxapi/cli`
33
+ - **Gemini CLI**: Add to `settings.json` under `mcpServers`:
34
+ ```json
35
+ { "mcpServers": { "inboxapi": { "command": "npx", "args": ["-y", "@inboxapi/cli"] } } }
36
+ ```
37
+ - **OpenCode**: Add to `opencode.json` under `mcp`:
38
+ ```json
39
+ { "mcp": { "inboxapi": { "command": "npx", "args": ["-y", "@inboxapi/cli"] } } }
40
+ ```
41
+
42
+ 3. **Install skills**: Run `npx -y @inboxapi/cli setup-skills` to install skills for detected agents
43
+ - Use `--all` to install for all agents, or `--claude`, `--codex`, `--gemini`, `--opencode` for specific ones
32
44
 
33
45
  4. **Verify credentials**:
34
- - Call `mcp__inboxapi__whoami` to check if credentials are set up
46
+ - Run: `npx -y @inboxapi/cli whoami` to check if credentials are set up
35
47
  - If not authenticated, instruct the user: "Run `npx -y @inboxapi/cli login` in a terminal to authenticate"
36
48
 
37
49
  5. **Show summary**:
@@ -49,7 +61,7 @@ Configure InboxAPI email tools for this Claude Code project.
49
61
  /email-digest — Email activity digest
50
62
  /email-forward — Forward emails
51
63
 
52
- Installed Hooks:
64
+ Installed Hooks (Claude Code only):
53
65
  PreToolUse — Email send guard (reviews before sending)
54
66
  PostToolUse — Activity logger (audit trail)
55
67
  SessionStart — Credential check (verifies auth on startup)
@@ -61,6 +73,7 @@ Configure InboxAPI email tools for this Claude Code project.
61
73
 
62
74
  ## Notes
63
75
 
76
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
64
77
  - This skill is safe to run multiple times — it won't duplicate entries or overwrite local edits
65
78
  - Existing `.mcp.json` entries, skill files, and hook files with local edits are preserved
66
79
  - `.claude/settings.json` is merged with new hook config (may be reformatted when hooks are updated)
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: check-inbox
3
+ description: "Check your InboxAPI email inbox and display a summary of recent messages. Use when the user wants to see their emails, check mail, or view their inbox."
4
+ ---
5
+
6
+ # Check Inbox
7
+
8
+ Fetch and display a summary of recent emails from the user's InboxAPI inbox.
9
+
10
+ ## Steps
11
+
12
+ 1. Run: `npx -y @inboxapi/cli whoami` to identify the current account and email address
13
+ 2. Run: `npx -y @inboxapi/cli get-email-count` to show the total number of emails
14
+ 3. Run: `npx -y @inboxapi/cli get-emails --limit <N>` where `<N>` is `$ARGUMENTS` if provided, otherwise `20`
15
+ 4. Present results in a formatted table with columns:
16
+ - **From** — sender name or address
17
+ - **Subject** — email subject line (truncated to 60 chars)
18
+ - **Date** — received date in relative format (e.g., "2 hours ago", "yesterday")
19
+ 5. After the table, show a summary line: "Showing X of Y emails for <email>"
20
+
21
+ ## Output Format
22
+
23
+ Use this markdown table format:
24
+
25
+ ```
26
+ | # | From | Subject | Date |
27
+ |---|------|---------|------|
28
+ | 1 | Alice <alice@example.com> | Re: Project update... | 2h ago |
29
+ ```
30
+
31
+ If the inbox is empty, display: "Your inbox is empty. Your email address is <email>."
32
+
33
+ ## Notes
34
+
35
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
36
+ - Do NOT read full email bodies — only show the summary list
37
+ - If the user asks to read a specific email after seeing the list, run `npx -y @inboxapi/cli get-email "<message-id>"` with the email ID
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: compose
3
+ description: "Compose and send an email with guided prompts, addressbook lookup, and send confirmation. Use when the user wants to write and send an email."
4
+ ---
5
+
6
+ # Compose Email
7
+
8
+ Guide the user through composing and sending an email safely.
9
+
10
+ ## Steps
11
+
12
+ 1. **Identify sender**: Run: `npx -y @inboxapi/cli whoami` to get the current account email address
13
+
14
+ 2. **Resolve recipient**:
15
+ - If `$ARGUMENTS` is provided, use it as the recipient hint
16
+ - Run: `npx -y @inboxapi/cli get-addressbook` to check for matching contacts
17
+ - If multiple matches found, ask the user to pick one
18
+ - If no match, ask the user to confirm or provide the full email address
19
+
20
+ 3. **Collect email details**: Ask the user for:
21
+ - **To**: Recipient email (pre-filled if resolved above)
22
+ - **Subject**: Email subject line
23
+ - **Body**: Email content (plain text)
24
+
25
+ 4. **Preview**: Show the complete email before sending:
26
+ ```
27
+ From: <your-email@inboxapi.ai>
28
+ To: <recipient@example.com>
29
+ Subject: <subject>
30
+ ---
31
+ <body>
32
+ ```
33
+
34
+ 5. **Safety checks**:
35
+ - Warn if the recipient address matches the sender's own @inboxapi.ai address
36
+ - Warn if the body is empty
37
+ - Warn if the subject is empty
38
+
39
+ 6. **Confirm**: Ask the user to confirm: "Send this email? (yes/no)"
40
+
41
+ 7. **Send**: Run: `npx -y @inboxapi/cli send-email --to "<recipient>" --subject "<subject>" --body "<body>"`
42
+
43
+ 8. **Confirm delivery**: Report the result to the user
44
+
45
+ ## Notes
46
+
47
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
48
+
49
+ ## Rules
50
+
51
+ - ALWAYS show a preview before sending
52
+ - ALWAYS ask for explicit confirmation before calling send-email
53
+ - NEVER send an email without the user confirming
54
+ - If the user cancels, acknowledge and do not send
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: email-digest
3
+ description: "Generate a digest summary of recent email activity grouped by thread. Use when the user wants an overview of their email activity."
4
+ ---
5
+
6
+ # Email Digest
7
+
8
+ Generate a structured digest of recent email activity.
9
+
10
+ ## Steps
11
+
12
+ 1. **Determine timeframe**: Use `$ARGUMENTS` if provided (e.g., "today", "this week", "last 3 days"), otherwise default to "last 24 hours"
13
+
14
+ 2. **Get account info**: Run: `npx -y @inboxapi/cli whoami` for the account email
15
+
16
+ 3. **Get total count**: Run: `npx -y @inboxapi/cli get-email-count` for inbox statistics
17
+
18
+ 4. **Fetch recent emails**: Run: `npx -y @inboxapi/cli get-emails --limit 50`
19
+
20
+ 5. **Group by thread**: For threads with multiple emails, run `npx -y @inboxapi/cli get-thread --message-id "<message-id>"` to understand the conversation
21
+
22
+ 6. **Generate digest** with these sections:
23
+
24
+ ```markdown
25
+ # Email Digest — <timeframe>
26
+ Account: <email>
27
+
28
+ ## Summary
29
+ - Total emails in inbox: X
30
+ - Emails in this period: Y
31
+ - Unique senders: Z
32
+ - Threads with activity: N
33
+
34
+ ## Active Threads
35
+ ### 1. <Subject>
36
+ - Participants: alice@..., bob@...
37
+ - Messages in period: 3
38
+ - Latest: "Brief preview of most recent message..."
39
+ - Status: Awaiting your reply / You replied / FYI only
40
+
41
+ ## New Emails (not in threads)
42
+ | From | Subject | Date |
43
+ |------|---------|------|
44
+ | ... | ... | ... |
45
+
46
+ ## Needs Attention
47
+ - Emails you haven't replied to where you were directly addressed
48
+ ```
49
+
50
+ 7. **Offer actions**: "Would you like to reply to any of these, or read a specific email?"
51
+
52
+ ## Notes
53
+
54
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
55
+ - Focus on actionable insights, not raw data
56
+ - Highlight emails that likely need a response
57
+ - Keep the digest concise — summarize, don't reproduce full emails
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: email-forward
3
+ description: "Forward an email to someone with an optional message. Use when the user wants to forward a specific email to another person."
4
+ ---
5
+
6
+ # Email Forward
7
+
8
+ Help the user forward an email to another recipient.
9
+
10
+ ## Steps
11
+
12
+ 1. **Find the email to forward**:
13
+ - Try `npx -y @inboxapi/cli get-email "$ARGUMENTS"` first — if it succeeds, use that email
14
+ - If it fails (e.g., not a valid message ID), fall back to `npx -y @inboxapi/cli search-emails --subject "<query>"` with the argument
15
+ - If multiple results, show them and ask the user to pick one
16
+
17
+ 2. **Show email content**: Display the email being forwarded:
18
+ ```
19
+ --- Email to forward ---
20
+ From: <original sender>
21
+ Subject: <subject>
22
+ Date: <date>
23
+ ---
24
+ <body preview, first 500 chars>
25
+ ```
26
+
27
+ 3. **Resolve recipient**:
28
+ - Ask "Who do you want to forward this to?"
29
+ - Run: `npx -y @inboxapi/cli get-addressbook` to check for matching contacts
30
+ - Confirm the recipient email address
31
+
32
+ 4. **Optional message**: Ask "Add a message? (or press enter to skip)"
33
+
34
+ 5. **Preview**:
35
+ ```
36
+ Forwarding to: <recipient>
37
+ Subject: Fwd: <original subject>
38
+ Your message: <optional message or "(none)">
39
+ Original email from: <sender>, <date>
40
+ ```
41
+
42
+ 6. **Confirm**: Ask "Forward this email? (yes/no)"
43
+
44
+ 7. **Send**: Run: `npx -y @inboxapi/cli forward-email --message-id "<id>" --to "<recipient>"` (add `--note "<message>"` if provided)
45
+
46
+ ## Notes
47
+
48
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
49
+
50
+ ## Rules
51
+
52
+ - ALWAYS show what's being forwarded before sending
53
+ - ALWAYS confirm before forwarding
54
+ - NEVER forward without explicit user confirmation
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: email-reply
3
+ description: "Reply to an email with full thread context. Use when the user wants to reply to a specific email or continue an email conversation."
4
+ ---
5
+
6
+ # Email Reply
7
+
8
+ Help the user reply to an email with full thread context.
9
+
10
+ ## Steps
11
+
12
+ 1. **Find the email**:
13
+ - Try `npx -y @inboxapi/cli get-email "$ARGUMENTS"` first — if it succeeds, use that email
14
+ - If it fails (e.g., not a valid message ID), fall back to `npx -y @inboxapi/cli search-emails --subject "<query>"` with the argument as subject/keyword
15
+ - If multiple results, present them and ask the user to pick one
16
+
17
+ 2. **Load thread context**: Run: `npx -y @inboxapi/cli get-thread --message-id "<message-id>"` with the email's message ID to show the full conversation
18
+
19
+ 3. **Display thread**: Show the conversation history in chronological order:
20
+ ```
21
+ --- Thread: <subject> ---
22
+
23
+ [1] From: alice@example.com (Jan 15, 2:30 PM)
24
+ > Original message text...
25
+
26
+ [2] From: you@inboxapi.ai (Jan 15, 3:00 PM)
27
+ > Your previous reply...
28
+
29
+ [3] From: alice@example.com (Jan 15, 4:15 PM)
30
+ > Latest message you're replying to...
31
+ ```
32
+
33
+ 4. **Compose reply**: Ask the user what they want to say in their reply
34
+
35
+ 5. **Preview**: Show the reply before sending:
36
+ ```
37
+ Replying to: alice@example.com
38
+ Subject: Re: <subject>
39
+ ---
40
+ <reply body>
41
+ ```
42
+
43
+ 6. **Confirm**: Ask "Send this reply? (yes/no)"
44
+
45
+ 7. **Send**: Run: `npx -y @inboxapi/cli send-reply --message-id "<id>" --body "<reply>"`
46
+
47
+ ## Notes
48
+
49
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
50
+
51
+ ## Rules
52
+
53
+ - ALWAYS show the thread context before composing
54
+ - ALWAYS preview and confirm before sending
55
+ - NEVER send without explicit user confirmation
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: email-search
3
+ description: "Search your InboxAPI emails using natural language. Use when the user wants to find specific emails by sender, subject, date, or content."
4
+ ---
5
+
6
+ # Email Search
7
+
8
+ Search emails using natural language and present results clearly.
9
+
10
+ ## Steps
11
+
12
+ 1. Take the user's query from `$ARGUMENTS`
13
+ - If no arguments provided, ask: "What are you looking for?"
14
+
15
+ 2. Translate the natural language query into CLI flags for `search-emails`:
16
+ - Extract sender hints (e.g., "from John" -> `--sender "John"`)
17
+ - Extract subject hints (e.g., "about invoices" -> `--subject "invoices"`)
18
+ - Extract date hints (e.g., "last week", "yesterday" -> `--since "..."`, `--until "..."`)
19
+ - Combine with `--limit` as needed
20
+
21
+ 3. Run: `npx -y @inboxapi/cli search-emails` with the appropriate flags (`--sender "..."`, `--subject "..."`, `--since "..."`, `--until "..."`)
22
+
23
+ 4. Present results in a formatted table:
24
+ ```
25
+ | # | From | Subject | Date |
26
+ |---|------|---------|------|
27
+ ```
28
+
29
+ 5. After showing results, offer: "Would you like to read any of these emails? Provide the number."
30
+
31
+ 6. If the user picks one, run `npx -y @inboxapi/cli get-email "<message-id>"` with the email ID
32
+
33
+ 7. If no results, suggest alternative searches or broader terms
34
+
35
+ ## Notes
36
+
37
+ - All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
38
+
39
+ ## Examples
40
+
41
+ - `/email-search invoices from accounting` -> search for "invoices" filtered by sender containing "accounting"
42
+ - `/email-search meeting tomorrow` -> search for "meeting" in recent emails
43
+ - `/email-search` -> prompt user for search query