Loading...
Loading...
Invoke the `slack-cli` binary to read and act on a Slack workspace from the command line — list channels, read/search conversation history and threads, fetch unread messages, search users, manage user groups, post messages, add reactions, mark channels read, and manage saved items. Use whenever a task needs Slack data or actions, such as "what are the unread messages in
npx skill4agent add paymog/slack-cli slack-clislack-clibrew install paymog/tap/slack-clipaymog/slack-clikorotovsky/slack-mcp-serverjqjqslack-cli channels list | jq -r '.[].Name'
slack-cli conversations history '#general' --limit 1d | jq -r '.[].Text'
slack-cli users search alice | jq -r '.[].DMChannelID'tonumber--rawexport SLACK_MCP_XOXP_TOKEN=xoxp-... # user OAuth — full features (recommended)
# or
export SLACK_MCP_XOXB_TOKEN=xoxb-... # bot token — invited channels only, no search
# or
export SLACK_MCP_XOXC_TOKEN=xoxc-... # browser session token + cookie below
export SLACK_MCP_XOXD_TOKEN=xoxd-... # browser cookie d (stealth mode)conversations searchusers_searchxoxpxoxcxoxdsaved …xoxcxoxd--govslackSLACK_MCP_GOVSLACK=trueslack-cli auth login [name] # prompts for mode + token(s); validates before saving
slack-cli auth list # * marks default
slack-cli auth default <name>
slack-cli --profile <name> <cmd> # use a profile for one command
slack-cli auth status # show resolved source + mode
slack-cli auth logout <name> [-f]--xoxp/--xoxc/...SLACK_MCP_*--profile <name>--profileSLACK_CLI_PROFILE#channel-name@usernamechannels listslack-cli cache refresh # fetch users + channels, write cache to disk--no-cacheC…U…D…<channel>C123…#general@username# Channels (JSON array; fields: ID,Name,Topic,Purpose,MemberCount,Cursor)
slack-cli channels list [--types public_channel,private_channel,im,mpim] [--query foo] [--query-targets name,topic,purpose] [--sort popularity] [--limit 100] [--cursor C]
slack-cli channels me # channels you belong to
# Conversation history & threads
slack-cli conversations history <channel> [--limit 1d|1w|30d|<count>] [--cursor C] [--activity]
slack-cli conversations replies <channel> <thread_ts>
# Pagination: read the Cursor field of the last element, then pass --limit='' --cursor <value>.
# Search (needs xoxp or browser token; not bot)
slack-cli conversations search [query] \
[--in-channel #general] [--in-dm @user] [--with @user] [--from @user] \
[--before YYYY-MM-DD] [--after YYYY-MM-DD] [--on YYYY-MM-DD] [--during July] \
[--threads-only] [--limit 20] [--cursor C]
# A full Slack message URL as the query returns just that message.
# Unreads, prioritized DMs > partner > internal (best with xoxp/browser)
slack-cli conversations unreads [--types all|dm|group_dm|partner|internal] [--mentions-only] [--max-channels 50] [--max-messages-per-channel 10] [--include-muted]
# Users (JSON array incl. DMChannelID for quick messaging)
slack-cli users search <query> [--limit 10]
# User groups
slack-cli usergroups list [--include-users] [--include-disabled]
slack-cli usergroups me <list|join|leave> [--usergroup-id S123]
# Saved items (browser tokens only)
slack-cli saved list [--filter saved|completed|archived] [--limit 50]
# Attachments (download a file by ID; always available, no env var needed).
slack-cli attachments get <file_id> [-o path] # Fxxxxxxxxxx, max 5MBC123,D456!C123SLACK_MCP_ADD_MESSAGE_TOOL=true slack-cli conversations add <channel> -t "hello" [--thread-ts 123.456] [--content-type text/markdown|text/plain]
SLACK_MCP_ADD_MESSAGE_TOOL=true slack-cli conversations add <channel> --blocks '<Block Kit JSON array>'
SLACK_MCP_MARK_TOOL=true slack-cli conversations mark <channel> [--ts 123.456]
SLACK_MCP_REACTION_TOOL=true slack-cli reactions add <channel> <timestamp> --emoji rocket
SLACK_MCP_REACTION_TOOL=true slack-cli reactions remove <channel> <timestamp> --emoji rocket
slack-cli usergroups create --name "Eng" [--handle eng] [--description ...] [--channels C1,C2]
slack-cli usergroups update <usergroup_id> [--name ...] [--handle ...] [--channels ...]
slack-cli usergroups users-update <usergroup_id> --users U1,U2,U3
slack-cli saved update <item_id> <ts> [--mark completed] [--date-due <unix>]
slack-cli saved clear-completed# Triage unread DMs and mentions
slack-cli cache refresh
slack-cli conversations unreads --types dm
slack-cli conversations unreads --mentions-only
# Find a thread, then read its replies
slack-cli conversations search "deploy rollback" --in-channel #incidents --after 2024-06-01
slack-cli conversations replies C0123456789 1718000000.123456
# Who is someone, then DM them (needs SLACK_MCP_ADD_MESSAGE_TOOL)
slack-cli users search alice # note DMChannelID, e.g. D0123
SLACK_MCP_ADD_MESSAGE_TOOL=D0123 slack-cli conversations add D0123 -t "ping"
# Last day of a channel as JSON, extract message text with jq
slack-cli conversations history #general --limit 1d | jq -r '.[].Text'
# Download an image (or any binary) attachment to a file. -o writes the decoded
# bytes and keeps stdout to a small metadata JSON — use it for images/binaries so
# a multi-MB base64 blob doesn't flood the terminal.
slack-cli attachments get F0123ABCD -o avatar.png
# Without -o the bytes come back inline, base64-encoded under .content — decode with:
slack-cli attachments get F0123ABCD | jq -r .content | base64 --decode > avatar.pngno Slack credentialsSLACK_MCP_XOXP_TOKENslack-cli auth loginusers cache is not readychannels list#name not foundslack-cli cache refresh--no-cacheconversations_add_message tool is disabledSLACK_MCP_ADD_MESSAGE_TOOLSLACK_MCP_REACTION_TOOLSLACK_MCP_MARK_TOOLattachments getxoxbxoxpsavedcache refresh