Slack CLI
for cmdhub.
Channels, conversations, messages, threads, reactions, and users.
cmdhub get slack
data_object Agent Contract
Agents should start with auth/status and discovery commands, inspect schemas before composition, and treat commands marked as mutating as state-changing operations.
Output
Use human output for reading, `--json` for one object, and `--jsonl` for pipes.
Auth
Slack OAuth. Used for conversations, messages, threads, reactions, search, and users.
Refs
Prefer list/search, then short refs or piped JSONL. Use `resolve` to inspect cached refs.
Schemas
Use `slack schema` and `catalog.json` to inspect fields, flags, examples, and side effects.
Auth scopes
channels:readgroups:readim:readmpim:readchannels:historygroups:historyim:historympim:historychannels:writegroups:writechat:writeusers:readusers:read.emailreactions:readreactions:writesearch:readterminal Command Reference
Generated from source. Global flags apply to all commands.
Global Flags
--json
bool
Emit JSON machine output--jsonl
bool
Emit JSONL records for piping--output, -o
string
Compatibility output mode: json|jsonl. Prefer --json or --jsonl--view
string = summary
View mode: summary|full--profile
string = default
Config/auth profile--config
string
Config path override--quiet, -q
bool
Suppress non-essential diagnostics--debug
bool
Enable debug diagnostics--limit
int = 50
Maximum items to emit--page-size
int = 50
Requested upstream page size--cursor
string
Continuation cursor--no-paginate
bool
Fetch only one page--version, -v
bool
Print version informationslack auth
Manage Slack authenticationslack auth login
Start Slack OAuth loginslack auth logout
Clear auth stateslack auth refresh
Validate stored Slack tokenslack auth status
Show auth statusslack auth whoami
Show the authenticated Slack userslack capabilities
Describe capabilitiesslack channel
Work with channelsInspect, join, and leave Slack channels.
List channels first when you need short refs such as c1 or want to inspect valid channel identifiers. If you already know the channel name, channel get can be a faster first step than channel list.
slack channel archive
Archive a channel--id
string
Channel id or name--yes
bool
Confirm archiving the channelslack channel create
Create a channel--name
string
New channel name--private
bool
Create a private channelslack channel get
Get one channel by id or nameGet one Slack channel by id, name, short ref, or one piped channel item.
Prefer this when you already know the channel name and want the canonical channel id without scanning the full channel list first.
--id
string
Channel id or nameslack channel join
Join a public channel--id
string
Channel id or nameslack channel leave
Leave a channel--id
string
Channel id or nameslack channel list
List channelsList Slack channels and cache local channel refs such as c1.
Use –jsonl when the next step should consume one channel item from stdin. If you already know the channel name, channel get can be faster than listing first.
slack channel purpose
Set a channel purpose--id
string
Channel id or name--purpose
string
Channel purpose textslack channel rename
Rename a channel--id
string
Channel id or name--name
string
New channel nameslack channel topic
Set a channel topic--id
string
Channel id or name--topic
string
Channel topic textslack channel unarchive
Unarchive a channel--id
string
Channel id or nameslack config
Inspect local configurationslack config explain
Explain resolved configurationslack conversation
Work with Slack conversationsslack conversation get
Get one conversation by id or name--id
string
Conversation id or nameslack conversation list
List conversations visible to the current userList Slack conversations and cache local conversation refs such as v1.
Use conversation commands when you want a broader Slack conversation view that can include channels, DMs, and MPIMs.
--types
string = public_channel,private_channel,im,mpim
Conversation typesslack conversation open
Open a DM or group DMOpen a Slack DM or MPIM with exact users.
Pass –user one or more times with a user id, username, email-like handle already resolvable by Slack user lookup, or cached user ref from user list.
--user
stringArray = []
User id, name, or short ref to includeslack doctor
Run Slack adapter diagnosticsslack login
Start Slack OAuth loginslack logout
Clear auth stateslack message
Work with Slack messagesList, inspect, create, reply to, update, and delete Slack messages.
List first when you want short refs such as m1 or want to drive follow-up actions through jsonl pipes.
slack message create
Create a message in a channelCreate a Slack message in one channel.
Pass –channel with a channel name, conversation id, or cached short ref, then provide –text.
--channel
string
Target channel id or name--text
string
Message textslack message delete
Delete one or more of your messagesDelete one of your Slack messages.
The target may come from explicit –channel and –ts values, a cached message ref, or one piped message item.
--all
bool
Confirm batch message deletion--channel
string
Channel id or name--ts
string
Message timestamp--yes
bool
Confirm destructive batch message deletionslack message get
Get one or more messages by timestampGet one Slack message in detail.
The target may be:
- –channel plus –ts
- a cached message ref such as m1
- one piped message item from stdin
Use message get after message list when you need the channel-scoped details for a single match. For JSONL recovery, pipe exactly one message item from message list or channel-scoped search into this command. Do not pass –json together with –jsonl; –json is for one response, –jsonl is for pipelines.
--channel
string
Channel id or name--ts
string
Slack message timestampslack message list
List recent messages from a channelList recent Slack messages from one channel and cache local message refs such as m1.
Those message refs can often be used directly by message get, message reply, reaction add, and thread get because the cached reference carries both channel and ts. If you know the channel already, prefer message list over search.message for seeded or recent channel-local work. For recovery after a broad search misses, use –channel with –query, emit –jsonl, and pipe the one matching item into message get. Use –json for one structured response or –jsonl for item streams; they are mutually exclusive.
--channel
string
Channel id or name--query
string
Text query to match message textslack message reply
Reply in a threadReply in a Slack thread.
The target may be:
- –channel plus –ts
- a cached message ref such as m1
- one piped message or thread item from stdin
--channel
string
Channel id or name--text
string
Reply text--ts
string
Root message timestampslack message update
Update one of your messagesUpdate one of your Slack messages.
The target may come from explicit –channel and –ts values, a cached message ref, or one piped message item.
--channel
string
Channel id or name--text
string
Updated text--ts
string
Message timestampslack profile
Manage provider profilesslack profile create
Create an unauthenticated provider profileslack profile delete
Delete a local provider profileslack profile list
List provider profilesslack profile rename
Rename a local provider profileslack profile use
Set the default provider profileslack reaction
Work with message reactionsList, add, and remove reactions on Slack messages.
These commands work best with a piped message item or a cached message ref such as m1. Use –jsonl when a message list/search result should feed a reaction command; do not combine –json with –jsonl.
slack reaction add
Add a reaction to a messageAdd one reaction to a Slack message.
The target may come from explicit –channel and –ts values, a cached message ref, or one piped message item. For recovery, run message list with –channel and –query, then pipe one –jsonl item into this command.
--channel
string
Channel id or name--name
string
Emoji name without colons--ts
string
Message timestamp--yes
bool
Accepted for compatibility; confirmation is unnecessary for one exact reaction addslack reaction list
List reactions on a messageList reactions for one Slack message.
The target may come from explicit –channel and –ts values, a cached message ref, or one piped message item. For recovery, run message list with –channel and –query, then pipe one –jsonl item into this command.
--channel
string
Channel id or name--ts
string
Message timestampslack reaction remove
Remove your reaction from a messageRemove one of your reactions from a Slack message.
The target may come from explicit –channel and –ts values, a cached message ref, or one piped message item. For recovery, run message list with –channel and –query, then pipe one –jsonl item into this command.
--channel
string
Channel id or name--name
string
Emoji name without colons--ts
string
Message timestamp--yes
bool
Accepted for compatibility; confirmation is unnecessary for one exact reaction removalslack resolve
Resolve a Slack local marker or stored short referenceResolve a Slack short reference into its canonical payload.
Use this when you have a marker such as c1, v1, p1, m1, or u1, or a stored short id such as C2H…5FA, and want to inspect what it refers to.
Resolution is profile-scoped. If a marker does not resolve, verify –profile and rerun the relevant list command.
slack schema
Emit Slack adapter schema hintsShow schema hints for the Slack resource payloads emitted by this CLI.
Use this when you need to understand structured output fields for automation or downstream parsing.
--in
bool
Show input schema--input
bool
Show input schema--out
bool
Show output schema--schema-output
bool
Show output schemaslack search
Search Slack resourcesSearch Slack resources using the server-side Slack search APIs.
Prefer channel-scoped list/get workflows when you already know the target channel. Use search when you do not know the channel or need broad workspace discovery. For channel-scoped recovery, use message list –channel –query –jsonl and pipe the selected item into message get. Use –json and –jsonl separately; –jsonl is the mode intended for command-to-command item streams.
slack search message
Search Slack messagesSearch Slack messages by query text.
Use this when you know the terms you want to match but do not already have a channel-scoped message list in hand. If you already know the channel, prefer:
- slack message list –channel
- then slack message get or slack thread get
When a broad search misses a known channel-local message, recover with: slack message list –channel –query –limit 1 –jsonl | slack message get
Do not combine –json and –jsonl; use –jsonl only when feeding another command.
--channel
string
Limit search to one channel by using the channel-scoped message list path--query
string
Search queryslack thread
Work with Slack threadsInspect Slack threads and their replies.
These commands work best with a piped message item or a cached message ref such as m1.
slack thread get
Get a thread and its repliesGet a Slack thread and its replies.
The target may come from explicit –channel and –ts values, a cached message ref, or one piped message or thread item.
--channel
string
Channel id or name--ts
string
Root message timestampslack user
Work with Slack usersslack user get
Get one user by id or name--id
string
User id or nameslack user list
List users--include-deactivated
bool
Include deactivated Slack accountsslack version
Show slack version informationplay_circle Live Examples
Output captured from a real workspace. Regenerate with
scripts/gen-docs.sh --update.
auth
Authenticated as sterne@gmail.com
Field Value
------------ -----
Workspace Stochastic Consulting
Workspace ID {id}
User philip
User ID {id}
Email sterne@gmail.com
Next steps:
- Capabilities: slack capabilities
- List conversations: slack conversation list --limit 10
- List messages: slack message list --channel general --limit 10channels
REF TITLE WHEN c1 general 1.776093411299e+12 c2 random 1.724289881022e+12 c3 announcements 1.771492396484e+12 c4 friendscompete 1.771492396541e+12 c5 africanbank 1.771492396748e+12 Next steps: - Open: slack channel get c1 - Channels: slack channel list - Messages: slack message list --channel general --limit 10 - Capabilities: slack capabilities
messages
REF TITLE m1 This message was deleted. m2 This message was deleted. m3 This message was deleted. Next steps: - Open: slack message get m1 - Channels: slack channel list - Messages: slack message list --channel general --limit 10 - Capabilities: slack capabilities
search
Messages matching "eval"
REF CHANNEL TS AUTHOR TEXT
m1 #cmdhub-evals-a ({id}) {id}.203869 {id} eval-slack-post-delete-grow-natural-civil reply message
m2 #cmdhub-evals-a ({id}) {id}.382739 {id} eval-slack-post-delete-term-beginning-hate reply message
m3 #cmdhub-evals-a ({id}) {id}.412719 {id} eval-slack-post-delete-towards-favorite-growing reply message
m4 #general ({id}) {id}.266959 {id} eval-slack-post-delete-missing-fast-wanted reply message
m5 #general ({id}) {id}.702329 {id} Source event eval-agent-pipe-gcal-slack-review-table-comes: Pipe Slack source event eval-agen...
m6 #cmdhub-evals-a ({id}) {id}.994769 {id} eval-slack-post-delete-related-wish-thing reply message
m7 #cmdhub-evals-a ({id}) {id}.347989 {id} eval-slack-post-delete-word-hope-created reply message
m8 #cmdhub-evals-a ({id}) {id}.139219 {id} Event: Pipe Slack source event eval-agent-pipe-gcal-slack-{id} | Description: Post a Sl...
m9 #cmdhub-evals-a ({id}) {id}.069399 {id} Event: Pipe Slack source event eval-agent-pipe-gcal-slack-{id} | Summary: Pipe Slack so...
m10 #cmdhub-evals-a ({id}) {id}.991189 {id} Pipe Slack source event eval-agent-pw...
m11 #cmdhub-evals-a ({id}) {id}.805279 {id} eval-slack-post-delete-{id} root message
m12 #cmdhub-evals-a ({id}) {id}.330609 {id} Pipe Slack source event eval-agent-pipe-gcal-slack-{id}
m13 #cmdhub-evals-a ({id}) {id}.777579 {id} Pipe Slack source event eval-agent-pipe-gcal-slack-{id}: roadmap risk reviewed, launch ...
m14 #cmdhub-evals-a ({id}) {id}.913129 {id} Pipe Slack source event eval-agent-pipe-gcal-slack-{id}: roadmap risk reviewed, launch ...
m15 #cmdhub-evals-a ({id}) {id}.011309 {id} Pipe Slack source event eval-agent-pipe-gcal-slack-{id}: roadmap risk reviewed, launch ...
m16 #cmdhub-evals-a ({id}) {id}.810639 {id} Post a Slack status update for eval-agent-pipe-gcal-slack-{id}: roadmap risk reviewed, ...
m17 #cmdhub-evals-a ({id}) {id}.769679 {id} Pipe Slack source event eval-agent-pipe-gcal-slack-{id}
m18 #cmdhub-evals-a ({id}) {id}.864679 {id} Pipe Slack source event eval‑...
Next steps:
- Open: slack message get m1
- List channel: slack message list --channel {id} --limit 10
- Search example: slack search message --query roadmap --limit 10users
REF TITLE WHEN p1 slackbot 0 p2 philip 1.603991453e+09 p3 carlscheffler 1.569031072e+09 p4 slack1 1.530883443e+09 Next steps: - Open: slack user get p1 - Channels: slack channel list - Messages: slack message list --channel general --limit 10 - Capabilities: slack capabilities
alt_route Composition Patterns
Bridge your ecosystem with zero middleware.
# Pull one recent message and inspect the whole thread
slack message list --channel general --limit 1 --jsonl \
| slack thread get