Search Slack messages, channels and people
slackcli search covers messages, channels, and people. Every subcommand
accepts --workspace <id|name> and --json.
search messages
Section titled “search messages”slackcli search messages "deployment failed"slackcli search messages "release" --in=engineering --from=rafaelslackcli search messages "incident" --limit=50 --sort=scoreslackcli search messages "after:2026-07-01 has:link" --json| Option | Default | Purpose |
|---|---|---|
--in <channel> |
— | Shorthand for the in: operator |
--from <user> |
— | Shorthand for the from: operator |
--limit <number> |
20 |
Results per page |
--page <number> |
1 |
Which page |
--sort <field> |
timestamp |
score or timestamp |
--sort-dir <dir> |
desc |
asc or desc |
The query is passed to Slack, so all of its
search operators
work: in:, from:, before:, after:, on:, during:, has:, is:,
with:. --in and --from are just conveniences appended to the query.
When more pages exist, the next-page command is printed. In --json mode the
page and pages fields carry the same information.
Standard bot tokens (xoxb-*) cannot call search.messages at all — Slack
restricts it to user tokens. Use a xoxp-* token or browser auth.
search channels
Section titled “search channels”slackcli search channels platformslackcli search channels incident --limit=50 --jsonMatches on channel name, topic, and purpose.
With browser auth this hits Slack’s own search backend and is fast. With a standard token there is no equivalent API, so SlackCLI lists up to 1000 non-archived channels and filters them locally — correct, but slower on large workspaces, and capped at that 1000.
search people
Section titled “search people”slackcli search people rafaelslackcli search people "@example.com" --limit=50Matches on username, real name, display name, and email.
The same auth-type split applies: browser auth uses Slack’s search backend; standard auth lists up to 1000 users and filters locally, skipping deactivated accounts and bots.