slack-agent-cli
Slack for non-humans™
Why "non-humans"?
Humans have eyes, we have jq.
Humans need emojis, we need thread_ts.
Humans want a UI, we just want a clean pipe.
This is not a CLI for you. This is a CLI for your digital entities.
⚠️ Human Warning
This tool defaults to JSON output. If your biological eyes find this hard to parse, use the --human flag. We recommend upgrading your optic nerve or using jq.
Features
- Pipe-First Design - Output is always pure JSON (stdout) while logs go to stderr.
- Agent-Ready - Stateless authentication, perfect for LLMs, scripts, and cron jobs.
- Smart Caching - Resolves channel names (
#general) to IDs (C123...) locally for speed.
Quick Start
For Digital Entities (Default)
# Get channel history as minified JSON
slack-agent-cli messages list --channel C12345
# Pipe directly into other tools
slack-agent-cli messages list --channel "#general" | jq '.[].text'
For Biological Entities
# Initialize configuration
slack-agent-cli config init
# List channels in human-readable format
slack-agent-cli channels list --human
# List recent messages
slack-agent-cli messages list --channel "#general" --limit 10 --human
Installation
Homebrew (macOS/Linux)
brew install kehao95/slack-agent-cli/slack-agent-cli
Go Install
go install github.com/kehao95/slack-agent-cli@latest
Pre-built Binaries
Download from GitHub Releases
Configuration
Quick Setup (1 minute)
- Create Slack App: Go to https://api.slack.com/apps → "Create New App" → "From an app manifest"
- Choose mode & use manifest:
- Install to workspace: Click "Install to Workspace" and authorize
- Copy token: Copy the User OAuth Token (starts with
xoxp-)
- Initialize CLI: Run
slack-agent-cli config init and paste your token
See SLACK_SETUP.md for detailed setup instructions and mode comparison.
Use Cases
The "Pipeline" Approach
# Summarize the last hour of #alerts using an LLM
slack-agent-cli messages list --channel "#alerts" --since 1h | llm "Summarize these alerts"
# Auto-reply to specific errors
slack-agent-cli messages search --query "error: deployment" | \
jq -r '.messages[].ts' | \
xargs -I {} slack-agent-cli messages reply --channel "#ops" --thread {} --text "Investigating..."
License
MIT