重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
slack-messaging by obra/superpowers-lab
npx skills add https://github.com/obra/superpowers-lab --skill slack-messaging使用 slackcli (shaharia-lab/slackcli) 从命令行发送和读取 Slack 消息。
下载二进制文件:
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-linux 替换为 slackcli-macos
macOS (Apple Silicon):替换为 slackcli-macos-arm64
slackcli 使用浏览器会话令牌 (xoxc + xoxd) - 无需创建 Slack 应用。
./scripts/extract-tokens <workspace-url>
此操作将引导用户从浏览器开发者工具中提取令牌。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
slackcli auth login-browser \
--xoxd="xoxd-..." \
--xoxc="xoxc-..." \
--workspace-url=https://your-workspace.slack.com
slackcli auth list
使用 slackcli conversations list 来发现频道及其 ID:
# 列出所有频道
slackcli conversations list
# 过滤输出
slackcli conversations list | grep -i "channel-name"
# 发送到频道(使用 conversations list 中的频道 ID)
slackcli messages send --recipient-id=C0XXXXXXXX --message="Hello from CLI"
# 发送到私信(使用用户的私信频道 ID)
slackcli messages send --recipient-id=D0XXXXXXXX --message="Hey"
# 在主题中回复
slackcli messages send --recipient-id=C0XXXXXXXX --message="Thread reply" --thread-ts=1769756026.624319
--recipient-id 始终是频道 ID (C...) 或私信频道 ID (D...)。
# 从频道读取最后 N 条消息
slackcli conversations read C0XXXXXXXX --limit=10
# 以 JSON 格式读取(用于解析)
slackcli conversations read C0XXXXXXXX --limit=10 --json
# 读取主题
slackcli conversations read C0XXXXXXXX --thread-ts=1769756026.624319
slackcli conversations list
返回所有公共频道、私有频道和私信及其 ID。
要验证机器人或集成是否正确发布了消息:
# 读取频道,检查预期的消息
slackcli conversations read CHANNEL_ID --limit=5 --json | jq '.messages[] | select(.text | contains("expected text"))'
要发送测试消息并验证往返过程:
# 发送
slackcli messages send --recipient-id=CHANNEL_ID --message="integration test $(date +%s)"
# 读回
slackcli conversations read CHANNEL_ID --limit=1 --json
slackcli 支持多个工作区。为您需要的每个工作区运行认证流程:
# 添加第一个工作区
./scripts/extract-tokens https://workspace-one.slack.com
# 添加第二个工作区
./scripts/extract-tokens https://workspace-two.slack.com
# 列出所有已认证的工作区
slackcli auth list
发送消息时,slackcli 会根据频道 ID 自动路由到正确的工作区。
~/.config/slackcli/workspaces.json每周安装数
66
代码仓库
GitHub 星标数
243
首次出现
2026年2月1日
安全审计
安装于
opencode62
codex59
github-copilot55
cursor55
gemini-cli55
claude-code54
Send and read Slack messages from the command line using slackcli (shaharia-lab/slackcli).
Download the binary:
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
slackcli uses browser session tokens (xoxc + xoxd) - no Slack app creation required.
./scripts/extract-tokens <workspace-url>
This walks the user through extracting tokens from browser DevTools.
slackcli auth login-browser \
--xoxd="xoxd-..." \
--xoxc="xoxc-..." \
--workspace-url=https://your-workspace.slack.com
slackcli auth list
Use slackcli conversations list to discover channels and their IDs:
# List all channels
slackcli conversations list
# Filter output
slackcli conversations list | grep -i "channel-name"
# 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...).
# 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
slackcli conversations list
Returns all public channels, private channels, and DMs with their IDs.
To verify a bot or integration posted a message correctly:
# 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:
# Send
slackcli messages send --recipient-id=CHANNEL_ID --message="integration test $(date +%s)"
# Read back
slackcli conversations read CHANNEL_ID --limit=1 --json
slackcli supports multiple workspaces. Run the auth flow for each workspace you need:
# 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.
~/.config/slackcli/workspaces.jsonWeekly Installs
66
Repository
GitHub Stars
243
First Seen
Feb 1, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykFail
Installed on
opencode62
codex59
github-copilot55
cursor55
gemini-cli55
claude-code54
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
47,200 周安装