slick lookup¶
Look up channels and users, and search messages.
lookup messages needs a user token
lookup messages requires a user token with search:read; bot-token
profiles cannot use it.
lookup channel¶
Find channel and conversation metadata. With --channel, fetch one
conversation; without, list conversations of the requested types.
Narrow to DMs and group DMs, or ask for every conversation type:
Fetch metadata for one conversation by ID, name, or alias:
Flags¶
Flags
| Flag | Value | Description |
|---|---|---|
-c, --channel |
<CHANNEL> |
Channel or conversation ID, name, or alias |
-M, --max-items |
<N> |
Maximum conversations to return |
-C, --cursor |
<CURSOR> |
Pagination cursor |
-f, --filter |
<TEXT> |
Filter by ID or name |
-t, --types |
<TYPE> |
Conversation types: public_channel, private_channel, im, mpim, dm, or all |
Output¶
Human (list) renders a primer table:
CHANNEL NAME TYPE USER MEMBER ARCHIVED MEMBERS TOPIC
C1234567890 deploy-bots channel true false 42 Deploy automation
C7N2Q8L4P incidents private_channel true false 8 Incident response
C0228L1B726 direct im U123… true false 1
Columns: CHANNEL, NAME, TYPE, USER, MEMBER, ARCHIVED, MEMBERS,
TOPIC. TYPE is Slack's conversation kind — channel for public,
private_channel for private, im/mpim for DMs. USER is populated only
for im rows (the DM counterparty). CHANNEL stays the raw conversation ID
for copy/paste and may be an OSC 8 terminal hyperlink in human mode. Channel IDs
hash-colour; TYPE colours by hash. MEMBER uses dim-on-true (being a member
is the routine state); ARCHIVED uses red-on-true.
Human (single channel via --channel):
A topic field appears at the end when the channel has one set.
JSON envelope (list). Slack's conversation type is channel for public
channels and private_channel for private; is_im distinguishes DM
conversations even when other types coexist in the list. hr and url are
best-effort display metadata; id remains the raw Slack conversation ID:
lookup user¶
Find user metadata. With --user, fetch one; without, list active users.
Return the full users.list, including deleted and deactivated users:
Flags¶
Flags
| Flag | Value | Description |
|---|---|---|
-u, --user |
<USER> |
Slack user ID |
-M, --max-items |
<N> |
Maximum users to return |
-C, --cursor |
<CURSOR> |
Pagination cursor |
-f, --filter |
<TEXT> |
Filter by ID or name |
-p, --presence |
Fetch presence | |
-d, --include-deleted |
Include deleted or deactivated users |
List mode excludes deleted and deactivated users by default. Add
--include-deleted when you need the full users.list result.
Output¶
Human (list) renders a primer table:
USER NAME TZ STATUS
USLACKBOT slackbot America/Los_Angeles
U123ABC mcraven America/Toronto Working remotely
U2A8B0DCA ansible America/Los_Angeles
Human (single user):
With --presence, a presence=active|away field joins the event:
User resolved user=U123ABC name=mcraven timezone=America/Toronto presence=active status_text="Working remotely"
timezone renders Region/City with the region dim and the city bold.
status_text is present when the user has a status set. presence is
populated only when --presence is passed (otherwise the field is absent).
lookup messages¶
Search Slack workspace messages with the Web API search.messages method.
Requires a user token with search:read.
Search for matching messages, capped by --max-items:
Use the Slack search modifiers inside the query:
Page through results with a cursor from the previous response:
Flags¶
Flags
| Flag | Value | Description |
|---|---|---|
-q, --query |
<QUERY> |
Search query |
-M, --max-items |
<N> |
Maximum matches to return |
-C, --cursor |
<CURSOR> |
Pagination cursor |
-F, --full |
Show full text in human mode |
Query syntax follows Slack's search modifiers (from:, in:, before:,
after:, etc.).
When there are no matches:
count is forced to render even at zero (it would otherwise be stripped by
clog's OmitZero).
With matches, human mode renders a TS / CHANNEL / USER / TEXT table:
TS CHANNEL USER TEXT
1746284582.123456 #deploy-bot U123ABC Deploy v0.4.0 complete — rollback window closes 18:00 UTC.
:robot_face: _Sent via slick (agent mode)_
The attribution context block (when present) renders on its own line below
the body, joined by a newline. That's how Slack's search.messages
returns Block Kit messages — the body
lives in blocks[], not in the
top-level text field, and slick reconstructs the readable text by
flattening section / header / context / rich_text blocks.
JSON envelope. For Block Kit messages (which is every message slick
sends — attribution adds a context block), Slack returns text="" in
the raw response and the body lives inside blocks[]. slick flattens
section / context / rich_text blocks back into the text field so
consumers get something readable; the attribution context line appears
on its own line after the body:
{
"data": {
"matches": [
{
"channel": {
"id": "C1234567890",
"name": "deploy",
"hr": "#deploy",
"url": "https://app.slack.com/client/T8KQ42P9D/C1234567890"
},
"user": "U123ABC",
"text": "Deploy v0.4.0 complete — rollback window closes 18:00 UTC.\n:robot_face: _Sent via slick (agent mode)_",
"ts": "1746284582.123456",
"permalink": "https://example.slack.com/archives/C1234567890/p1746284582123456"
}
],
"query": "deploy"
}
}
Common errors¶
| Error | Cause | Fix |
|---|---|---|
not_allowed_token_type (validation, exit 4) |
lookup messages invoked under a bot-token profile. |
Use a user-token profile; search:read is user-scope only. |
missing_scope (auth_failure, exit 1) |
Token lacks users:read, channels:read, or search:read. |
Update the manifest, regenerate, re-auth. |
Empty list with --filter |
Filter is client-side; Slack list API returned nothing first. | Drop the filter or widen --max-items. |
See also¶
cache— prime users/channels for faster repeated lookups.history— read messages by channel/thread rather than search.- Slack API methods:
conversations.list,conversations.info,users.list,users.info,search.messages.