diff --git a/.changeset/add-html-mode.md b/.changeset/add-html-mode.md new file mode 100644 index 00000000..d8c7c75c --- /dev/null +++ b/.changeset/add-html-mode.md @@ -0,0 +1,5 @@ +--- +"@googleworkspace/cli": minor +--- + +Add `--html` flag to `+send`, `+reply`, `+reply-all`, and `+forward` for HTML email composition. diff --git a/skills/gws-gmail-forward/SKILL.md b/skills/gws-gmail-forward/SKILL.md index a0fbbda7..761b648c 100644 --- a/skills/gws-gmail-forward/SKILL.md +++ b/skills/gws-gmail-forward/SKILL.md @@ -24,15 +24,16 @@ gws gmail +forward --message-id --to ## Flags -| Flag | Required | Default | Description | -|------|----------|---------|-------------| -| `--message-id` | ✓ | — | Gmail message ID to forward | -| `--to` | ✓ | — | Recipient email address(es), comma-separated | -| `--from` | — | — | Sender address (for send-as/alias; omit to use account default) | -| `--cc` | — | — | CC email address(es), comma-separated | -| `--bcc` | — | — | BCC email address(es), comma-separated | -| `--body` | — | — | Optional note to include above the forwarded message | -| `--dry-run` | — | — | Show the request that would be sent without executing it | +| Flag | Required | Default | Description | +| -------------- | -------- | ------- | ----------------------------------------------------------------------------- | +| `--message-id` | ✓ | — | Gmail message ID to forward | +| `--to` | ✓ | — | Recipient email address(es), comma-separated | +| `--from` | — | — | Sender address (for send-as/alias; omit to use account default) | +| `--cc` | — | — | CC email address(es), comma-separated | +| `--bcc` | — | — | BCC email address(es), comma-separated | +| `--body` | — | — | Optional note above the forwarded message (plain text, or HTML with `--html`) | +| `--html` | — | — | Treat `--body` as HTML content (default is plain text) | +| `--dry-run` | — | — | Show the request that would be sent without executing it | ## Examples @@ -41,11 +42,14 @@ gws gmail +forward --message-id 18f1a2b3c4d --to dave@example.com gws gmail +forward --message-id 18f1a2b3c4d --to dave@example.com --body 'FYI see below' gws gmail +forward --message-id 18f1a2b3c4d --to dave@example.com --cc eve@example.com gws gmail +forward --message-id 18f1a2b3c4d --to dave@example.com --bcc secret@example.com +gws gmail +forward --message-id 18f1a2b3c4d --to dave@example.com --body '

FYI

' --html ``` ## Tips - Includes the original message with sender, date, subject, and recipients. +- With `--html`, the forwarded block uses Gmail's `gmail_quote` CSS classes and preserves the original message's HTML formatting. Use HTML fragment tags (`

`, ``, ``, etc.) — no ``/`` wrapper needed. +- With `--html`, inline images embedded in the forwarded message (`cid:` references) will appear broken. Externally hosted images are unaffected. ## See Also diff --git a/skills/gws-gmail-reply-all/SKILL.md b/skills/gws-gmail-reply-all/SKILL.md index d7e7c9cd..11b4d0f0 100644 --- a/skills/gws-gmail-reply-all/SKILL.md +++ b/skills/gws-gmail-reply-all/SKILL.md @@ -24,16 +24,17 @@ gws gmail +reply-all --message-id --body ## Flags -| Flag | Required | Default | Description | -|------|----------|---------|-------------| -| `--message-id` | ✓ | — | Gmail message ID to reply to | -| `--body` | ✓ | — | Reply body (plain text) | -| `--from` | — | — | Sender address (for send-as/alias; omit to use account default) | -| `--to` | — | — | Additional To email address(es), comma-separated | -| `--cc` | — | — | Additional CC email address(es), comma-separated | -| `--bcc` | — | — | BCC email address(es), comma-separated | -| `--remove` | — | — | Exclude recipients from the outgoing reply (comma-separated emails) | -| `--dry-run` | — | — | Show the request that would be sent without executing it | +| Flag | Required | Default | Description | +| -------------- | -------- | ------- | ------------------------------------------------------------------- | +| `--message-id` | ✓ | — | Gmail message ID to reply to | +| `--body` | ✓ | — | Reply body (plain text, or HTML if `--html` is set) | +| `--from` | — | — | Sender address (for send-as/alias; omit to use account default) | +| `--to` | — | — | Additional To email address(es), comma-separated | +| `--cc` | — | — | Additional CC email address(es), comma-separated | +| `--bcc` | — | — | BCC email address(es), comma-separated | +| `--remove` | — | — | Exclude recipients from the outgoing reply (comma-separated emails) | +| `--html` | — | — | Treat `--body` as HTML content (default is plain text) | +| `--dry-run` | — | — | Show the request that would be sent without executing it | ## Examples @@ -43,16 +44,19 @@ gws gmail +reply-all --message-id 18f1a2b3c4d --body 'Updated' --remove bob@exam gws gmail +reply-all --message-id 18f1a2b3c4d --body 'Adding Eve' --cc eve@example.com gws gmail +reply-all --message-id 18f1a2b3c4d --body 'Adding Dave' --to dave@example.com gws gmail +reply-all --message-id 18f1a2b3c4d --body 'Reply' --bcc secret@example.com +gws gmail +reply-all --message-id 18f1a2b3c4d --body 'Noted' --html ``` ## Tips - Replies to the sender and all original To/CC recipients. -- Use --to to add extra recipients to the To field. -- Use --cc to add new CC recipients. -- Use --bcc for recipients who should not be visible to others. -- Use --remove to exclude recipients from the outgoing reply, including the sender or Reply-To target. -- The command fails if no To recipient remains after exclusions and --to additions. +- Use `--to` to add extra recipients to the To field. +- Use `--cc` to add new CC recipients. +- Use `--bcc` for recipients who should not be visible to others. +- Use `--remove` to exclude recipients from the outgoing reply, including the sender or Reply-To target. +- The command fails if no To recipient remains after exclusions and `--to` additions. +- With `--html`, the quoted block uses Gmail's `gmail_quote` CSS classes and preserves the original message's HTML formatting. Use HTML fragment tags (`

