Agent MessengerAgent Messenger
Platform Guides

Slack

Complete reference for the agent-slack CLI.

Tip: agent-slack is a shortcut for agent-messenger slack.

Quick Start

# 1. Extract credentials from Slack desktop app or browser (zero-config!)
agent-slack auth extract

# 2. Get workspace snapshot
agent-slack snapshot

# 3. Send a message
agent-slack message send general "Hello from AI agent!"

Authentication

Seamless Token Extraction

agent-slack automatically extracts your Slack credentials from the desktop app or Chromium browser:

agent-slack auth extract

# Use --debug for troubleshooting
agent-slack auth extract --debug

# Scan custom Chromium profile/user-data dirs (repeatable or comma-separated)
agent-slack auth extract --browser-profile ~/browser-data
agent-slack auth extract --browser-profile "$HOME/work-profile,$HOME/personal-profile"

This command:

  • Auto-detects your platform (macOS/Linux/Windows)
  • Supports both direct download and App Store versions on macOS
  • Extracts xoxc token and xoxd cookie
  • Validates tokens against Slack API
  • Discovers ALL logged-in workspaces
  • Stores credentials securely in ~/.config/agent-messenger/
  • Supports --browser-profile <path> for agent-browser profiles, custom Chrome user data dirs, or portable browser profiles

QR Code Sign-In

When the desktop app isn't installed (or extraction isn't an option), sign in with a QR code from a device where you're already logged into Slack. This runs entirely over HTTP — no browser automation required:

# In Slack (desktop or web): your name (top-left) → "Sign in on mobile".
# Right-click the QR code → "Copy Image Address", then pipe it in:
pbpaste | agent-slack auth qr

# Or pass the data URL directly:
agent-slack auth qr "data:image/png;base64,iVBORw0KGgo..."

# Show each redirect hop while debugging:
agent-slack auth qr --debug

This decodes the QR's one-time z-app- login URL, follows Slack's server-side redirect chain to capture the session cookie, retrieves the matching client token, and stores credentials like auth extract.

  • The QR link is single-use — generate a fresh one if it expires.
  • No Chrome/Chromium or desktop app is required.
  • Works with workspaces that allow password/email sign-in. SSO-only / Enterprise Grid workspaces that disable the mobile QR flow are not supported.

Multi-Workspace Management

# List all authenticated workspaces
agent-slack workspace list

# Switch to a different workspace
agent-slack workspace switch <workspace-id>

# Show current workspace
agent-slack workspace current

# Remove a workspace
agent-slack workspace remove <workspace-id>

# Check auth status
agent-slack auth status

# Logout from a workspace (defaults to the --workspace selection, then current)
agent-slack auth logout
agent-slack auth logout <workspace-id>

# Run one command against another workspace without switching
agent-slack --workspace <workspace-id> channel list
agent-slack --workspace <workspace-id> auth status
agent-slack --workspace <workspace-id> auth logout

The global --workspace <id> flag goes before the command and applies to every command that uses a stored workspace, including auth status and auth logout. It targets that workspace for this one invocation only and does not change the current workspace. If the id is not stored, auth status fails with Workspace not found: <id>. auth extract and auth qr discover workspaces instead of targeting one, so the flag does not affect them; they set the current workspace only when none is set yet.

Commands

Whoami Command

# Show current authenticated user
agent-slack whoami
agent-slack whoami --pretty

Output includes the authenticated user's identity information.

Message Commands

# Send a message
agent-slack message send <channel> <text>
agent-slack message send general "Hello world"

# Send a threaded reply
agent-slack message send general "Reply" --thread <ts>

# List messages
agent-slack message list <channel>
agent-slack message list general --limit 50

# Get a single message by timestamp
agent-slack message get <channel> <ts>
agent-slack message get general 1234567890.123456

# Get thread replies
agent-slack message replies <channel> <thread_ts>
agent-slack message replies general 1234567890.123456 --limit 50

# Search messages across workspace
agent-slack message search <query>
agent-slack message search "project update" --limit 50

# Edit a message
agent-slack message edit <channel> <ts> <new-text>

# Delete a message
agent-slack message delete <channel> <ts> --force

# Schedule a message (post-at is a Unix timestamp)
agent-slack message schedule <channel> <text> <post-at>
agent-slack message schedule general "Friday update" 1700000000
agent-slack message schedule general "Thread reply" 1700000000 --thread 1234567890.123456

# List scheduled messages
agent-slack message scheduled-list
agent-slack message scheduled-list --channel general

# Delete a scheduled message
agent-slack message scheduled-delete <channel> <scheduled-message-id>

# Send an ephemeral message (visible to one user only)
agent-slack message ephemeral <channel> <user-id> <text>

# Get permalink for a message
agent-slack message permalink <channel> <ts>

Channel Commands

# List channels (excludes archived by default)
agent-slack channel list
agent-slack channel list --type public
agent-slack channel list --type private
agent-slack channel list --type dm
agent-slack channel list --include-archived

# Get channel info
agent-slack channel info <channel>
agent-slack channel info general

# Get channel message history (alias for message list)
agent-slack channel history <channel>
agent-slack channel history general --limit 100

# Open a DM channel with a user (returns channel ID)
agent-slack channel open <user_id>
agent-slack channel open U0ABC123,U0DEF456

# List users in a channel
agent-slack channel users <channel>
agent-slack channel users general --include-bots

# Create a channel
agent-slack channel create <name>
agent-slack channel create my-project --private

# Archive a channel
agent-slack channel archive <channel>

# Set channel topic
agent-slack channel set-topic <channel> <topic>

# Set channel purpose
agent-slack channel set-purpose <channel> <purpose>

# Invite users to channel
agent-slack channel invite <channel> <users>
agent-slack channel invite general U0ABC123,U0DEF456

# Join a channel
agent-slack channel join <channel>

# Leave a channel
agent-slack channel leave <channel>

User Commands

# List users
agent-slack user list
agent-slack user list --include-bots

# Get user info
agent-slack user info <user>

# Get current user
agent-slack user me

# Look up user by email
agent-slack user lookup <email>
agent-slack user lookup alice@example.com

# Get user profile
agent-slack user profile <user-id>

# Set your status (emoji name without colons)
agent-slack user set-status "In a meeting"
agent-slack user set-status "In a meeting" --emoji calendar
agent-slack user set-status "On vacation" --emoji palm_tree --expiration 1700100000

Reaction Commands

# Add reaction
agent-slack reaction add <channel> <ts> <emoji>
agent-slack reaction add general 1234567890.123456 thumbsup

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

# List reactions
agent-slack reaction list <channel> <ts>

File Commands

# Upload file
agent-slack file upload <channel> <path>
agent-slack file upload general ./report.pdf

# List files
agent-slack file list
agent-slack file list --channel general

# Get file info
agent-slack file info <file-id>

# Download file
agent-slack file download <file-id>
agent-slack file download <file-id> [output-path]
agent-slack file download F0ABC123 ./downloads/

# Delete a file
agent-slack file delete <file-id>

Snapshot Command

Get workspace overview for AI agents (brief by default):

# Brief snapshot (default) — fast, minimal API calls
agent-slack snapshot

# Full snapshot — includes messages, users, user groups (slow, large output)
agent-slack snapshot --full

# Filtered full snapshots
agent-slack snapshot --full --channels-only
agent-slack snapshot --full --users-only

# Limit messages per channel (only with --full)
agent-slack snapshot --full --limit 10

Default returns brief JSON with:

  • Workspace metadata
  • Channels (id, name) — non-archived only
  • Hint for next commands

With --full, returns comprehensive JSON with:

  • Workspace metadata
  • Channels (id, name, topic, purpose, is_private, is_archived)
  • Recent messages (ts, text, user, channel)
  • Users (id, name, profile)
  • User groups (id, name, handle, description, user_count, users)

Activity Commands

# List activity feed
agent-slack activity list
agent-slack activity list --limit 50

# Show only unread activity
agent-slack activity list --unread

# Filter by activity types
agent-slack activity list --types thread_reply,message_reaction,at_user,at_channel,keyword

Unread Commands

# Get unread counts for all channels
agent-slack unread counts

# Get thread subscription details
agent-slack unread threads <channel> <thread_ts>

# Mark channel as read up to a timestamp
agent-slack unread mark <channel> <ts>

Drafts Commands

# List message drafts
agent-slack drafts list
agent-slack drafts list --limit 10
agent-slack drafts list --cursor <next_cursor>

Saved Items Commands

# List saved items
agent-slack saved list
agent-slack saved list --limit 10
agent-slack saved list --cursor <next_cursor>

Sections Commands

# List channel sections (sidebar folders)
agent-slack sections list

Pin Commands

# Pin a message
agent-slack pin add <channel> <ts>
agent-slack pin add general 1234567890.123456

# Unpin a message
agent-slack pin remove <channel> <ts>

# List pinned messages
agent-slack pin list <channel>
agent-slack pin list general

Bookmark Commands

# Add a bookmark to a channel
agent-slack bookmark add <channel> <title> <link>
agent-slack bookmark add general "Design Docs" "https://example.com/docs" --emoji :bookmark:

# Edit a bookmark
agent-slack bookmark edit <channel> <bookmark-id> --title "New Title" --link "https://new.url"

# Remove a bookmark
agent-slack bookmark remove <channel> <bookmark-id>

# List bookmarks
agent-slack bookmark list <channel>

Reminder Commands

# Add a reminder (time is a Unix timestamp)
agent-slack reminder add <text> <time>
agent-slack reminder add "Review PR" 1700000000
agent-slack reminder add "Team standup" 1700003600 --user U0ABC123

# List reminders
agent-slack reminder list

# Complete a reminder
agent-slack reminder complete <reminder-id>

# Delete a reminder
agent-slack reminder delete <reminder-id>

Usergroup Commands

# List all user groups
agent-slack usergroup list
agent-slack usergroup list --include-disabled
agent-slack usergroup list --include-users

# Create a user group
agent-slack usergroup create <name>
agent-slack usergroup create "Marketing Team" --handle marketing-team --description "Marketing gurus"
agent-slack usergroup create "Engineering" --channels C012ABC,C034DEF

# Update a user group
agent-slack usergroup update <usergroup-id> --name "New Name"
agent-slack usergroup update S0616NG6M --handle new-handle --description "Updated description"
agent-slack usergroup update S0616NG6M --channels C012ABC,C034DEF

# Enable a disabled user group
agent-slack usergroup enable <usergroup-id>

# Disable a user group
agent-slack usergroup disable <usergroup-id>

# List members of a user group
agent-slack usergroup members <usergroup-id>
agent-slack usergroup members S0616NG6M --include-disabled

# Update members of a user group (replaces all members)
agent-slack usergroup members-update <usergroup-id> <user-ids>
agent-slack usergroup members-update S0616NG6M U060R4BJ4,U060RNRCZ

Emoji Commands

# List custom workspace emoji
agent-slack emoji list

AI Agent Integration

See skills/agent-slack/ for:

  • Complete skill documentation
  • Runnable templates

On this page