slack-rs
Skill4 starsChanged 7 months agoMITView on GitHub
Slack Web API automation via the slack-rs CLI (Rust). Use when you need to authenticate to Slack via OAuth (PKCE), manage multiple workspace profiles, call arbitrary Slack Web API methods (e.g. chat.postMessage, conversations.list, users.info), and run safe scripted Slack operations from the terminal. Includes tunnel-assisted remote login (see auth login --help), encrypted profile export/import, and a write-safety guard via SLACKCLI_ALLOW_WRITE. Credentials are stored in file-based storage under ~/.config/slack-rs/.
- Installs packages
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Use slack-rs to interact with Slack workspaces using your own OAuth credentials.
- Distinctive: line 36
Create a Slack app and configure OAuth.
- Very specific: line 45
Use the manifest flow (--cloudflared) and paste the generated YAML into Slack, or
- Distinctive: line 49
Add required "User Token Scopes" for your use case
- Distinctive: line 97
Use generic API calls for anything supported by Slack Web API:
- Distinctive: line 133
If your Slack app has both a bot token and a user token, set the default token type per profile:
- Distinctive: line 150
Use these commands to discover what the CLI can do and how to call it (machine-readable):
- Very specific: line 165
Use the convenience commands instead of api call for common tasks:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
slack-rs - Slack Web API CLI (Rust)
Use slack-rs to interact with Slack workspaces using your own OAuth credentials. It supports multiple profiles (workspaces/apps), stores credentials in file-based storage under ~/.config/slack-rs/, and can call any Slack Web API method.
Install
Install from crates.io (recommended):
cargo install slack-rsBuild from source:
git clone https://github.com/tumf/slack-rs.git
cd slack-rs
cargo build --release
./target/release/slack-rs --helpOr install from a local checkout:
cargo install --path .OAuth Setup (One-time per Slack App)
Create a Slack app and configure OAuth.
Recommended login flow (especially for remote/SSH environments): use --cloudflared.
In this mode, slack-rs auth login generates a Slack App Manifest YAML for you (and copies it to clipboard, best effort).
- Go to https://api.slack.com/apps and create an app.
- Copy your Client ID and Client Secret from "Basic Information" -> "App Credentials".
Either:
- Use the manifest flow (
--cloudflared) and paste the generated YAML into Slack, or Configure OAuth manually (alternative):
- Under "OAuth & Permissions", add redirect URL:
http://127.0.0.1:8765/callback - Add required "User Token Scopes" for your use case
- Under "OAuth & Permissions", add redirect URL:
- Use the manifest flow (
Recommended: store OAuth config per profile (client secret is stored securely in file storage).
slack-rs config oauth set my-workspace \
--client-id 123456789012.1234567890123 \
--redirect-uri http://127.0.0.1:8765/callback \
--scopes "chat:write,users:read,channels:read"You can use --scopes "all" for a broad preset, or customize with --bot-scopes and --user-scopes flags.
Common scopes:
chat:write- post messagesusers:read- view userschannels:read- list public channelssearch:read- search workspace contentreactions:write- add/remove reactions
Full list: https://api.slack.com/scopes
Authenticate (Per profile)
slack-rs auth login my-workspace
slack-rs auth status my-workspace
slack-rs auth listRemote/SSH environments (recommended):
slack-rs auth login my-workspace --client-id 123456789012.1234567890123 --cloudflaredNote: Check slack-rs auth login --help for current tunnel support (e.g., --cloudflared, --ngrok).
During login, the CLI opens a browser for OAuth authorization and stores:
- Profile metadata in
~/.config/slack-rs/profiles.json - OAuth config and tokens in files under
~/.config/slack-rs/(treat as secrets)
Security note: ~/.config/slack-rs/ contains OAuth credentials (client secrets and access tokens). Treat it as sensitive.
Make API Calls
Use generic API calls for anything supported by Slack Web API:
slack-rs api call users.info user=U123456
slack-rs api call conversations.list limit=200
slack-rs api call conversations.history channel=C123456 limit=50
slack-rs api call chat.postMessage channel=C123456 text="Hello from slack-rs"Unified Output Envelope
By default, commands output a unified structure:
{
"meta": {
"profile_name": "default",
"method": "conversations.list",
"command": "api call",
"token_type": "user"
},
"response": {
"ok": true,
"channels": []
}
}To get the raw Slack Web API response (without the envelope), use --raw:
slack-rs api call conversations.list --rawChoose Bot vs User Token
If your Slack app has both a bot token and a user token, set the default token type per profile:
slack-rs config set my-workspace --token-type user
slack-rs config set my-workspace --token-type botConfirm with:
slack-rs auth status my-workspaceFor more copy/pasteable recipes, see slack-rs/references/recipes.md.
Introspection (Commands / Help / Schemas)
Use these commands to discover what the CLI can do and how to call it (machine-readable):
slack-rs commands --json
slack-rs conv list --help --json
slack-rs msg post --help --json
slack-rs schema --command msg.post --output json-schema
slack-rs schema --command conv.list --output json-schema
slack-rs schema --command api.call --output json-schemaConversation Helpers
Use the convenience commands instead of api call for common tasks:
slack-rs conv list
slack-rs conv search <pattern>
slack-rs conv history <channel_id>Notes:
- Command names accept both dot and space formats (e.g.
conv.list==conv list,msg.post==msg post). schemadescribes the default enveloped JSON output; it does not describe--rawoutput.metais a baseline envelope and not exhaustive; additional fields may be added over time.conv listsupports--filter,--format, and--sort(seeslack-rs conv list --help).conv selectandconv history --interactiverequire an interactive terminal (TTY).
Example output (slack-rs schema --command msg.post --output json-schema):
{
"schemaVersion": 1,
"type": "schema",
"ok": true,
"command": "msg.post",
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"schemaVersion": {
"type": "integer",
"description": "Schema version number"
},
"type": {
"type": "string",
"description": "Response type identifier"
},
"ok": {
"type": "boolean",
"description": "Indicates if the operation was successful"
},
"response": {
"type": "object",
"description": "Slack API response data"
},
"meta": {
"type": "object",
"description": "Metadata about the request and profile",
"properties": {
"profile": {"type": "string"},
"team_id": {"type": "string"},
"user_id": {"type": "string"},
"method": {"type": "string"},
"command": {"type": "string"}
}
}
},
"required": ["schemaVersion", "type", "ok"]
}
}Safe Defaults for Write Operations
Many Slack methods are write operations (posting, updating, deleting, reactions). Use the guard in environments where writes are risky:
export SLACKCLI_ALLOW_WRITE=falseRe-enable explicitly when you intend to write:
export SLACKCLI_ALLOW_WRITE=trueProfile Backup / Migration
Export/import profiles using encrypted files (treat as secrets):
# Prompt for passphrase (recommended)
slack-rs auth export --all --out all-profiles.enc --passphrase-prompt
slack-rs auth import --all --in all-profiles.enc --passphrase-promptFor non-interactive automation options, refer to slack-rs auth export --help and slack-rs auth import --help.
Configuration
Common environment variables:
SLACKCLI_ALLOW_WRITE: allow/deny write operations (default: allowed)SLACK_OAUTH_BASE_URL: custom OAuth base URL (testing/enterprise Slack)
For export/import passphrase options, use --passphrase-prompt or see slack-rs auth export --help.
Troubleshooting
- Remote environments: use a tunnel (ngrok/cloudflared) and set your profile redirect URI accordingly.
Private channels are missing
Private channels typically require a user token. Ensure:
slack-rs config set <profile> --token-type user- Your Slack app has user scopes (
groups:read,groups:history/conversations:read, etc.)
Useful Commands
Profile management:
slack-rs auth list
slack-rs auth status <profile>
slack-rs auth rename <old> <new>
slack-rs auth logout <profile>OAuth config management:
slack-rs config oauth show <profile>
slack-rs config oauth delete <profile>In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- greats-soul-archive-contributor/AGENTS.mdAGENTS.md
- agentic-cli-designSkill
- ai-chat-frontendSkill
- autoresearch-agentSkill
- brainstorm-frameworksSkill
- business-planningSkill
- clawdbot-configSkill
- dashboard-design-guidebookSkill
- fermi-estimationSkill
- firecrawlSkill
- gogcliSkill
- greats-soul-archive-contributorSkill
- jp-grantsSkill
- openclaw-agent-creatorSkill
- opencode-agent-creatorSkill
- opencode-command-creatorSkill
- openspec-brownfield-baselineSkill
- oss-publishSkill
- product-improvement-proposalSkill
- python-uv-projectSkill
- rust-cliSkill
- unit-test-hygieneSkill
- wt-setupSkill
- youtube-summarizerSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

