Skip to content

feat(messages): add --channel flag to send command#126

Merged
piekstra merged 2 commits intomainfrom
feat/channel-flag-for-send
Mar 18, 2026
Merged

feat(messages): add --channel flag to send command#126
piekstra merged 2 commits intomainfrom
feat/channel-flag-for-send

Conversation

@piekstra
Copy link
Copy Markdown
Collaborator

Summary

Adds --channel as an optional flag alternative to the positional channel argument on messages send. Both forms are equivalent:

slck messages send general "Hello"
slck messages send --channel general "Hello"

When --channel is provided, all positional arguments are treated as text. If neither --channel nor a positional channel is provided, the command returns an error.

Motivation

The positional-only syntax isn't always intuitive, especially for AI tooling and MCP integrations that naturally reach for --channel. This makes the interface more flexible without changing existing behavior.

Changes

  • send.go: Add channel field to sendOptions, register --channel flag, update RunE to resolve channel from flag or positional arg
  • messages_test.go: Add TestSendCmd_ChannelFlag and TestSendCmd_NoChannelError

The channel can now be specified via --channel as an alternative to the
positional argument. When --channel is provided, positional args are
treated as text.

Both forms are equivalent:
  slck messages send general "Hello"
  slck messages send --channel general "Hello"
Address review feedback: use strings.Join for positional args when
--channel is provided so multiple args aren't silently dropped.
Add test for multi-arg case.
@piekstra piekstra merged commit 167e973 into main Mar 18, 2026
2 checks passed
@piekstra piekstra deleted the feat/channel-flag-for-send branch March 18, 2026 16:34
rianjs added a commit that referenced this pull request Mar 23, 2026
Add missing documentation for emoji list, files download, whoami,
--channel and --file flags on messages send. Add emoji:read and
files:read OAuth scopes to manifest. Update CHANGELOG with entries
for recent features (#120, #122, #123, #125, #126, #130). Add
integration test sections for emoji, files, identity, and --channel.
rianjs added a commit that referenced this pull request Mar 23, 2026
## Summary

- Add missing README sections for `emoji list`, `files download`, and
`whoami` commands
- Document `--channel` and `--file` flags on `messages send`
- Add `emoji:read` and `files:read` OAuth scopes to app manifest and
scopes table
- Add `emoji` → `e` alias to aliases table
- Update CHANGELOG with entries for #120, #122, #123, #125, #126, #130
- Add integration test sections: Part 8 (Emoji & Files), Part 9
(Identity)
- Add `--channel` flag test case to messaging section
- Add `emoji:read` and `files:read` to integration test setup scopes
table

## Test plan

- [x] No code changes — docs only
- [ ] Review README for accuracy against actual CLI behavior
- [ ] Verify CHANGELOG entries reference correct PR numbers
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.

1 participant