Slack Bot
Complete reference for the agent-slackbot CLI.
Tip:
agent-slackbotuses 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:
- Go to api.slack.com/apps → Create New App → From an app manifest
- Select your workspace
- Paste the manifest below (choose YAML tab) and click Next → Create
- Click Install App in the left sidebar, then hit Install to Workspace
- 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: falseThen 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 statusAuthentication Commands
# Check bot auth status
agent-slackbot auth status
# Clear all stored credentials
agent-slackbot auth clearMulti-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 deployScopes Reference
| Scope | Used For |
|---|---|
chat:write | Sending and updating messages |
channels:history | Reading public channel messages |
channels:read | Listing public channels |
channels:join | Joining public channels |
groups:history | Reading private channel messages |
groups:read | Listing private channels |
users:read | Listing users |
users:read.email | Reading user emails |
reactions:write | Adding/removing reactions |
reactions:read | Listing reactions |
files:read | Listing/inspecting/downloading files |
files:write | Uploading 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
# Update a message (bot's own messages only)
agent-slackbot message update <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 statusmessage 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 C0ACZKTDDC0User 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> --forcefile 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
| Feature | agent-slack | agent-slackbot |
|---|---|---|
| Token type | User token (xoxc-) | Bot token (xoxb-) |
| Token source | Auto-extracted from desktop app | Manual from Slack App config |
| Message search | Yes | No |
| File operations | Yes | Upload/list/info/download/delete (with scopes) |
| Snapshot | Yes | No |
| Edit/delete messages | Any message | Bot's own only |
| Multi-bot support | N/A | Yes (--bot flag) |
| CI/CD friendly | Requires desktop app | Yes |
AI Agent Integration
See skills/agent-slackbot/ for:
- Complete skill documentation
- Runnable templates
- Common patterns for AI agents