安装方式
手动下载安装
下载 ZIP 后解压到技能目录即可安装。若在桌面客户端 WebView中直接下载出现异常,本站会改为提示页 + 原始链接,请按页内说明操作。
下载 ZIP (oss-superpowers-lab-slack-messaging-v1.0.0.zip)触发指令
/slack-messaging
跨平台安装指引
该技能声明兼容以下 1 个平台,将 ZIP 解压到对应目录即可被识别。
unzip oss-superpowers-lab-slack-messaging-v1.0.0.zip -d ~/.claude/skills/
目录不存在时请先
mkdir -p 创建;启用 Skill 后请重启对应 Agent 让配置生效。
使用指南
用 slackcli 收发 Slack
在命令行 发送/读取 Slack 消息、查看频道、测集成时使用 slackcli(shaharia-lab/slackcli)。
安装
curl -sL -o /usr/local/bin/slackcli \
"https://github.com/shaharia-lab/slackcli/releases/download/v0.1.1/slackcli-linux"
chmod +x /usr/local/bin/slackcli
macOS Intel:slackcli-macos;Apple Silicon:slackcli-macos-arm64。
认证
使用浏览器会话 token(xoxc + xoxd),不必 建 Slack App。
交互: ./scripts/extract-tokens <workspace-url> 引导从 DevTools 取 token。
手动:
slackcli auth login-browser \
--xoxd="xoxd-..." \
--xoxc="xoxc-..." \
--workspace-url=https://your-workspace.slack.com
验证: slackcli auth list
找频道
slackcli conversations list
slackcli conversations list | grep -i "频道名"
发消息
slackcli messages send --recipient-id=C0XXXXXXXX --message="Hello"
slackcli messages send --recipient-id=D0XXXXXXXX --message="DM"
slackcli messages send --recipient-id=C0XXXXXXXX --message="线程回复" --thread-ts=1769756026.624319
--recipient-id 为频道 ID(C…)或 DM 频道 ID(D…)。
读消息
slackcli conversations read C0XXXXXXXX --limit=10
slackcli conversations read C0XXXXXXXX --limit=10 --json
slackcli conversations read C0XXXXXXXX --thread-ts=1769756026.624319
测集成
发一条再读回,或用 jq 在 JSON 里筛关键字验证机器人是否发帖。
多工作区
对每个工作区跑一遍认证;slackcli auth list 查看;发消息时按频道 ID 自动路由。
Token 注意
浏览器 token 代表 登录用户 而非 Bot;用户退出浏览器会话会失效;凭证在 ~/.config/slackcli/workspaces.json。
# Slack Messaging via slackcli
Send and read Slack messages from the command line using `slackcli` (shaharia-lab/slackcli).
## Installation
Download the binary:
```bash
curl -sL -o /usr/local/bin/slackcli \
"https://github.com/shaharia-lab/slackcli/releases/download/v0.1.1/slackcli-linux"
chmod +x /usr/local/bin/slackcli
```
macOS (Intel): replace `slackcli-linux` with `slackcli-macos`
macOS (Apple Silicon): replace with `slackcli-macos-arm64`
## Authentication
slackcli uses browser session tokens (xoxc + xoxd) - no Slack app creation required.
### Interactive Setup
```bash
./scripts/extract-tokens <workspace-url>
```
This walks the user through extracting tokens from browser DevTools.
### Manual Setup
```bash
slackcli auth login-browser \
--xoxd="xoxd-..." \
--xoxc="xoxc-..." \
--workspace-url=https://your-workspace.slack.com
```
### Verify Auth
```bash
slackcli auth list
```
## Finding Channels
Use `slackcli conversations list` to discover channels and their IDs:
```bash
# List all channels
slackcli conversations list
# Filter output
slackcli conversations list | grep -i "channel-name"
```
## Sending Messages
```bash
# Send to a channel (use channel ID from conversations list)
slackcli messages send --recipient-id=C0XXXXXXXX --message="Hello from CLI"
# Send to a DM (use user's DM channel ID)
slackcli messages send --recipient-id=D0XXXXXXXX --message="Hey"
# Reply in a thread
slackcli messages send --recipient-id=C0XXXXXXXX --message="Thread reply" --thread-ts=1769756026.624319
```
The `--recipient-id` is always a channel ID (C...) or DM channel ID (D...).
## Reading Messages
```bash
# Read last N messages from a channel
slackcli conversations read C0XXXXXXXX --limit=10
# Read as JSON (for parsing)
slackcli conversations read C0XXXXXXXX --limit=10 --json
# Read a thread
slackcli conversations read C0XXXXXXXX --thread-ts=1769756026.624319
```
## Listing Channels
```bash
slackcli conversations list
```
Returns all public channels, private channels, and DMs with their IDs.
## Testing Slack Integrations
To verify a bot or integration posted a message correctly:
```bash
# Read the channel, check for the expected message
slackcli conversations read CHANNEL_ID --limit=5 --json | jq '.messages[] | select(.text | contains("expected text"))'
```
To send a test message and verify the round-trip:
```bash
# Send
slackcli messages send --recipient-id=CHANNEL_ID --message="integration test $(date +%s)"
# Read back
slackcli conversations read CHANNEL_ID --limit=1 --json
```
## Multiple Workspaces
slackcli supports multiple workspaces. Run the auth flow for each workspace you need:
```bash
# Add first workspace
./scripts/extract-tokens https://workspace-one.slack.com
# Add second workspace
./scripts/extract-tokens https://workspace-two.slack.com
# List all authenticated workspaces
slackcli auth list
```
When sending messages, slackcli automatically routes to the correct workspace based on the channel ID.
## Token Notes
- Browser tokens (xoxc/xoxd) act as the logged-in user, not a bot
- Messages sent appear as the user, not an app
- Tokens expire when the user logs out of the browser session
- To refresh: re-extract tokens from a logged-in browser session
- All workspace credentials are stored at `~/.config/slackcli/workspaces.json`