`, ``, ``, etc.) — no ``/`` wrapper needed. +- With `--html`, inline images embedded in the quoted message (`cid:` references) will appear broken. Externally hosted images are unaffected. ## See Also diff --git a/skills/gws-gmail-reply/SKILL.md b/skills/gws-gmail-reply/SKILL.md index b14ad354..06edc485 100644 --- a/skills/gws-gmail-reply/SKILL.md +++ b/skills/gws-gmail-reply/SKILL.md @@ -24,15 +24,16 @@ gws gmail +reply --message-id --body ## Flags -| Flag | Required | Default | Description | -|------|----------|---------|-------------| -| `--message-id` | ✓ | — | Gmail message ID to reply to | -| `--body` | ✓ | — | Reply body (plain text) | -| `--from` | — | — | Sender address (for send-as/alias; omit to use account default) | -| `--to` | — | — | Additional To email address(es), comma-separated | -| `--cc` | — | — | Additional CC email address(es), comma-separated | -| `--bcc` | — | — | BCC email address(es), comma-separated | -| `--dry-run` | — | — | Show the request that would be sent without executing it | +| Flag | Required | Default | Description | +| -------------- | -------- | ------- | --------------------------------------------------------------- | +| `--message-id` | ✓ | — | Gmail message ID to reply to | +| `--body` | ✓ | — | Reply body (plain text, or HTML if `--html` is set) | +| `--from` | — | — | Sender address (for send-as/alias; omit to use account default) | +| `--to` | — | — | Additional To email address(es), comma-separated | +| `--cc` | — | — | Additional CC email address(es), comma-separated | +| `--bcc` | — | — | BCC email address(es), comma-separated | +| `--html` | — | — | Treat `--body` as HTML content (default is plain text) | +| `--dry-run` | — | — | Show the request that would be sent without executing it | ## Examples @@ -41,14 +42,17 @@ gws gmail +reply --message-id 18f1a2b3c4d --body 'Thanks, got it!' gws gmail +reply --message-id 18f1a2b3c4d --body 'Looping in Carol' --cc carol@example.com gws gmail +reply --message-id 18f1a2b3c4d --body 'Adding Dave' --to dave@example.com gws gmail +reply --message-id 18f1a2b3c4d --body 'Reply' --bcc secret@example.com +gws gmail +reply --message-id 18f1a2b3c4d --body 'Bold reply' --html ``` ## Tips - Automatically sets In-Reply-To, References, and threadId headers. - Quotes the original message in the reply body. -- --to adds extra recipients to the To field. -- For reply-all, use +reply-all instead. +- With `--html`, the quoted block uses Gmail's `gmail_quote` CSS classes and preserves the original message's HTML formatting. Use HTML fragment tags (`

`, ``, ``, etc.) — no ``/`` wrapper needed. +- With `--html`, inline images embedded in the quoted message (`cid:` references) will appear broken. Externally hosted images are unaffected. +- `--to` adds extra recipients to the To field. +- For reply-all, use `+reply-all` instead. ## See Also diff --git a/skills/gws-gmail-send/SKILL.md b/skills/gws-gmail-send/SKILL.md index b1b270ee..8df1de3a 100644 --- a/skills/gws-gmail-send/SKILL.md +++ b/skills/gws-gmail-send/SKILL.md @@ -24,14 +24,15 @@ gws gmail +send --to --subject --body ## Flags -| Flag | Required | Default | Description | -|------|----------|---------|-------------| -| `--to` | ✓ | — | Recipient email address(es), comma-separated | -| `--subject` | ✓ | — | Email subject | -| `--body` | ✓ | — | Email body (plain text) | -| `--cc` | — | — | CC email address(es), comma-separated | -| `--bcc` | — | — | BCC email address(es), comma-separated | -| `--dry-run` | — | — | Show the request that would be sent without executing it | +| Flag | Required | Default | Description | +| ----------- | -------- | ------- | -------------------------------------------------------- | +| `--to` | ✓ | — | Recipient email address(es), comma-separated | +| `--subject` | ✓ | — | Email subject | +| `--body` | ✓ | — | Email body (plain text, or HTML if `--html` is set) | +| `--cc` | — | — | CC email address(es), comma-separated | +| `--bcc` | — | — | BCC email address(es), comma-separated | +| `--html` | — | — | Treat `--body` as HTML content (default is plain text) | +| `--dry-run` | — | — | Show the request that would be sent without executing it | ## Examples @@ -39,12 +40,14 @@ gws gmail +send --to --subject --body gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi Alice!' gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi!' --cc bob@example.com gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi!' --bcc secret@example.com +gws gmail +send --to alice@example.com --subject 'Hello' --body 'Bold text' --html ``` ## Tips - Handles RFC 2822 formatting and base64 encoding automatically. -- For HTML bodies or attachments, use the raw API instead: gws gmail users messages send --json '...' +- With `--html`, the `--body` value should be HTML content, not a full document. Use tags like `

`, ``, ``, ``, `
`, `