Skip to content

feat(message send): add --blocks flag for raw Block Kit payloads#88

Closed
AmethystLiang wants to merge 3 commits intomainfrom
feat/blocks-flag-merge
Closed

feat(message send): add --blocks flag for raw Block Kit payloads#88
AmethystLiang wants to merge 3 commits intomainfrom
feat/blocks-flag-merge

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

@AmethystLiang AmethystLiang commented May 5, 2026

Merges #82 with element-object validation added.

Original PR #82 by @thehesiod. Adds element validation to loadBlocksFromPath so non-object array entries produce a clear local error.

Closes #82

Made with Orca 🐋

amohr-northstar and others added 3 commits April 18, 2026 14:08
Adds a `--blocks <path>` option to `message send` that reads a JSON array
of Block Kit blocks from a file (or `-` for stdin) and passes it to
chat.postMessage as-is, bypassing the built-in markdown-to-rich-text
conversion.

This unlocks structured layouts that the markdown converter can't
express — headers, dividers, context blocks, and especially the
`table` block introduced by Slack in August 2025. User tokens already
have the `chat:write` scope needed, so no new auth setup is required.

The positional <text> argument (when provided alongside --blocks) is
still sent as the message `text` fallback for notifications and
unfurls. `--blocks` cannot be combined with `--attach` since uploads
take a separate code path.

- CLI: add --blocks option with mutual-exclusion check vs --attach
- Actions: loadBlocksFromPath() reads/parses/validates JSON array;
  sendMessage() prefers loaded blocks over markdown conversion
- README + skill docs: document the flag with a table-block example
- Tests: 4 new cases covering happy path, non-array JSON, malformed
  JSON, and precedence over text-derived blocks
Reject non-object elements in the parsed blocks array with a clear
local error rather than letting Slack reject the payload.

Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
@AmethystLiang AmethystLiang deleted the feat/blocks-flag-merge branch May 5, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants