ENยทESยทDEยทPTยทFR
โŒ˜K

Slack Integration

Connect aidaemon to your Slack workspace via Socket Mode for real-time messaging.

Pre-built Binaries
If you installed via the one-line script or Homebrew, Slack support is already included. Just configure config.toml below. The feature flag is only needed when building from source.

Create a Slack App

  1. Go to api.slack.com/apps and click Create New App
  2. Choose From scratch, name it (e.g., "aidaemon"), and select your workspace
  3. Under Socket Mode, enable it and generate an App-Level Token with the connections:write scope — this is your app_token (xapp-...)
  4. Under OAuth & Permissions, add these Bot Token Scopes:
    • channels:read — list members in public channels
    • chat:write — send messages
    • files:read — download files sent by users
    • files:write — upload files to Slack
    • groups:read — list members in private channels (needed for resolving user names in private channels)
    • im:read — read DM metadata (required for file transfers in direct messages)
    • reactions:write — add status reactions (hourglass during processing)
    • users:read — resolve user info
  5. Under Event Subscriptions, enable events and subscribe to:
    • message.channels — messages in public channels
    • message.groups — messages in private channels
    • message.im — direct messages
  6. Under App Home, scroll to Show Tabs and enable the Messages Tab. Check "Allow users to send Slash commands and messages from the messages tab" — without this, users cannot DM the bot.
  7. Install the app to your workspace — copy the Bot User OAuth Token (xoxb-...)

Configuration

config.toml
[slack]
enabled = true
app_token = "xapp-1-..."
bot_token = "xoxb-..."
allowed_user_ids = ["U123456789"]
use_threads = true
KeyTypeDefaultDescription
enabledboolfalseEnable the Slack channel
app_tokenstring—App-Level Token for Socket Mode (xapp-...). Supports "keychain" and ${ENV}.
bot_tokenstring—Bot User OAuth Token (xoxb-...). Supports "keychain" and ${ENV}.
allowed_user_idsarray[]Slack user IDs allowed to interact. Empty = no restriction.
use_threadsbooltrueReply in threads by default. Each thread gets its own session context.

Find Your Slack User ID

Click on your profile in Slack, then click More → Copy member ID. The format is U followed by alphanumeric characters (e.g., U0123ABCDEF).

Features

  • Socket Mode — real-time WebSocket connection, no public URL required
  • Threaded replies — configurable threaded conversations with per-thread session context
  • File transfer — send and receive files through Slack
  • Block Kit approvals — interactive buttons for terminal command approval
  • Slash commands — same commands as Telegram (/cost, /model, /tasks, etc.)
  • Status reactions — hourglass emoji while processing, removed on completion
  • Markdown conversion — standard markdown automatically converted to Slack mrkdwn format
  • Message chunking — long responses split to respect Slack’s 39KB message limit
  • Auto-reconnect — exponential backoff on connection failure (5s → 60s max)

Session Model

Slack sessions are identified by channel and thread:

  • Channel message: slack:{channel_id}
  • Thread message: slack:{channel_id}:{thread_ts} (when use_threads is enabled)

Each session maintains its own conversation history, working memory, and facts context.

Access Control
If allowed_user_ids is empty, anyone in the workspace who can message the bot can interact with it. Always set this in production.