agent-slack

Slack CLI for AI agents

Language
Go
License
PolyForm Perimeter 1.0.0
Category
CLI Tool

A Slack CLI for AI agents that reads and writes Slack through compact, structured output. It is designed for token-efficient message history, search, unreads, canvases, workflows, user and channel lookups, and carefully gated mutations without exposing Slack tokens to the agent.

Features

01

LLM-shaped output — lists default to NDJSON, single resources to JSON, and bulky message bodies stay truncatable

02

Slack reading surface — fetch permalinks, threads, channel history, unreads, saved-for-later items, canvases, files, users, and channels

03

Workflow support — discover bookmarked workflows, preview triggers, inspect form fields and steps, and run workflows when explicitly asked

04

Keychain-first credentials — browser and bot tokens live in the OS keychain where available and are never printed back

05

Structured errors — every failure is JSON with fixable_by: agent|human|retry and a practical hint

06

Mutation safety — destructive actions require --yes and explain what would happen before they run

07

Multi-workspace aware — use a default workspace, --workspace selectors, or workspace-carrying permalinks

08

Mock Slack fixture — HTTP logic is dependency-injected and tested without touching real Slack

Install

Homebrew

>_
$ brew install shhac/tap/agent-slack

AI Agent Skill

>_
$ npx skills add shhac/agent-skills --skill agent-slack --global

GitHub Release (macOS)

>_
$ curl -L https://github.com/shhac/agent-slack/releases/latest/download/agent-slack-darwin-arm64.tar.gz | tar xz

Go Install

>_
$ go install github.com/shhac/agent-slack/cmd/agent-slack@latest

Build from Source

>_
$ git clone https://github.com/shhac/agent-slack.git && cd agent-slack && make build

Getting Started

agent-slack authenticates against a real Slack workspace while keeping secrets out of chat, argv, and agent context. Browser credentials unlock the broadest Slack surface, including client APIs such as workflows and Later.

01 · Import Slack Desktop credentials

>_
$ agent-slack auth import-desktop

Extracts browser credentials from Slack Desktop and stores the secrets in the OS keychain where available.

02 · Or import from a browser

>_
$ agent-slack auth import-browser firefox

Use chrome, brave, firefox, zen, opera, or safari when Slack Desktop is not available.

03 · Verify the workspace

>_
$ agent-slack auth test

Checks the stored credentials without printing tokens or cookies.

04 · Read Slack with compact output

>_
$ agent-slack message list '#general' --limit 25 --resolve-users

Lists return NDJSON so agents can scan, filter, and chain IDs into follow-up commands.

Usage

>_ Get one message from a permalink
$ agent-slack message get 'https://example.slack.com/archives/C123/p1770165109628379'
>_ List recent channel messages
$ agent-slack message list '#general' --limit 25 --max-body-chars 800
>_ Search messages in a channel
$ agent-slack search messages 'deploy failed' --channel '#ops' --after 2026-06-01
>_ List channel members
$ agent-slack channel members '#general' --resolve-users
>_ Discover workflows in a channel
$ agent-slack workflow list '#ops'
>_ Inspect a workflow schema
$ agent-slack workflow get Ft0001
>_ Use the raw API escape hatch
$ agent-slack api call team.info