Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CLI support for listing, creating, and deleting email clips with source-thread context and multiple output formats.
Changes:
- Adds
hey clipsandhey clip create/delete. - Adds unit and real-server smoke coverage.
- Updates help, documentation, and command surface.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.surface |
Records the new command surface. |
README.md |
Documents clip commands and formats. |
internal/cmd/clip.go |
Implements clip listing and mutations. |
internal/cmd/clip_test.go |
Tests command behavior and validation. |
internal/cmd/help.go |
Adds clips to curated help. |
internal/cmd/help_test.go |
Updates help expectations. |
internal/cmd/root.go |
Registers the commands. |
tests/smoke/clips_test.go |
Tests the lifecycle against HEY. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Give people and coding agents a terminal-native way to save an exact passage from a known email entry, retain its source thread context, and remove it later. This is intentionally CLI-only; selecting text from rendered mail in the TUI remains separate interaction work.
Review readiness: ✅ Yes
Risk: 🟡 Medium — clip creation now reads and validates the source message before mutating; it adds no schema, dependency, or TUI changes.
Decision: Source-backed validation preserves the exact value;
--accountselects clip-list presentation while HEY derives create/delete ownership identity-wide.✅ Change — clips can be listed, created from an entry, and deleted entirely from the CLI
Before
After
hey clip createfirst reads the entry throughMessages().Get, derives source-backed message text (including embedded inbound bodies), and accepts browser-style whitespace differences without changing what it sends to HEY. Explicit hidden content and fabricated HTML boundaries are rejected; malformed or excessively deep HTML fails closed; passage/source size limits bound parser and storage work; HEY web remains authoritative for stylesheet-driven visibility.hey clipspreserves the SDK’s newest-first order and returns the complete typed clip shape in JSON, including source topic ID, name, and URL. Human and Markdown output sanitize untrusted content and topic names.✅ Evidence — lifecycle, source context, formats, and cleanup pass against Haystack
The full strict smoke suite was also exercised. Both clip tests passed; unrelated environment/fixture gates failed for attachment sending, cookie-backed
auth token, absence of a seen Imbox posting, and dev-build version checks.✅ Scope — CLI clip lifecycle only, using the released SDK
Included:
hey clipswith styled, JSON, quiet, jq, Markdown, IDs, and count output.hey clip create <entry-id> --content <text>, with a source-message read and source-backed passage validation, andhey clip delete <clip-id>.Deferred intentionally:
➖ Delivery — no migration, configuration, dependency, or deployment ordering
The released HEY SDK v0.12.0 already provides
Messages().GetplusClips().List,Create, andDelete. There are no schema changes, feature flags, new runtime dependencies, backfills, or migrations. Existing clips appear immediately; rollback is a normal revert and does not alter saved data.Please confirm:
--account; HEY assigns creation to the source entry’s account and resolves deletion by identity-owned clip ID across linked accounts. This is identity-wide ownership, not account isolation.hey clip create <entry-id> --content <text>is the right explicit contract for scripts and agents that already obtained an entry ID fromhey threads --json.Deletion is permanent for the clip but leaves its source entry and thread unchanged.
✅ Review path — command contract, behavioral proof, then public surface
internal/cmd/clip.go— CLI hierarchy, output, source-message validation, exact-value preservation, source context, and mutation contract.internal/htmlutil/htmlutil.goandinternal/htmlutil/htmlutil_test.go— source-backed message text, HTML/visibility boundaries, embedded inbound bodies, fail-closed parsing, size bounds, and edge-case proof.internal/cmd/clip_test.goandtests/smoke/clips_test.go— unit and real-server acceptance proof.internal/cmd/root.go,internal/cmd/help.go,internal/cmd/help_test.go,README.md, and.surface— registration, documentation, help contract, and discoverability.Origin and supporting links: Basecamp card · separate completed snippets card · HEY SDK v0.12.0