chat.jsonl of that day’s messages and the files shared in it. Users become
one JSON profile each.
Setup
Create a Slack app with a bot token. A user token is optional and only letsgrep -w and slack search use Slack’s search.
Create the app and bot token
Create the app and bot token
- Open api.slack.com/apps, click
Create New App, From scratch, name it (for example
Mirage) and pick the workspace. - Under OAuth & Permissions, Bot Token Scopes, add:
channels:read,channels:history: public channelsgroups:read,groups:history: private channels (optional)im:read,im:history: direct messages (optional)mpim:read,mpim:history: group DMs (optional)users:read: theusers/folderfiles:read: attachments underfiles/
- Install App, Install to Workspace, then copy the
Bot User OAuth Token (
xoxb-...). - Invite the bot to each channel it should read with
/invite @Mirage. A channel it is not in answersPermission denied.
slack CLI needs
chat:write for send-message and files:write for upload-file.Optional: user token for search
Optional: user token for search
Slack’s
search.messages refuses bot tokens.- Under User Token Scopes, add
search:read. Forgrepandrg, also addchannels:read,groups:read,im:readandmpim:read, so Mirage can tell which channels and DMs that user’s search covers. - Reinstall the app and copy the User OAuth Token (
xoxp-...).
Connect
- YAML
- Python
- TypeScript
workspace.yaml
Layout
- A name ends with its Slack ID after
__. Each channel and DM lists one folder per day for the 90 days up to its newest message;start_timeandend_timeset another range. - A
chat.jsonlline is one message as Slack’s API returns it;.useris a user ID, resolved throughusers/. grep -wwith asearch_tokenasks Slack’s search which days match and reads only those. Without them,grepreads the files.
Sample runs
slack CLI.
SDK guides
Python
Every config field, the VFS.md and write support.
TypeScript
Every config field, the VFS.md and write support.