用于协同运维的对话式 Agent 控制平面。
OpsChronicle 是一个多 Agent 系统,通过在 Feishu/Slack 等即时通讯平台上的自然对话,帮助团队诊断和解决运维问题。
状态: MVP 开发中
# 克隆仓库
git clone https://github.com/yourusername/opschronicle.git
cd opschronicle
# 构建
go build -o opschronicle ./cmd/opschronicle
# 显示帮助
./opschronicle --help
# 初始化配置 (生成 ~/.opschronicle/config.yaml)
./opschronicle install
# 启动网关
./opschronicle gateway --config ~/.opschronicle/config.yaml
OpsChronicle 使用基于 Viper 的配置,支持环境变量覆盖:
# ~/.opschronicle/config.yaml
log:
level: info # debug | info | warn | error
format: text # text | json
gateway:
listen: ":8080"
环境变量覆盖配置的前缀为 OC_:
export OC_LOG_LEVEL=debug
export OC_GATEWAY_LISTEN=":9090"
go test ./...
opschronicle/ ├── cmd/opschronicle/ # CLI 入口 │ └── main.go ├── internal/ │ ├── cli/ # Cobra 命令 (root, install, gateway) │ ├── config/ # 基于 Viper 的配置 │ ├── bus/ # 多 Agent 上下文的会话总线 │ └── gateway/ # 网关服务器 (待完成) ├── api/ │ └── proto/ # gRPC protobuf 定义 │ └── channel.proto # 渠道插件接口 ├── docs/ # 设计文档和 PRD ├── .golangci.yml # Linter 配置 └── go.mod
┌─────────────┐ │ IM (飞书) │ └──────┬───────┘ │ gRPC (channel.proto) ┌──────▼───────────────┐ │ 网关 (Gateway) │ │ - 渠道管理器 │ │ - 会话路由 │ └──────┬───────────────┘ │ 会话总线 (Session Bus) ┌──────▼───────────────┐ │ Agent 运行时 │ │ - 编排者 (Orchestrator) │ - 分析者 (Analyst) │ - 执行者 (Executor) │ - 历史记录者 (Historian) └──────────────────────┘
会话总线 (Session Bus) 为单个故障处理会话中的多 Agent 协作提供共享上下文。Agent 通过内存中的事件总线发布/订阅类型化事件(消息、工具调用、诊断信息)。
MIT