MCPcopy Create free account
hub / github.com/basecamp/hey-cli / newComposeCommand

Function newComposeCommand

internal/cmd/compose.go:24–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22 bcc string
23 subject string
24 message string
25 messageHTML string
26 threadID string
27 attachments []string
28 draft bool
29}
30
31func newComposeCommand() *composeCommand {
32 composeCommand := &composeCommand{}
33 composeCommand.cmd = &cobra.Command{
34 Use: "compose",
35 Short: "Write and send a new email",
36 Annotations: map[string]string{
37 "agent_notes": "Starts a new thread with --to (optionally --cc/--bcc), which requires --subject, or replies to an existing one with --thread-id, which does not. Repeatable --attach files are uploaded before sending and can be sent without body text. The body is Markdown; use --message-html to send raw HTML instead. --draft saves instead of sending — recipients become optional — and answers the draft ID for hey draft show/edit/send/delete.",
38 },
39 Example: ` hey compose --to alice@example.com --subject "Lunch plans" -m "Are you free Friday?"
40 hey compose --to alice@example.com --cc bob@example.com --bcc carol@example.org --subject "Kitchen remodel timeline" -m "Cabinets land the week of the 14th."
41 hey compose --to alice@example.com --subject "Q3 revenue report" -m "The numbers are attached." --attach ./report.pdf
42 hey compose --thread-id 12345 -m "Confirmed — see you then." --attach ./diagram.png
43 hey compose --to alice@example.com --subject "Sprint recap" -m "We **shipped** the pagination fix."
44 hey compose --to alice@example.com --subject "Newsletter draft" --message-html "<h1>March</h1><p>What we shipped.</p>"
45 echo "Notes from the offsite" | hey compose --to bob@example.com --subject "Offsite recap"
46 hey compose --subject "Board update" -m "Numbers to follow." --draft # save a draft; add recipients later`,
47 RunE: composeCommand.run,
48 }
49
50 composeCommand.cmd.Flags().StringVar(&composeCommand.to, "to", "", "Recipient email address(es)")

Callers 1

newRootCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected