From 894eaacd54c7cca40c645ec48fbe26d1f32b0306 Mon Sep 17 00:00:00 2001 From: jeiea Date: Wed, 29 Jul 2026 11:03:04 +0900 Subject: [PATCH] feat: add --no-unfurl to message sends [Background] Slack unfurls text and media links by default, while the CLI exposed no per-message preview control. https://docs.slack.dev/messaging/unfurling-links-in-messages/ Native Slack drafts and message edits do not expose the same send-time controls. File uploads reject the flag because their API accepts no unfurl fields. [Verification] - [x] `mise x bun@1.3.9 -- bun test test/message-send.test.ts test/safe-mode.test.ts test/help-contracts.test.ts` - 74 tests passed - [x] `mise x bun@1.3.9 -- bun test` - 351 tests passed - [x] `mise x bun@1.3.9 -- bun run typecheck` - passed AI-assistant: Claude Fable 5, GPT-5.6-sol --- README.md | 4 + skills/agent-slack/SKILL.md | 2 + src/cli/compose-actions.ts | 5 +- src/cli/message-actions.ts | 13 +++ src/cli/message-command.ts | 5 +- src/cli/safe-mode.ts | 7 +- src/cli/unfurl-options.ts | 6 ++ test/help-contracts.test.ts | 2 + test/helpers/environment.ts | 27 ++++++ test/message-send.test.ts | 171 ++++++++++++++++++++++++++++++------ test/safe-mode.test.ts | 77 ++++++++-------- 11 files changed, 249 insertions(+), 70 deletions(-) create mode 100644 src/cli/unfurl-options.ts create mode 100644 test/helpers/environment.ts diff --git a/README.md b/README.md index e081803..6bfbb19 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,9 @@ agent-slack message compose "#general" # Open editor with initial text agent-slack message compose "#general" "Here's my update" +# Open the editor and suppress link/media previews when sent +agent-slack message compose "#general" "Release notes: https://example.com" --no-unfurl + # Reply in a thread agent-slack message compose "https://workspace.slack.com/archives/C123/p1700000000000000" ``` @@ -297,6 +300,7 @@ Send options for `message send`: - `--attach ` upload a local file (repeatable; `` is optional when attaching files) - `--blocks ` send raw [Block Kit](https://docs.slack.dev/block-kit/) blocks from a JSON file (or `-` for stdin). Bypasses the automatic markdown-to-rich-text conversion, unlocking header/divider/section/table blocks and other structured layouts. Cannot be combined with `--attach`. - `--reply-broadcast` when replying in a thread, also post the reply to the parent channel (Slack's "Also send to #channel" checkbox). For channel targets, pair with `--thread-ts`; for URL targets, the thread context is derived from the message. Not supported for DM targets; cannot be combined with `--attach`. +- `--no-unfurl` suppress Slack link and media previews. Also available on `message compose`; cannot be combined with `--attach`. - `--schedule