hey
Original:🇺🇸 English
Translated
Interact with HEY via the HEY CLI. Read and send emails, manage contacts, boxes, labels, collections, calendars, todos, habits, time tracking, and journal entries. Use for ANY HEY-related question or action.
8installs
Sourcebasecamp/skills
Added on
NPX Install
npx skill4agent add basecamp/skills heyTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →/hey - HEY Email Workflow Command
CLI for HEY: mailboxes, labels, collections, email threads, contacts, replies, compose, calendars, todos, habits, time tracking, and journal entries.
Use the installed CLI as the command reference. This skill holds the rules that span commands; it does not copy the command catalog, because the binary's own help is the source of truth and always matches the version you are running.
Discovery-first workflow
For each task:
-
Infer the deepest plausible leaf command from the user's words.
-
Unless its arguments and flags are already established by a tool result in this conversation, read that leaf's help before running it:bash
hey <group> <subcommand> --agent --help -
If the leaf does not exist, read its nearest parent group. Use root help only when the top-level group itself is unclear:bash
hey <group> --agent --help # fallback hey --agent --help # last resort hey commands --json # every command with its agent_notes -
Treat the leaf's,
short,longandagent_notesas the source of truth. Do not guess positional arguments, flags, accepted values, or limits.flags -
Run with an explicit output mode, then read structured errors before deciding what to do next.
Leaf help is cheap; root help and print the whole catalog and are not. Global flags (, , , , ) apply wherever a command supports them.
hey commands --json--json--jq--quiet--account--statsNon-negotiable rules
- Choose the right structured output. Use to filter or extract fields and
--jq '<expression>'for the full response. Never pipe to an external--json;jqis built in and implies--jq.--json - Reuse stored authentication. Run the requested data command; it uses stored credentials and refreshes expiring OAuth tokens automatically. If it returns an auth error, follow the retry in Authentication before you report the task as blocked. Use when an explicit authentication check is needed (it reports stored credentials and does not contact HEY). Never run
hey auth status --jsonunattended; use it only for interactive recovery with the user present.hey auth login - Linked mail accounts share one login. Use , then
hey account list --jsonwhen a task must target one account.--account <id|all> - Local HEY configuration requires human trust. Never run without the user's explicit approval.
hey config trust-local - Never resend a send that failed with . See Sending.
not_delivered - Confirm box item mutations. See IDs: HEY does not report IDs that matched nothing.
Output
--jq.data--quiet --jqauth tokenshell-completion generatesetupskilltui--versiontimetrack export--output--jqhey watch--jqbash
hey box list --jq '.data[] | {id, name}'
hey search "quarterly planning" --jq '.data[].topic_id'
hey box list --quiet --jq '.[].name'- An empty result is an empty array rather than , so
nullis safe on a listing that found nothing..data[] - A field HEY's answer leaves out is left out, never guessed. A posting's is present only when true, so test
seenfor unseen..seen != true - prints one ID per line and
--ids-onlya bare number. They work on listings: every--countcommand, the thread listings,list,hey workflow view,hey search,hey screener history,hey event day|week,hey timetrack categoriesandhey attachment list(its entries, read from the index without bodies). Both answer for what was read, which is the first page unlesshey thread reador--allreads more, and not every listing warns that more pages exist;--limitis the exception and counts the whole queue. On thread listings they count the postings, not the box, label or contact around them.hey screener list --count - stops at a page cap, which each listing's help names. A capped read says where to continue:
--allfor a cursor listing such asnext_page, or thehey box view, naming thenoticevalue, for a numbered one such as--pageorhey search. Continue from there rather than treating the list as complete.hey contact list - writes the original HTML of
--html,hey thread readand a contact's private note to a pipe or file; a terminal is refused.hey journal read
IDs
Every email thread has two IDs: , its box item ID (one posting in one box), and , its thread ID. Each posting in a thread listing has , , ( for a bundle row), (subject), and ; a thread row also has , and .
idtopic_ididtopic_idkindbundlenamecreated_atapp_urlcontactssummaryvisible_entry_count- Box item ID ():
id,hey seen,unseen,move,label add|remove|create,trash,spam,ignore,stop-ignoring,bubble up|pop,set-aside groupandbulk-reply.bundle view - Thread ID ():
topic_id,hey thread read|update|comment,share,unshare,attachment list,reply,forward,compose --thread-idandcollection add|remove.workflow add|move|remove - Entry ID: an entry's from
id;hey thread readtakes it, and the passage must appear in that message's text.hey clip create - Contact ID from or contact data, clearance ID from
hey contact list(which also gives thehey screener listof the thread to read before deciding), box ID fromtopic_id, label ID fromhey box list. Never substitute one kind for another, or an email address for a contact ID.hey label list
Thread listings (, , , , , ) carry both IDs, with two exceptions: a bundle row can omit , and a search result omits when you have no box item for its thread.
hey box viewlabel viewcollection viewbundle viewcontact threadssearchtopic_ididPassing the wrong kind is not redirected. Unmatched IDs are not reported: HEY checks only that some box item ID in a call is yours, and changes every one that matches. , , and answer only when none match; , , , , and never check ( with no matching ID leaves an empty group). So a mixed batch is a partial success reported as a whole one, a typo is silently skipped, and a that happens to equal one of your box item IDs acts on an unrelated thread; likewise a box item ID given to can read an unrelated thread. Confirm rather than trust the envelope:
hey trashspamlabel add|remove|createbubble up|popnot_foundhey seenunseenmoveignorestop-ignoringset-aside group create|add|removegroup createtopic_idhey thread readbash
hey box view imbox --json --all --jq '{notice, next_page: .data.next_page, match: [.data.postings[] | select(.id == 12345) | {id, topic_id, seen}]}'for a mark, or read the destination box for a move. An empty with still set means the box is larger than reads: continue with rather than calling it a non-match.
matchnext_page--all--page <next_page>Bundle rows. A posting whose is rolls one sender's mail into one row and names the sender, not a thread. It carries only while it holds exactly one unseen thread. Never pass a bundle row's to . lists its unseen threads with their ; lists every thread with that sender, seen or not, which is the only place a bundle's mail is listed once read through. Change grouping with .
kindbundletopic_ididhey thread readhey bundle view <id>topic_idhey contact threads <contact_id>hey contact bundle|unbundle <contact_id>Sending
- Writing an email for a person goes draft, review, send. Save it with on
--draftorcompose, show the person its From, To, Cc, Bcc, Subject and Body in the conversation (replyreads it back), change it withhey draft show <id> --jsonas they ask, and runhey draft edit <id>when they say to send it. They don't need to open HEY to review it. When the person asks outright for a message to go out,hey draft send <id>orcomposewithoutreplysends it in one step.--draft - A send (,
compose,reply,forward) answers the new message'sdraft sendand theidof the thread it landed on; read it withtopic_id.hey thread read <topic_id> - means Undo Send is still holding it, and HEY leaves it out of its thread until it goes out:
delayed: trueshows the thread without it, or answershey thread readfor a thread it started. Wait and read again rather than treating the send as lost.not_found - A send HEY refused (usually the account's sending limit) fails with (exit 7). HEY kept it as a draft, named by
not_deliveredin the error;draft_idsends it later. Do not resend the message; that makes a second draft.hey draft send <draft_id> - A answer carries the draft ID for
--draftand, when the CLI can name it,hey draft show|edit|send|delete, the draft's page in HEY. The person can also review and send it from any HEY app.app_url - adds a note to a thread, which is never emailed but is not private: everyone with access to the thread sees it, HEY for Domains teammates included. The answer lists them in
hey thread comment <topic_id> -m "...";visible_toanswers the same without adding anything. To mail the people on a thread, use--dry-run.hey reply - : run
hey bulk-replybeforepreview. A delivery sent by mistake can be recalled withsendwhile the window is open.hey bulk-reply undo <delivery_id>
Writing content
Message bodies, drafts, thread notes, journal entries, snippets and contact notes are Markdown by default (, , , positional content, stdin and alike) and are converted to rich text on the way out; clip passages, event notes and time track notes are plain text. Each Markdown flag has an HTML twin (such as , , ) for raw HTML, and each pair is mutually exclusive. A fenced code block's language survives for the languages HEY highlights (Ruby, Python, JavaScript, TypeScript, Go, Rust, Java, C#, C++, PHP, Swift, HTML and CSS); any other is dropped.
-m--content--note$EDITOR--message-html--note-html--content-htmlEverything a calendar holds is a recording, and each kind has its own command: , , , , . Without a date, those commands read the account's time zone to find today; name the date to skip the account read.
hey eventhey todohey journalhey habithey timetrackAdding to something written whole
hey contact note sethey journal write&&Contact note. When is , holds the whole note; the read checks the flag itself and fails when it is , so nothing is written:
note_markdown_losslesstruenote_markdownfalsebash
note=$(hey contact note show 12345 --jq 'if .data.note_markdown_lossless then .data.note_markdown else error("note_markdown would drop part of this note: change note_html with --note-html") end') &&
printf '%s\n\nMoved to the Lisbon office in March.\n' "$note" | hey contact note set 12345When it is , the note holds markup Markdown cannot carry. Add to the HTML instead:
falsebash
note=$(hey contact note show 12345 --jq '.data.note_html') &&
hey contact note set 12345 --note-html "$note<p>Moved to the Lisbon office in March.</p>"Journal entry. The same, with ; the read also fails for a day with no entry:
content_markdown_losslessbash
entry=$(hey journal read 2026-03-15 --jq 'if .data.content_markdown_lossless then .data.content_markdown else error("content_markdown would drop part of this entry, or there is none: change content with --content-html") end') &&
printf '%s\n\nBooked the venue for the second day.\n' "$entry" | hey journal write 2026-03-15bash
entry=$(hey journal read 2026-03-15 --jq '.data.content // error("no journal entry for this day")') &&
hey journal write 2026-03-15 --content-html "$entry<p>Booked the venue for the second day.</p>"Authentication
Data commands use the credentials HEY already stores and refresh expiring OAuth tokens automatically. Run the requested data command without a login preflight.
If a data command returns exit code 3 with , or fails with , authentication is unavailable to that process. On macOS under Codex, the sandbox can hide credentials that the HEY CLI stores in Keychain. Before reporting the task as blocked, use the harness's normal approval flow to retry once with elevated sandbox permission. Limit the escalation to this one read-only command. If the response's is , rerun only the exact command the user requested through a separate one-command approval. If is , report the task as blocked and tell the user to run in Terminal; do not run it for them unattended. If the status command fails instead, with a keyring error such as , the login is not the problem and will not fix it: report the task as blocked, relay the error's , and stop.
"code": "auth"could not read stored credentialshey auth status --jsondata.authenticatedtrueheydata.authenticatedfalsehey auth loginexit status 36hey auth loginhintNever run the macOS command to read Keychain contents, print or copy credentials, or move credentials into a file; never disable the sandbox globally; never set as an authentication workaround.
securityHEY_NO_KEYRING=1Piped, machine-output and non-TTY commands do not prompt for sign-in. When an agent harness runs commands under a PTY, set so a missing login returns the same actionable auth error instead of opening an interactive prompt.
HEY_NONINTERACTIVE=1