Agent MessengerAgent Messenger
Platform Guides

Slack Bot

Complete reference for the agent-slackbot CLI.

Tip: agent-slackbot uses bot tokens (xoxb-) instead of user tokens. Ideal for server-side and CI/CD integrations.

Quick Start

# 1. Set your bot token (from api.slack.com/apps)
agent-slackbot auth set xoxb-your-bot-token

# 2. Verify authentication
agent-slackbot auth status

# 3. Send a message
agent-slackbot message send C0ACZKTDDC0 "Hello from bot!"

Authentication

Create a Slack App

The fastest way to get started is to create an app from the manifest below:

  1. Go to api.slack.com/apps → Create New App → From an app manifest
  2. Select your workspace
  3. Paste the manifest below (choose YAML tab) and click Next → Create
  4. Click Install App in the left sidebar, then hit Install to Workspace
  5. Copy the Bot User OAuth Token (starts with xoxb-) from the Install App page
display_information:
  name: Agent Messenger Bot
  description: Bot for agent-messenger CLI integration
  background_color: '#1a1a2e'

features:
  bot_user:
    display_name: agent-messenger
    always_online: false

oauth_config:
  scopes:
    bot:
      - chat:write
      - channels:history
      - channels:read
      - channels:join
      - groups:history
      - groups:read
      - users:read
      - users:read.email
      - reactions:write
      - reactions:read
      - files:read
      - files:write

settings:
  org_deploy_enabled: false
  socket_mode_enabled: false
  token_rotation_enabled: false

Then set the token:

# Basic setup
agent-slackbot auth set xoxb-your-bot-token

# Or with a custom bot identifier for multi-bot setups
agent-slackbot auth set xoxb-your-bot-token --bot deploy --name "Deploy Bot"

# Verify it works
agent-slackbot auth status

Authentication Commands

# Check bot auth status
agent-slackbot auth status

# Clear all stored credentials
agent-slackbot auth clear

Multi-Bot Support

Store multiple bot tokens and switch between them:

# Add multiple bots
agent-slackbot auth set xoxb-deploy-token --bot deploy --name "Deploy Bot"
agent-slackbot auth set xoxb-alert-token --bot alert --name "Alert Bot"

# List all stored bots
agent-slackbot auth list

# Switch active bot
agent-slackbot auth use deploy

# Use a specific bot for one command (without switching)
agent-slackbot message send C0ACZKTDDC0 "Alert!" --bot alert

# Remove a stored bot
agent-slackbot auth remove deploy

Scopes Reference

ScopeUsed For
chat:writeSending and updating messages
channels:historyReading public channel messages
channels:readListing public channels
channels:joinJoining public channels
groups:historyReading private channel messages
groups:readListing private channels
users:readListing users
users:read.emailReading user emails
reactions:writeAdding/removing reactions
reactions:readListing reactions
files:readListing/inspecting/downloading files
files:writeUploading and deleting files

Environment Variables (CI/CD)

export E2E_SLACKBOT_TOKEN=xoxb-your-bot-token
export E2E_SLACKBOT_WORKSPACE_ID=T123456
export E2E_SLACKBOT_WORKSPACE_NAME="My Workspace"

Commands

Whoami Command

# Show current authenticated bot
agent-slackbot whoami
agent-slackbot whoami --pretty
agent-slackbot whoami --bot <bot-id>

Message Commands

# Send a message
agent-slackbot message send <channel> <text>
agent-slackbot message send C0ACZKTDDC0 "Hello world"

# Send a threaded reply
agent-slackbot message send C0ACZKTDDC0 "Reply" --thread <ts>

# List messages
agent-slackbot message list <channel>
agent-slackbot message list C0ACZKTDDC0 --limit 50

# Get a single message
agent-slackbot message get <channel> <ts>

# Get thread replies
agent-slackbot message replies <channel> <thread_ts>
agent-slackbot message replies C0ACZKTDDC0 1234567890.123456 --limit 50

# Edit a message (bot's own messages only)
agent-slackbot message edit <channel> <ts> <new-text>

# Delete a message (bot's own messages only)
agent-slackbot message delete <channel> <ts> --force

# Show typing/status indicator in an AI Assistant thread
agent-slackbot message typing <channel> <thread_ts>
agent-slackbot message typing C0ACZKTDDC0 1234567890.123456 "is analyzing..."
agent-slackbot message typing C0ACZKTDDC0 1234567890.123456 ""   # clear status

message typing calls Slack's assistant.threads.setStatus API. It only works inside AI Assistant threads (not regular channels/DMs) and requires the chat:write bot scope. The status auto-clears when your bot posts the next message, or after 2 minutes if no message is sent. Pass an empty string "" to clear the status manually.

Channel Commands

# List channels
agent-slackbot channel list
agent-slackbot channel list --limit 50

# Get channel info
agent-slackbot channel info <channel>
agent-slackbot channel info C0ACZKTDDC0

User Commands

# List users
agent-slackbot user list
agent-slackbot user list --limit 50

# Get user info
agent-slackbot user info <user-id>

Reaction Commands

# Add reaction
agent-slackbot reaction add <channel> <ts> <emoji>
agent-slackbot reaction add C0ACZKTDDC0 1234567890.123456 thumbsup

# Remove reaction
agent-slackbot reaction remove <channel> <ts> <emoji>

File Commands

# Upload a file to a channel
agent-slackbot file upload <channel> <path>
agent-slackbot file upload C0ACZKTDDC0 ./report.pdf
agent-slackbot file upload C0ACZKTDDC0 ./log.txt --filename build-log.txt
agent-slackbot file upload C0ACZKTDDC0 ./screenshot.png --thread 1234567890.123456 --comment "FYI"

# List files visible to the bot
agent-slackbot file list
agent-slackbot file list --channel C0ACZKTDDC0
agent-slackbot file list --user U123 --limit 50

# Show file details
agent-slackbot file info <file-id>

# Download a file by ID
agent-slackbot file download <file-id>
agent-slackbot file download F0123ABC ./downloads/

# Delete a file (bot's own files only)
agent-slackbot file delete <file-id> --force

file upload requires the files:write scope; the read commands (list, info, download) require files:read. The bot can only delete files it uploaded.

Key Differences from agent-slack

Featureagent-slackagent-slackbot
Token typeUser token (xoxc-)Bot token (xoxb-)
Token sourceAuto-extracted from desktop appManual from Slack App config
Message searchYesNo
File operationsYesUpload/list/info/download/delete (with scopes)
SnapshotYesNo
Edit/delete messagesAny messageBot's own only
Multi-bot supportN/AYes (--bot flag)
CI/CD friendlyRequires desktop appYes

AI Agent Integration

See skills/agent-slackbot/ for:

  • Complete skill documentation
  • Runnable templates
  • Common patterns for AI agents

On this page