slack-agent-cli

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 1 Imported by: 0

README

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)
  1. Create Slack App: Go to https://api.slack.com/apps"Create New App""From an app manifest"
  2. Choose mode & use manifest:
  3. Install to workspace: Click "Install to Workspace" and authorize
  4. Copy token: Copy the User OAuth Token (starts with xoxp-)
  5. 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cache
Package cache provides a persistent, TTL-aware metadata cache stored on disk.
Package cache provides a persistent, TTL-aware metadata cache stored on disk.
usergroups
Package usergroups provides cached usergroup lookups.
Package usergroups provides cached usergroup lookups.
users
Package users provides cached user profile lookups.
Package users provides cached user profile lookups.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL