内容
# kiro-discord-bot
[繁體中文 README](README.zh-TW.md) | [完整文档][docs]
**一个适用于项目绑定ACP代理的Discord机器人和控制面板。**
`kiro-discord-bot` 通过标准输入输出连接Discord频道和线程到ACP兼容的编码代理。Kiro CLI是默认引擎,而OMP可以作为可选替换,通过相同的Discord命令、MCP策略、审计、用法、定时任务、内存和线程代理控制启用。
每个初始化的频道都可以绑定到一个实际的项目目录,保持自己的代理会话,记住项目指导,并通过明确的频道策略公开模型上下文协议(MCP)工具。
本仓库的README故意简短。详细的用戶指南、管理指南、MCP设置、发布操作手册和故障排除文档都存放在[文档站点][docs]。
新的部署应该从Kiro CLI开始,除非已经准备好了OMP工作流。有关产品级权衡和运行时细节,请参见[代理引擎][agent-engines]。
Kiro CLI和OMP是外部代理CLI。本项目从Discord启动和控制它们,但它们的安装、身份验证、模型访问和CLI更新由它们自己的项目维护。
## 为什么它与众不同
- **项目绑定ACP代理**:每个Discord频道都映射到一个工作目录和一个代理会话。
- **引擎灵活性**:保持Kiro作为默认引擎,或为选定的频道和线程启用OMP,而无需更改Discord工作流。
- **可训练的上下文**:使用内存、闪存、导向文件、对话历史和项目知识,而不是每次都从零开始。
- **安全的工具扩展**:MCP服务器被发现为一个目录,然后通过策略和代理公开给每个频道。
- **操作控制**:管理员面板和敏感诊断使用Discord支持的私人回复。
- **自动化**:定时任务和提醒允许代理在频道所有权下运行计划的工作。
## 快速开始
1. 安装并验证至少一个ACP引擎:`kiro-cli`或`omp`。
2. 使用`bot`和`applications.commands`范围、消息内容意图和所需的频道/消息权限创建一个Discord机器人。
3. 下载最新的发布存档或从源代码构建。
4. 提供环境变量,如`DISCORD_TOKEN`、`DISCORD_GUILD_ID`、`DEFAULT_CWD`和`DATA_DIR`。
5. 在前台运行机器人一次,并确认它登录。
6. 在Discord中,在一个频道中运行`/cwd`以绑定它到一个项目。
7. 运行`/doctor`以验证权限和启用引擎的准备情况。
继续阅读[完整的安装指南][install-doc]。
## 常见文档
| 主题 | 从这里开始 |
| --- | --- |
| 首次设置 | [入门指南][getting-started] · [安装][install-doc] |
| 每日使用 | [命令参考][commands] · [监听模式][listen-modes] |
| 代理引擎 | [代理引擎][agent-engines] · [环境][environment] |
| 代理上下文 | [导向文件][steering] · [核心概念][core-concepts] |
| 工具访问 | [MCP策略][mcp] · [机器人工具][bot-tools] · [Discord MCP服务器][mcp-discord] |
| 操作 | [环境][environment] · [部署][deployment] · [发布操作手册][release] |
| 安全性和审查 | [安全模型][security] · [审计、用法和隐私][audit-usage] |
| 支持 | [故障排除][troubleshooting] · [macOS MCP网络][macos-networking] |
## 从源代码构建
```bash
VERSION=$(git describe --tags --always 2>/dev/null || echo "dev")
go build -ldflags "-X main.Version=$VERSION" -o kiro-discord-bot .
go build -o mcp-discord-server ./cmd/mcp-discord
go build -o mcp-media-server ./cmd/mcp-media
```
## 发布和运维
在标记或部署之前运行发布预检:
```bash
scripts/release-preflight.sh
```
遵循[发布操作手册][release]进行标记、发布、部署和回滚。
## License
MIT
[docs]: https://nczz.github.io/kiro-discord-bot/
[getting-started]: https://nczz.github.io/kiro-discord-bot/guide/getting-started.html
[install-doc]: https://nczz.github.io/kiro-discord-bot/guide/installation.html
[agent-engines]: https://nczz.github.io/kiro-discord-bot/guide/agent-engines.html
[commands]: https://nczz.github.io/kiro-discord-bot/guide/commands.html
[listen-modes]: https://nczz.github.io/kiro-discord-bot/guide/listen-modes.html
[core-concepts]: https://nczz.github.io/kiro-discord-bot/guide/core-concepts.html
[steering]: https://nczz.github.io/kiro-discord-bot/guide/steering.html
[mcp]: https://nczz.github.io/kiro-discord-bot/guide/mcp.html
[bot-tools]: https://nczz.github.io/kiro-discord-bot/guide/bot-tools.html
[mcp-discord]: https://nczz.github.io/kiro-discord-bot/guide/mcp-discord.html
[environment]: https://nczz.github.io/kiro-discord-bot/guide/environment.html
[deployment]: https://nczz.github.io/kiro-discord-bot/guide/deployment.html
[release]: https://nczz.github.io/kiro-discord-bot/guide/release.html
[security]: https://nczz.github.io/kiro-discord-bot/guide/security-model.html
[audit-usage]: https://nczz.github.io/kiro-discord-bot/guide/audit-usage-privacy.html
[troubleshooting]: https://nczz.github.io/kiro-discord-bot/guide/troubleshooting.html
[macos-networking]: https://nczz.github.io/kiro-discord-bot/guide/macos-mcp-networking.html