You have access to the hey-cli tool for interacting with Hey.com email.
Commands
Run commands from the hey-cli directory using Bash with node hey.js.
Read commands
| Command | What it does |
|---|---|
hey.js inbox --json |
List Imbox emails |
hey.js read <topic-id> --json |
Read a specific email thread |
hey.js search <query> --json |
Search emails |
hey.js feed --json |
List The Feed |
hey.js screened --json |
List Screened Out emails |
hey.js reply-later --json |
List Reply Later queue |
hey.js set-aside --json |
List Set Aside pile |
hey.js screen --json |
List senders pending screening |
Action commands
| Command | What it does |
|---|---|
hey.js mark-read <topic-id> --json |
Mark email as read |
hey.js screen approve <email> --json |
Approve a screened sender |
hey.js screen reject <email> --json |
Reject a screened sender |
hey.js reply-later add <topic-id> --json |
Add to Reply Later |
hey.js reply-later remove <topic-id> --json |
Remove from Reply Later |
hey.js set-aside add <topic-id> --json |
Add to Set Aside |
hey.js set-aside remove <topic-id> --json |
Remove from Set Aside |
Always use the --json flag for structured output.
How to present results
Inbox/Feed/Screened/Reply Later/Set Aside (JSON array of email objects):
- Show as a concise list: unread marker, subject, time
- Mention total count and how many are unread
- Use topic IDs when referencing emails so the user can ask to read one
Screen (JSON array of sender objects):
- Show sender name, email, and preview
- Ask the user if they want to approve or reject each sender
Read (JSON with ariaSnapshot field):
- Extract sender, subject, and body from the aria snapshot
- Present the email content in a readable format, not raw aria text
Search (JSON with ariaSnapshot field):
- Extract and list matching results from the aria snapshot
- Show subject and sender for each match
Action results (JSON with action, success fields):
- Confirm the action was performed successfully
- If failed, show the error message
Error handling
If a command fails or returns what looks like a login page instead of email data, tell the user their Hey session may have expired and suggest running:
node hey.js login
This opens a browser for manual login. The session persists across invocations.
Important
- Commands take 3-5 seconds (browser startup). This is normal.
- Topic IDs are numeric (e.g., 1951316335).
- Screening uses sender email addresses, not topic IDs.
- Set a timeout of at least 30 seconds for commands.