@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.
- package/README.md +21 -9
- package/package.json +7 -7
- package/{claude/skills → skills/claude}/check-inbox/SKILL.md +5 -5
- package/{claude/skills → skills/claude}/compose/SKILL.md +8 -4
- package/{claude/skills → skills/claude}/email-digest/SKILL.md +5 -4
- package/{claude/skills → skills/claude}/email-forward/SKILL.md +8 -4
- package/{claude/skills → skills/claude}/email-reply/SKILL.md +8 -4
- package/{claude/skills → skills/claude}/email-search/SKILL.md +11 -7
- package/{claude/skills → skills/claude}/setup-inboxapi/SKILL.md +18 -5
- package/skills/codex/check-inbox/SKILL.md +37 -0
- package/skills/codex/compose/SKILL.md +54 -0
- package/skills/codex/email-digest/SKILL.md +57 -0
- package/skills/codex/email-forward/SKILL.md +54 -0
- package/skills/codex/email-reply/SKILL.md +55 -0
- package/skills/codex/email-search/SKILL.md +43 -0
- package/skills/codex/setup-inboxapi/SKILL.md +47 -0
- package/skills/gemini/check-inbox/SKILL.md +37 -0
- package/skills/gemini/compose/SKILL.md +54 -0
- package/skills/gemini/email-digest/SKILL.md +57 -0
- package/skills/gemini/email-forward/SKILL.md +54 -0
- package/skills/gemini/email-reply/SKILL.md +55 -0
- package/skills/gemini/email-search/SKILL.md +43 -0
- package/skills/gemini/setup-inboxapi/SKILL.md +56 -0
- package/{claude → skills}/hooks/email-activity-logger.js +16 -4
- package/skills/hooks/email-send-guard.js +93 -0
- package/skills/opencode/check-inbox.md +36 -0
- package/skills/opencode/compose.md +53 -0
- package/skills/opencode/email-digest.md +56 -0
- package/skills/opencode/email-forward.md +53 -0
- package/skills/opencode/email-reply.md +54 -0
- package/skills/opencode/email-search.md +36 -0
- package/skills/opencode/setup-inboxapi.md +55 -0
- package/claude/hooks/email-send-guard.js +0 -69
- /package/{claude → skills}/hooks/credential-check.js +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate a digest summary of recent email activity grouped by thread
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Email Digest
|
|
6
|
+
|
|
7
|
+
Generate a structured digest of recent email activity.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. **Determine timeframe**: Use `$ARGUMENTS` if provided (e.g., "today", "this week", "last 3 days"), otherwise default to "last 24 hours"
|
|
12
|
+
|
|
13
|
+
2. **Get account info**: Run: `npx -y @inboxapi/cli whoami` for the account email
|
|
14
|
+
|
|
15
|
+
3. **Get total count**: Run: `npx -y @inboxapi/cli get-email-count` for inbox statistics
|
|
16
|
+
|
|
17
|
+
4. **Fetch recent emails**: Run: `npx -y @inboxapi/cli get-emails --limit 50`
|
|
18
|
+
|
|
19
|
+
5. **Group by thread**: For threads with multiple emails, run `npx -y @inboxapi/cli get-thread --message-id "<message-id>"` to understand the conversation
|
|
20
|
+
|
|
21
|
+
6. **Generate digest** with these sections:
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
# Email Digest — <timeframe>
|
|
25
|
+
Account: <email>
|
|
26
|
+
|
|
27
|
+
## Summary
|
|
28
|
+
- Total emails in inbox: X
|
|
29
|
+
- Emails in this period: Y
|
|
30
|
+
- Unique senders: Z
|
|
31
|
+
- Threads with activity: N
|
|
32
|
+
|
|
33
|
+
## Active Threads
|
|
34
|
+
### 1. <Subject>
|
|
35
|
+
- Participants: alice@..., bob@...
|
|
36
|
+
- Messages in period: 3
|
|
37
|
+
- Latest: "Brief preview of most recent message..."
|
|
38
|
+
- Status: Awaiting your reply / You replied / FYI only
|
|
39
|
+
|
|
40
|
+
## New Emails (not in threads)
|
|
41
|
+
| From | Subject | Date |
|
|
42
|
+
|------|---------|------|
|
|
43
|
+
| ... | ... | ... |
|
|
44
|
+
|
|
45
|
+
## Needs Attention
|
|
46
|
+
- Emails you haven't replied to where you were directly addressed
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
7. **Offer actions**: "Would you like to reply to any of these, or read a specific email?"
|
|
50
|
+
|
|
51
|
+
## Notes
|
|
52
|
+
|
|
53
|
+
- All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
|
|
54
|
+
- Focus on actionable insights, not raw data
|
|
55
|
+
- Highlight emails that likely need a response
|
|
56
|
+
- Keep the digest concise — summarize, don't reproduce full emails
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Forward an email to someone with an optional message
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Email Forward
|
|
6
|
+
|
|
7
|
+
Help the user forward an email to another recipient.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. **Find the email to forward**:
|
|
12
|
+
- Try `npx -y @inboxapi/cli get-email "$ARGUMENTS"` first — if it succeeds, use that email
|
|
13
|
+
- If it fails (e.g., not a valid message ID), fall back to `npx -y @inboxapi/cli search-emails --subject "<query>"` with the argument
|
|
14
|
+
- If multiple results, show them and ask the user to pick one
|
|
15
|
+
|
|
16
|
+
2. **Show email content**: Display the email being forwarded:
|
|
17
|
+
```
|
|
18
|
+
--- Email to forward ---
|
|
19
|
+
From: <original sender>
|
|
20
|
+
Subject: <subject>
|
|
21
|
+
Date: <date>
|
|
22
|
+
---
|
|
23
|
+
<body preview, first 500 chars>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
3. **Resolve recipient**:
|
|
27
|
+
- Ask "Who do you want to forward this to?"
|
|
28
|
+
- Run: `npx -y @inboxapi/cli get-addressbook` to check for matching contacts
|
|
29
|
+
- Confirm the recipient email address
|
|
30
|
+
|
|
31
|
+
4. **Optional message**: Ask "Add a message? (or press enter to skip)"
|
|
32
|
+
|
|
33
|
+
5. **Preview**:
|
|
34
|
+
```
|
|
35
|
+
Forwarding to: <recipient>
|
|
36
|
+
Subject: Fwd: <original subject>
|
|
37
|
+
Your message: <optional message or "(none)">
|
|
38
|
+
Original email from: <sender>, <date>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
6. **Confirm**: Ask "Forward this email? (yes/no)"
|
|
42
|
+
|
|
43
|
+
7. **Send**: Run: `npx -y @inboxapi/cli forward-email --message-id "<id>" --to "<recipient>"` (add `--note "<message>"` if provided)
|
|
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 what's being forwarded before sending
|
|
52
|
+
- ALWAYS confirm before forwarding
|
|
53
|
+
- NEVER forward without explicit user confirmation
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Reply to an email with full thread context and send confirmation
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Email Reply
|
|
6
|
+
|
|
7
|
+
Help the user reply to an email with full thread context.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. **Find the email**:
|
|
12
|
+
- Try `npx -y @inboxapi/cli get-email "$ARGUMENTS"` first — if it succeeds, use that email
|
|
13
|
+
- 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
|
|
14
|
+
- If multiple results, present them and ask the user to pick one
|
|
15
|
+
|
|
16
|
+
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
|
|
17
|
+
|
|
18
|
+
3. **Display thread**: Show the conversation history in chronological order:
|
|
19
|
+
```
|
|
20
|
+
--- Thread: <subject> ---
|
|
21
|
+
|
|
22
|
+
[1] From: alice@example.com (Jan 15, 2:30 PM)
|
|
23
|
+
> Original message text...
|
|
24
|
+
|
|
25
|
+
[2] From: you@inboxapi.ai (Jan 15, 3:00 PM)
|
|
26
|
+
> Your previous reply...
|
|
27
|
+
|
|
28
|
+
[3] From: alice@example.com (Jan 15, 4:15 PM)
|
|
29
|
+
> Latest message you're replying to...
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
4. **Compose reply**: Ask the user what they want to say in their reply
|
|
33
|
+
|
|
34
|
+
5. **Preview**: Show the reply before sending:
|
|
35
|
+
```
|
|
36
|
+
Replying to: alice@example.com
|
|
37
|
+
Subject: Re: <subject>
|
|
38
|
+
---
|
|
39
|
+
<reply body>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
6. **Confirm**: Ask "Send this reply? (yes/no)"
|
|
43
|
+
|
|
44
|
+
7. **Send**: Run: `npx -y @inboxapi/cli send-reply --message-id "<id>" --body "<reply>"`
|
|
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 the thread context before composing
|
|
53
|
+
- ALWAYS preview and confirm before sending
|
|
54
|
+
- NEVER send without explicit user confirmation
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Search InboxAPI emails using natural language by sender, subject, date, or content
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Email Search
|
|
6
|
+
|
|
7
|
+
Search emails using natural language and present results clearly.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. Take the user's query from `$ARGUMENTS`
|
|
12
|
+
- If no arguments provided, ask: "What are you looking for?"
|
|
13
|
+
|
|
14
|
+
2. Translate the natural language query into CLI flags for `search-emails`:
|
|
15
|
+
- Extract sender hints (e.g., "from John" -> `--sender "John"`)
|
|
16
|
+
- Extract subject hints (e.g., "about invoices" -> `--subject "invoices"`)
|
|
17
|
+
- Extract date hints (e.g., "last week", "yesterday" -> `--since "..."`, `--until "..."`)
|
|
18
|
+
- Combine with `--limit` as needed
|
|
19
|
+
|
|
20
|
+
3. Run: `npx -y @inboxapi/cli search-emails` with the appropriate flags (`--sender "..."`, `--subject "..."`, `--since "..."`, `--until "..."`)
|
|
21
|
+
|
|
22
|
+
4. Present results in a formatted table:
|
|
23
|
+
```
|
|
24
|
+
| # | From | Subject | Date |
|
|
25
|
+
|---|------|---------|------|
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
5. After showing results, offer: "Would you like to read any of these emails? Provide the number."
|
|
29
|
+
|
|
30
|
+
6. If the user picks one, run `npx -y @inboxapi/cli get-email "<message-id>"` with the email ID
|
|
31
|
+
|
|
32
|
+
7. If no results, suggest alternative searches or broader terms
|
|
33
|
+
|
|
34
|
+
## Notes
|
|
35
|
+
|
|
36
|
+
- All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Set up InboxAPI email tools for your AI coding agent
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Setup InboxAPI
|
|
6
|
+
|
|
7
|
+
Configure InboxAPI email tools for this project.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. **Check current setup**: Look for existing MCP server configuration files
|
|
12
|
+
|
|
13
|
+
2. **Add MCP server** (if not already configured):
|
|
14
|
+
- For OpenCode: Add to `opencode.json` under `mcp`:
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcp": {
|
|
18
|
+
"inboxapi": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "@inboxapi/cli"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
3. **Install skills**: Run `npx -y @inboxapi/cli setup-skills` to copy bundled skills into the project
|
|
27
|
+
|
|
28
|
+
4. **Verify credentials**:
|
|
29
|
+
- Run: `npx -y @inboxapi/cli whoami` to check if credentials are set up
|
|
30
|
+
- If not authenticated, instruct the user: "Run `npx -y @inboxapi/cli login` in a terminal to authenticate"
|
|
31
|
+
|
|
32
|
+
5. **Show summary**:
|
|
33
|
+
```
|
|
34
|
+
InboxAPI Setup Complete!
|
|
35
|
+
|
|
36
|
+
MCP Server: configured
|
|
37
|
+
Email: <email> (or "not authenticated yet")
|
|
38
|
+
|
|
39
|
+
Installed Skills:
|
|
40
|
+
/check-inbox — View inbox summary
|
|
41
|
+
/compose — Write and send emails
|
|
42
|
+
/email-search — Search emails
|
|
43
|
+
/email-reply — Reply with thread context
|
|
44
|
+
/email-digest — Email activity digest
|
|
45
|
+
/email-forward — Forward emails
|
|
46
|
+
|
|
47
|
+
Next steps:
|
|
48
|
+
- Run /check-inbox to see your emails
|
|
49
|
+
- Run /compose to send your first email
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
|
|
54
|
+
- All CLI commands output JSON by default — parse the JSON response to extract the relevant fields
|
|
55
|
+
- This skill is safe to run multiple times — it won't duplicate entries or overwrite local edits
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// InboxAPI Email Send Guard — PreToolUse hook
|
|
3
|
-
// Reviews outbound emails before sending. Logs details to stderr for user visibility.
|
|
4
|
-
// Exit 0 = allow
|
|
5
|
-
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
|
|
8
|
-
function main() {
|
|
9
|
-
const input = fs.readFileSync(0, "utf8");
|
|
10
|
-
let data;
|
|
11
|
-
try {
|
|
12
|
-
data = JSON.parse(input);
|
|
13
|
-
} catch {
|
|
14
|
-
process.exit(0);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const toolName = data.tool_name || "";
|
|
18
|
-
const toolInput = data.tool_input || {};
|
|
19
|
-
|
|
20
|
-
// Only inspect send-related tools
|
|
21
|
-
if (
|
|
22
|
-
!toolName.includes("send_email") &&
|
|
23
|
-
!toolName.includes("send_reply") &&
|
|
24
|
-
!toolName.includes("forward_email")
|
|
25
|
-
) {
|
|
26
|
-
process.exit(0);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const rawTo = toolInput.to || toolInput.recipient || "(unknown)";
|
|
30
|
-
const toList = Array.isArray(rawTo) ? rawTo : [rawTo];
|
|
31
|
-
const toDisplay = toList.join(", ");
|
|
32
|
-
const subject = toolInput.subject || "(no subject)";
|
|
33
|
-
const body = toolInput.body || toolInput.message || "";
|
|
34
|
-
const action = toolName.includes("forward")
|
|
35
|
-
? "FORWARD"
|
|
36
|
-
: toolName.includes("reply")
|
|
37
|
-
? "REPLY"
|
|
38
|
-
: "SEND";
|
|
39
|
-
|
|
40
|
-
// Log details to stderr so the user sees them in the Claude Code UI
|
|
41
|
-
process.stderr.write(`\n[InboxAPI Send Guard] ${action}\n`);
|
|
42
|
-
process.stderr.write(` To: ${toDisplay}\n`);
|
|
43
|
-
process.stderr.write(` Subject: ${subject}\n`);
|
|
44
|
-
if (body.length > 0) {
|
|
45
|
-
const preview = body.length > 200 ? body.substring(0, 200) + "..." : body;
|
|
46
|
-
process.stderr.write(` Body: ${preview}\n`);
|
|
47
|
-
}
|
|
48
|
-
process.stderr.write("\n");
|
|
49
|
-
|
|
50
|
-
// Check for self-send (common AI agent mistake)
|
|
51
|
-
const hasInboxApiRecipient = toList.some(
|
|
52
|
-
(addr) => typeof addr === "string" && (addr.includes("@inboxapi.ai") || addr.includes("@inboxapi.com")),
|
|
53
|
-
);
|
|
54
|
-
if (hasInboxApiRecipient) {
|
|
55
|
-
process.stderr.write(
|
|
56
|
-
` [WARNING] Recipient is an @inboxapi address. Did you mean to send to an external address?\n\n`,
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Check for empty body
|
|
61
|
-
if (body.trim().length === 0) {
|
|
62
|
-
process.stderr.write(` [WARNING] Email body is empty.\n\n`);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Allow by default — the user sees the preview and can deny via Claude Code's permission prompt
|
|
66
|
-
process.exit(0);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
main();
|
|
File without changes
|