重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
agent-slackbot by devxoul/agent-messenger
npx skills add https://github.com/devxoul/agent-messenger --skill agent-slackbot一个 TypeScript CLI 工具,使 AI 代理和人类能够使用机器人令牌(xoxb-)与 Slack 工作区交互。与从桌面应用程序提取用户令牌的 agent-slack 不同,agent-slackbot 使用标准的 Slack 机器人令牌进行服务器端和 CI/CD 集成。
# 设置你的机器人令牌
agent-slackbot auth set xoxb-your-bot-token
# 或者为多机器人设置使用自定义机器人标识符
agent-slackbot auth set xoxb-your-bot-token --bot deploy --name "Deploy Bot"
# 验证认证状态
agent-slackbot auth status
# 发送消息
agent-slackbot message send C0ACZKTDDC0 "Hello from bot!"
# 列出频道
agent-slackbot channel list
agent-slackbot 使用从 Slack 应用配置获取的 Slack 机器人令牌(xoxb-):
# 设置机器人令牌(保存前会针对 Slack API 进行验证)
agent-slackbot auth set xoxb-your-bot-token
# 使用自定义机器人标识符设置
agent-slackbot auth set xoxb-your-bot-token --bot deploy --name "Deploy Bot"
# 检查认证状态
agent-slackbot auth status
# 清除存储的凭据
agent-slackbot auth clear
存储多个机器人令牌并在它们之间切换:
# 添加多个机器人
agent-slackbot auth set xoxb-deploy-token --bot deploy --name "Deploy Bot"
agent-slackbot auth set xoxb-alert-token --bot alert --name "Alert Bot"
# 列出所有存储的机器人
agent-slackbot auth list
# 切换活动机器人
agent-slackbot auth use deploy
# 为单条命令使用特定机器人(无需切换)
agent-slackbot message send C0ACZKTDDC0 "Alert!" --bot alert
# 移除存储的机器人
agent-slackbot auth remove deploy
# 区分跨工作区的同名机器人标识符
agent-slackbot auth use T123456/deploy
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
--bot <id> 标志在所有命令中都可用,用于为单次调用覆盖活动机器人。
关于机器人令牌设置(Slack 应用创建、所需作用域、应用清单)和 CI/CD 环境变量,请参阅 references/authentication.md。
代理维护一个 ~/.config/agent-messenger/MEMORY.md 文件作为跨会话的持久记忆。这是由代理管理的 —— CLI 不读取或写入此文件。使用 Read 和 Write 工具来管理你的记忆文件。
在每个任务开始时,使用 Read 工具读取 ~/.config/agent-messenger/MEMORY.md 以加载任何先前发现的工作区 ID、频道 ID、用户 ID 和偏好设置。
发现有用信息后,使用 Write 工具更新 ~/.config/agent-messenger/MEMORY.md。写入触发条件包括:
auth status)channel list 等)user list 等)auth list)写入时,包含完整的文件内容 —— Write 工具会覆盖整个文件。
切勿存储机器人令牌、凭据或任何敏感数据。切勿存储完整的消息内容(仅存储 ID 和频道上下文)。切勿存储文件上传内容。
如果记忆的 ID 返回错误(频道未找到、用户未找到),将其从 MEMORY.md 中移除。不要盲目信任记忆的数据 —— 当某些内容看起来不对劲时进行验证。相比于使用可能已过时的记忆 ID,更倾向于重新列出。
# Agent Messenger Memory
## Slack Workspaces (Bot)
- `T0ABC1234` — Acme Corp
## Bots (Acme Corp)
- `deploy` — Deploy Bot (active)
- `alert` — Alert Bot
## Channels (Acme Corp)
- `C012ABC` — #general (company-wide announcements)
- `C034DEF` — #engineering (team discussion)
- `C056GHI` — #deploys (CI/CD notifications)
## Users (Acme Corp)
- `U0ABC123` — Alice (engineering lead)
- `U0DEF456` — Bob (backend)
## Aliases
- "deploys" → `C056GHI` (#deploys in Acme Corp)
## Notes
- Deploy Bot is used for CI/CD notifications
- Alert Bot is used for error monitoring
记忆让你可以跳过重复的
channel list和auth list调用。当你已经从之前的会话中知道一个 ID 时,直接使用它。
# 发送消息
agent-slackbot message send <channel> <text>
agent-slackbot message send C0ACZKTDDC0 "Hello world"
# 发送线程回复
agent-slackbot message send C0ACZKTDDC0 "Reply" --thread <ts>
# 列出消息
agent-slackbot message list <channel>
agent-slackbot message list C0ACZKTDDC0 --limit 50
# 通过时间戳获取单条消息
agent-slackbot message get <channel> <ts>
# 获取线程回复(包含父消息)
agent-slackbot message replies <channel> <thread_ts>
agent-slackbot message replies C0ACZKTDDC0 1234567890.123456 --limit 50
# 更新消息(仅限机器人自己的消息)
agent-slackbot message update <channel> <ts> <new-text>
# 删除消息(仅限机器人自己的消息)
agent-slackbot message delete <channel> <ts> --force
# 列出机器人可见的频道
agent-slackbot channel list
agent-slackbot channel list --limit 50
# 获取频道信息
agent-slackbot channel info <channel>
agent-slackbot channel info C0ACZKTDDC0
# 列出用户
agent-slackbot user list
agent-slackbot user list --limit 50
# 获取用户信息
agent-slackbot user info <user-id>
# 添加反应
agent-slackbot reaction add <channel> <ts> <emoji>
agent-slackbot reaction add C0ACZKTDDC0 1234567890.123456 thumbsup
# 移除反应
agent-slackbot reaction remove <channel> <ts> <emoji>
所有命令默认输出 JSON 供 AI 使用:
{
"ts": "1234567890.123456",
"channel": "C0ACZKTDDC0",
"text": "Hello world"
}
使用 --pretty 标志获取格式化输出:
agent-slackbot channel list --pretty
关于典型的 AI 代理工作流,请参阅 references/common-patterns.md。
关于可运行的示例,请参阅 templates/ 目录:
post-message.sh - 发送消息并处理错误monitor-channel.sh - 监控频道的新消息workspace-summary.sh - 生成工作区摘要所有命令返回一致的错误格式:
{
"error": "No credentials. Run \"auth set\" first."
}
常见错误:
missing_token: 未配置凭据invalid_token_type: 令牌不是机器人令牌(必须以 xoxb- 开头)not_in_channel: 机器人需要先加入频道slack_webapi_rate_limited_error: 达到速率限制(自动重试并退避)凭据存储在 ~/.config/agent-messenger/slackbot-credentials.json 中(0600 权限)。关于格式和安全详细信息,请参阅 references/authentication.md。
| 功能 | agent-slack | agent-slackbot |
|---|---|---|
| 令牌类型 | 用户令牌(xoxc-) | 机器人令牌(xoxb-) |
| 令牌来源 | 从桌面应用程序自动提取 | 从 Slack 应用配置手动获取 |
| 消息搜索 | 是 | 否(需要用户令牌) |
| 文件操作 | 是 | 否 |
| 快照 | 是 | 否 |
| 编辑/删除消息 | 任何消息 | 仅限机器人自己的消息 |
| 工作区管理 | 多工作区 | 多机器人、多工作区 |
| CI/CD 友好性 | 需要桌面应用程序 | 是(只需设置令牌) |
agent-slackbot: command not foundagent-slackbot 不是 npm 包名。 npm 包是 agent-messenger。
如果包已全局安装,直接使用 agent-slackbot:
agent-slackbot message send general "Hello"
如果包未安装,使用 bunx agent-messenger slackbot:
bunx agent-messenger slackbot message send general "Hello"
切勿运行 bunx agent-slackbot —— 它会失败或安装错误的包,因为 agent-slackbot 不是 npm 包名。
关于其他故障排除(令牌问题、作用域、权限),请参阅 references/authentication.md。
每周安装次数
33
仓库
GitHub Stars
21
首次出现
2026年2月9日
安全审计
安装于
opencode31
gemini-cli30
claude-code29
github-copilot28
codex28
kimi-cli28
A TypeScript CLI tool that enables AI agents and humans to interact with Slack workspaces using bot tokens (xoxb-). Unlike agent-slack which extracts user tokens from the desktop app, agent-slackbot uses standard Slack Bot tokens for server-side and CI/CD integrations.
# Set your bot token
agent-slackbot auth set xoxb-your-bot-token
# Or set with a custom bot identifier for multi-bot setups
agent-slackbot auth set xoxb-your-bot-token --bot deploy --name "Deploy Bot"
# Verify authentication
agent-slackbot auth status
# Send a message
agent-slackbot message send C0ACZKTDDC0 "Hello from bot!"
# List channels
agent-slackbot channel list
agent-slackbot uses Slack Bot tokens (xoxb-) which you get from the Slack App configuration:
# Set bot token (validates against Slack API before saving)
agent-slackbot auth set xoxb-your-bot-token
# Set with a custom bot identifier
agent-slackbot auth set xoxb-your-bot-token --bot deploy --name "Deploy Bot"
# Check auth status
agent-slackbot auth status
# Clear stored credentials
agent-slackbot auth clear
Store multiple bot tokens and switch between them:
# Add multiple bots
agent-slackbot auth set xoxb-deploy-token --bot deploy --name "Deploy Bot"
agent-slackbot auth set xoxb-alert-token --bot alert --name "Alert Bot"
# List all stored bots
agent-slackbot auth list
# Switch active bot
agent-slackbot auth use deploy
# Use a specific bot for one command (without switching)
agent-slackbot message send C0ACZKTDDC0 "Alert!" --bot alert
# Remove a stored bot
agent-slackbot auth remove deploy
# Disambiguate bots with same ID across workspaces
agent-slackbot auth use T123456/deploy
The --bot <id> flag is available on all commands to override the active bot for a single invocation.
For bot token setup (Slack App creation, required scopes, app manifest) and CI/CD environment variables, see references/authentication.md.
The agent maintains a ~/.config/agent-messenger/MEMORY.md file as persistent memory across sessions. This is agent-managed — the CLI does not read or write this file. Use the Read and Write tools to manage your memory file.
At the start of every task , read ~/.config/agent-messenger/MEMORY.md using the Read tool to load any previously discovered workspace IDs, channel IDs, user IDs, and preferences.
After discovering useful information, update ~/.config/agent-messenger/MEMORY.md using the Write tool. Write triggers include:
auth status)channel list, etc.)user list, etc.)auth list)When writing, include the complete file content — the Write tool overwrites the entire file.
Never store bot tokens, credentials, or any sensitive data. Never store full message content (just IDs and channel context). Never store file upload contents.
If a memorized ID returns an error (channel not found, user not found), remove it from MEMORY.md. Don't blindly trust memorized data — verify when something seems off. Prefer re-listing over using a memorized ID that might be stale.
# Agent Messenger Memory
## Slack Workspaces (Bot)
- `T0ABC1234` — Acme Corp
## Bots (Acme Corp)
- `deploy` — Deploy Bot (active)
- `alert` — Alert Bot
## Channels (Acme Corp)
- `C012ABC` — #general (company-wide announcements)
- `C034DEF` — #engineering (team discussion)
- `C056GHI` — #deploys (CI/CD notifications)
## Users (Acme Corp)
- `U0ABC123` — Alice (engineering lead)
- `U0DEF456` — Bob (backend)
## Aliases
- "deploys" → `C056GHI` (#deploys in Acme Corp)
## Notes
- Deploy Bot is used for CI/CD notifications
- Alert Bot is used for error monitoring
Memory lets you skip repeated
channel listandauth listcalls. When you already know an ID from a previous session, use it directly.
# Send a message
agent-slackbot message send <channel> <text>
agent-slackbot message send C0ACZKTDDC0 "Hello world"
# Send a threaded reply
agent-slackbot message send C0ACZKTDDC0 "Reply" --thread <ts>
# List messages
agent-slackbot message list <channel>
agent-slackbot message list C0ACZKTDDC0 --limit 50
# Get a single message by timestamp
agent-slackbot message get <channel> <ts>
# Get thread replies (includes parent message)
agent-slackbot message replies <channel> <thread_ts>
agent-slackbot message replies C0ACZKTDDC0 1234567890.123456 --limit 50
# Update a message (bot's own messages only)
agent-slackbot message update <channel> <ts> <new-text>
# Delete a message (bot's own messages only)
agent-slackbot message delete <channel> <ts> --force
# List channels the bot can see
agent-slackbot channel list
agent-slackbot channel list --limit 50
# Get channel info
agent-slackbot channel info <channel>
agent-slackbot channel info C0ACZKTDDC0
# List users
agent-slackbot user list
agent-slackbot user list --limit 50
# Get user info
agent-slackbot user info <user-id>
# Add reaction
agent-slackbot reaction add <channel> <ts> <emoji>
agent-slackbot reaction add C0ACZKTDDC0 1234567890.123456 thumbsup
# Remove reaction
agent-slackbot reaction remove <channel> <ts> <emoji>
All commands output JSON by default for AI consumption:
{
"ts": "1234567890.123456",
"channel": "C0ACZKTDDC0",
"text": "Hello world"
}
Use --pretty flag for formatted output:
agent-slackbot channel list --pretty
See references/common-patterns.md for typical AI agent workflows.
See templates/ directory for runnable examples:
post-message.sh - Send messages with error handlingmonitor-channel.sh - Monitor channel for new messagesworkspace-summary.sh - Generate workspace summaryAll commands return consistent error format:
{
"error": "No credentials. Run \"auth set\" first."
}
Common errors:
missing_token: No credentials configuredinvalid_token_type: Token is not a bot token (must start with xoxb-)not_in_channel: Bot needs to join the channel firstslack_webapi_rate_limited_error: Hit rate limit (auto-retries with backoff)Credentials stored in ~/.config/agent-messenger/slackbot-credentials.json (0600 permissions). See references/authentication.md for format and security details.
| Feature | agent-slack | agent-slackbot |
|---|---|---|
| Token type | User token (xoxc-) | Bot token (xoxb-) |
| Token source | Auto-extracted from desktop app | Manual from Slack App config |
| Message search | Yes | No (requires user token) |
| File operations | Yes | No |
| Snapshot | Yes | No |
| Edit/delete messages | Any message | Bot's own messages only |
| Workspace management | Multi-workspace | Multi-bot, multi-workspace |
| CI/CD friendly | Requires desktop app | Yes (just set token) |
agent-slackbot: command not foundagent-slackbot is NOT the npm package name. The npm package is agent-messenger.
If the package is installed globally, use agent-slackbot directly:
agent-slackbot message send general "Hello"
If the package is NOT installed, use bunx agent-messenger slackbot:
bunx agent-messenger slackbot message send general "Hello"
NEVER runbunx agent-slackbot — it will fail or install a wrong package since agent-slackbot is not the npm package name.
For other troubleshooting (token issues, scopes, permissions), see references/authentication.md.
Weekly Installs
33
Repository
GitHub Stars
21
First Seen
Feb 9, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykWarn
Installed on
opencode31
gemini-cli30
claude-code29
github-copilot28
codex28
kimi-cli28
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
53,800 周安装