Skip to content

RyanMerlin/slackr

Repository files navigation

slackr

slackr is an automation-friendly Slack CLI aimed at local operators, scripts, and agent workflows.

For the machine-facing surface, see docs/cli_for_agents.md.

Current capabilities

  • Auth inspection and token refresh: auth status, auth refresh
  • Workspace introspection: auth-test, me, workspace
  • Agent discovery surface: agent discover, agent workspace, agent channels, agent users, agent messages, agent threads, agent resolve, agent inspect
  • Agent registry export: agent catalog
  • Agent triage: agent triage
  • Channel workflows: channels, channels info, channels members
  • User workflows: user-lookup, users list
  • Message workflows: search, channel-read, thread-read, send, reply, react, message permalink
  • Read-only health checks: doctor
  • Operator setup: init, config ..., completions

Auth setup

slackr resolves auth in this order:

  1. SLACK_BOT_TOKEN
  2. SLACK_APP_ACCESS_TOKEN and optional refresh bundle
  3. Persisted OAuth state at ~/.slackr/auth.toml

Bot token example:

SLACK_BOT_TOKEN=xoxb-...

OAuth refreshable example:

SLACK_APP_ACCESS_TOKEN=xoxe.xoxp-1-...
SLACK_APP_REFRESH_TOKEN=xoxe-1-...
SLACK_APP_ACCESS_TOKEN_EXPIRES_AT=1767225600
SLACK_CLIENT_ID=1234567890.1234567890
SLACK_CLIENT_SECRET=replace-me

By default, slackr loads ~/.slackr/.env. If you use --config /path/to/config.toml, it instead loads /path/to/.env.

Config

Initialize the config directory:

slackr init

Example config.toml:

default_channel = "C1234567890"

[aliases]
general = "C1234567890"
alerts = "C1122334455"

Examples

slackr agent discover
slackr agent catalog
slackr agent channels --query alerts
slackr agent messages "deploy failed"
slackr agent triage "deploy failed"
slackr agent inspect slackr://channel/C123
slackr agent threads slackr://message/C123/1712858703.123456
slackr auth status
slackr channels --query alerts
slackr channels info general
slackr channels members general --all
slackr users list --query ryan
slackr channel-read general --limit 10
slackr thread-read general 1712858703.123456
slackr send general "hello from slackr"
slackr message permalink general 1712858703.123456
slackr doctor
slackr completions powershell > slackr.ps1

JSON output

Use --json on most commands to get a stable wrapper:

{
  "ok": true,
  "data": {},
  "meta": null,
  "error": null
}

Paged commands include metadata such as count, has_more, and next_cursor.

Verification

Release-quality checks for the current tree:

cargo fmt
cargo test
cargo clippy -- -D warnings

About

Automation-friendly Slack CLI for local operators, scripts, and AI agents. Agent discovery surface, triage workflows, OAuth refresh.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages