| name | slackcli |
| description | CLI for interacting with Slack workspaces. Use when working with Slack to read messages, list channels, send messages, search, add reactions, or resolve Slack URLs. Triggered by requests involving Slack data, channel exploration, message searches, or Slack automation. Use when this capability is needed. |
| metadata | {"author":"fprochazka"} |
slackcli
Command-line interface for Slack API operations.
First Step: Check Configuration
Run slack config at the start of every session to check workspace setup:
slack config
Check the last line of output:
Using org from SLACK_ORG: <name> → No --org needed, commands use this workspace
No org selected (use --org or SLACK_ORG) → Must pass --org=<workspace> to every command
The output also shows available workspaces in the "orgs" section.
Flag Placement
Always place flags after the full command path, not between slack and the command group. This ensures command prefix matching works correctly for permissions.
slack conversations list --org=mycompany
slack messages list '#channel' --org=work --json
slack --org=mycompany conversations list
Workspace Selection
slack conversations list
slack conversations list --org=mycompany
If the user hasn't specified a workspace and no default is configured, ask them which workspace to use (show the available orgs from slack config).
Global Flags
| Flag | Description |
|---|
--org | Workspace name (required if SLACK_ORG not set) |
--verbose | Enable debug logging |
--json | JSON output (available on most commands) |
Conversations
slack conversations list
slack conversations list --public
slack conversations list --private
slack conversations list --dms
slack conversations list --member
slack conversations list --non-member
slack conversations list --refresh
Messages
List Messages
slack messages list '#channel'
slack messages list '#channel' --today
slack messages list '#channel' --last-7d
slack messages list '#channel' --last-30d
slack messages list '#channel' --since 2024-01-15
slack messages list '#channel' --since 7d --until 3d
slack messages list '#channel' --with-threads
slack messages list '#channel' --reactions=counts
slack messages list '#channel' --reactions=names
slack messages list '#channel' -n 50
slack messages list '#channel' 1234567890.123456
slack messages list C0123456789 --json
Send Messages
Send to channels or DMs. Target can be #channel, @username, @email@example.com, or IDs.
slack messages send '#channel' "Hello world"
slack messages send '@john.doe' "Hello via DM"
slack messages send '#channel' --thread 1234567890.123456 "Reply in thread"
echo "Message" | slack messages send '#channel' --stdin
slack messages send '#channel' --file ./report.pdf
slack messages send '#channel' "Here's the report" --file ./report.pdf
slack messages send '#channel' "Message" --json
Edit Messages
slack messages edit '#channel' 1234567890.123456 "Updated message"
slack messages edit '#channel' 1234567890.123456 "Updated" --json
Delete Messages
slack messages delete '#channel' 1234567890.123456
slack messages delete '#channel' 1234567890.123456 --force
Search
Search Messages
slack search messages "quarterly report"
slack search messages "bug fix" --in '#engineering'
slack search messages "deadline" --from '@john.doe'
slack search messages "meeting" --after 7d
slack search messages "project" --before 2024-01-15 --after 2024-01-01
slack search messages "query" --sort timestamp --sort-dir desc
slack search messages "query" -n 50 --page 2
Search Files
slack search files "report.pdf"
slack search files "spreadsheet" --in '#finance'
slack search files "presentation" --from '@jane.doe'
slack search files "budget" --after 30d
Users
slack users list
slack users list --refresh
slack users list --bots --deleted
slack users search "john"
slack users get @john.doe
slack users get john@example.com
slack users get U0123456789
Files
Files are downloaded to /tmp/slackcli-<random>/.
slack files download F0ABC123DEF
slack files download 'https://files.slack.com/...'
slack files download F0ABC123DEF --json
Reactions
slack reactions add '#channel' 1234567890.123456 thumbsup
slack reactions add '#channel' 1234567890.123456 :+1:
slack reactions remove '#channel' 1234567890.123456 thumbsup
Pins
slack pins list '#channel'
slack pins add '#channel' 1234567890.123456
slack pins remove '#channel' 1234567890.123456
Scheduled Messages
slack scheduled list
slack scheduled list '#channel'
slack scheduled create '#channel' "in 1h" "Reminder!"
slack scheduled create '#channel' "in 30m" "Meeting soon"
slack scheduled create '#channel' "tomorrow" "Daily standup"
slack scheduled create '#channel' "tomorrow 9am" "Good morning!"
slack scheduled create '#channel' "2025-02-03 09:00" "Team meeting"
slack scheduled create '#channel' --thread 1234567890.123456 "in 1h" "Reply"
slack scheduled delete S0123456789
Resolve Slack URLs
slack resolve 'https://workspace.slack.com/archives/C0123456789/p1234567890123456'
slack resolve 'https://...' --json
Extracts workspace from URL automatically.
References
Channels
#channel-name - Channel name with hash
C0123456789 - Channel ID
Users
@username - Username with @
@email@example.com - Email with @
U0123456789 - User ID
Message Timestamps
Format: 1234567890.123456. Get them from:
--json output of any message command
- Thread reply indicator in text output
- Slack URL (the
p parameter, add decimal before last 6 digits)
Message Formatting
When composing messages, use Slack's mrkdwn syntax. Slack does NOT support markdown tables — use plain text alignment, bullet lists, or code blocks to present tabular data instead.
| Syntax | Result |
|---|
*bold* | bold |
_italic_ | italic |
`code` | code |
```code block``` | code block |
<@U123456> | @mention user |
<#C123456> | #mention channel |
<!here> | @here |
<!channel> | @channel |
<https://url|text> | hyperlink |
Get user/channel IDs from --json output or slack users get.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.