Skip to main content
The Slack resource exposes a Slack workspace as a virtual filesystem mounted at some prefix such as /slack/. For token setup, see Slack Setup.

Config

Filesystem Layout

Example:
Directory names embed the Slack ID so that write commands (slack-post-message --channel_id, etc.) can reference the correct resource without extra lookups.

Channels

/slack/channels/ lists public and private channels the bot has access to. The channel ID is appended after __. Each channel directory contains day-partitioned directories for the last 90 days (or since channel creation, whichever is shorter). Each date directory contains chat.jsonl plus a files/ directory for attachments shared that day. The date range is derived from the channel’s created timestamp.

DMs

/slack/dms/ lists direct message conversations. The DM ID is appended after __. Like channels, DM directories contain daily directories with chat.jsonl and files/.

Users

/slack/users/ lists one .json file per non-deleted, non-bot user. Reading a user file calls get_user_profile() and returns the full profile JSON from the Slack API.

Cache

The Slack resource uses IndexCacheStore (same as Discord and other resources). Index entries store channel IDs, DM IDs, user IDs, and channel creation timestamps for date range computation. There is no separate content cache - file content caching is handled by the workspace IOResult mechanism.

Example

See examples/python/slack/slack.py for the full working example.

Finding IDs

Resource-specific commands require Slack IDs (channel_id, user_id, ts). These can be extracted from the filesystem:

Working with Large Channels

Channels with many messages produce large chat.jsonl files per day. Tips for efficient access:

Shell Commands

Standard commands available on the mounted Slack tree: Resource-specific commands:

slack-post-message

Post a message to a channel.
Returns the posted message JSON.

slack-reply-to-thread

Reply to a specific thread.
The --ts value is the message timestamp (e.g., from a .jsonl entry’s ts field). Returns the posted reply JSON.

slack-add-reaction

Add an emoji reaction to a message.

slack-get-users

Search for users by name, real name, or email.
Returns matching users as JSON array.

slack-get-user-profile

Get a single user’s full profile.
Returns the user profile JSON. The user ID can be found in filenames under /slack/users/ (e.g., alice__U04K21SEVR9.json). Search messages across the workspace.
Returns search results as JSON.