Octomind 开源 Rust 编码智能体框架发布
Octomind – open-source AI harness that saves your tokens, static rust
Octomind 发布开源编码智能体框架,单个 Rust 二进制支持交互式、stdin、守护进程、WebSocket 和 ACP 五种运行方式,通过 MCP 工具读写文件、执行 shell 和调用子智能体。
开源编码智能体框架。单个 Rust 二进制文件,支持任意模型,覆盖所有界面。
交互式、stdin、守护进程、WebSocket 或 ACP——一个引擎,一份配置。
一个监督模型负责规划并检查工作。
策略存在于 TOML 护栏中,而非审批弹窗。
网站 · 文档 · Tap 注册表 · 基准测试 · 问题反馈
Octomind 是一个开源编码智能体框架。它通过 MCP 工具让 LLM 真正访问你的仓库——读写文件、运行 shell、搜索代码、委派给子智能体。同一框架可以交互式运行、通过 stdin 非交互式运行、作为后台守护进程运行、通过 WebSocket 运行,或作为编辑器内或其他智能体栈中的 ACP 智能体运行。
# Interactive octomind run developer:general # Piped — CI, scripts, automation echo "Explain the auth module" | octomind run developer:general --format plain # Daemon — keep it alive, talk to it from another terminal echo "watch the build" | octomind run --name watcher --daemon --format jsonl octomind send --name watcher "run the test suite"
为什么选择 Octomind?
大多数编码智能体假设有人盯着屏幕。Octomind 专为你离开后仍持续进行的工作而构建。
- 策略即代码,而非审批弹窗。确定性的 护栏——调用前守卫、结果后钩子、轮次后验证器——存在于 TOML 和脚本中,因此可在 CI、守护进程和定时运行中生效。
- 在真实 PR 上经过验证。它以低于最接近竞争对手的成本解决了 25 个留出任务中的 24 个。参见基准测试。
- 现成的专家。
octomind run developer:general从 tap 拉取打包好的智能体(提示词、模型、MCP 服务器、工具权限)。用一个仓库即可发布你自己的专家。 - 保持敏锐的会话。自适应压缩让长任务持续推进,同时保留任务知识和实时交互。
- 记住你的规则。你在会话中陈述的规则和纠正会成为经验教训,以你自己的话语为依据,限定于项目和角色,并在后续会话中重现。参见学习。
- 任意模型,任意预算。使用 Octomind Cloud 或你自己的密钥(OpenRouter、Anthropic、OpenAI、DeepSeek、Ollama 等),为每个角色选择模型,并限制每次请求和每个会话的支出。超出预算时,终端会话会询问 y/N;非交互式运行则以退出码 75 停止。
- 一份配置。模型、工具、角色、护栏、预算:全部为 TOML,无需框架代码。
快速开始
1. 安装(macOS、Linux):
curl -fsSL https://raw.githubusercontent.com/muvon/octomind/master/install.sh | bash在 Windows 上,使用 PowerShell:
irm https://raw.githubusercontent.com/muvon/octomind/master/install.ps1 | iex
在 macOS 上,你也可以使用 Homebrew 安装:
brew install muvon/tap/octomind
2. 获取模型访问权限。最快的途径是 Octomind Cloud,它包含模型且无需配置:
octomind login
更想用自己的提供商密钥?跳过登录并导出一个(也支持 OPENAI_API_KEY、ANTHROPIC_API_KEY、DEEPSEEK_API_KEY),然后按照模型访问将配置指向它:
export OPENROUTER_API_KEY="your_key"
3. 在你的项目中运行一个专家:
cd ~/your/project octomind run developer:general
你现在进入了一个会话,其中的智能体可以读取你的代码、运行命令并编辑文件。界面是带 markdown 渲染的普通行提示符——无需学习 TUI,因此可通过 SSH、在 tmux 中以及在 CI 日志中工作。首次运行专家时,它可能会安装其工具并要求提供凭据。
developer:general来自默认 tapmuvon/tap,而非你的本地配置。普通的octomind run会启动配置的默认角色assistant:concierge。
试试录制的缺陷修复演示:两个失败的测试、一次智能体修复,以及一次独立的测试重跑。
基准测试
在 octobench 上测量,针对从已合并的拉取请求中收集的 25 个任务,涵盖 Python、PHP、Rust、C++ 和 JavaScript。每个 agent 都在修复前的仓库中工作;来自已合并修复的留出测试决定通过或失败。这些是 2026 年 7 月 30 日发布的结果,不是对本次检出的测量。
| 已解决 | judge Σ / 2500 | 成本 | 实际耗时 | |
|---|---|---|---|---|
| octomind + glm-5.2 | 24/25 | 2264 | $63.43 | 3.6h |
| claude code + claude-opus-5 | 23/25 | 2262 | $81.79 | 6.7h |
| codex + gpt-5.6-sol | 21/25 | 2127 | $14.86 | 1.0h |
| opencode + glm-5.2 | 19/25 | 2093 | $129.54 | 3.3h |
- harness 很重要。opencode 使用了相同的模型和端点;octomind 以大约一半的成本解决了 24 个对 19 个。所有四个 agent 都运行了原版调用,没有调优,因此这测量的是整个 harness,而不是单个功能。
- 最坏情况定价,仍然领先。glm-5.2 在没有提示缓存的情况下运行,而 Opus 按缓存费率计费约 97% 的上下文重读——而 octomind 在解决数、成本和实际耗时上仍然领先。
- 可复现。逐案例表、工件和复现指南:BENCHMARK.md。背景:博客文章。
护栏:策略即代码
在你的仓库中放入一个 .agents/guardrails.toml。Octomind 确定性地执行它,无需编译代码,也无需安装插件。
# Pre-call deny — block a class of calls before they execute [[guard]] match = "shell(command=^rm\\s+-rf?)" message = "rm -rf blocked." # Conditional rule — only fires after the agent ran git status this session [[guard]] match = "shell(command=git push)" when = ["+shell(command=git status)"] message = "Review changes before pushing."
| 层 | 运行时机 | 作用 |
|---|---|---|
| Guards | 在工具调用之前 | 按能力、参数正则和会话历史拒绝。匹配时返回拒绝而不是执行调用。 |
| Hooks | 在工具结果之后 | 非零退出会将 stdout 注入 agent 的收件箱——lint 和格式失败变成自动修正,无需重启回合。 |
| Validators | 在一个回合之后 | agent 在下一回合读取的脚本。这在自主循环中取代了“批准此更改?”提示。 |
如果你了解 Claude Code hooks:guards 是在 TOML 中声明的 PreToolUse 拒绝,hooks 是 PostToolUse,validators 是 Stop——常见情况无需脚本。
Hook 和 validator 脚本示例:护栏指南。
一个 Harness,五个界面
同一个 harness,暴露在你的工作流需要的地方。
| 界面 | 用于 | 文档 |
|---|---|---|
| 交互式 CLI | 日常工作,任何领域 | 会话 |
非交互式(--format plain / jsonl) |
CI、脚本、定时任务 | CLI 参考 |
守护进程 + send |
后台 agent、持续监控 | 守护进程与 hooks |
WebSocket(octomind server) |
IDE 插件、仪表板、集成 | WebSocket 服务器 |
ACP(octomind acp) |
Zed、JetBrains、VS Code、Neovim 或任何 ACP 编辑器中的 agent | ACP 协议 |
需要机器可读的结果?传递 --schema schema.json 以将最终响应约束为 JSON Schema(需要支持结构化输出的模型)。参见 结构化输出。
功能
| 功能 | 你将获得 | 了解更多 |
|---|---|---|
| 专家与 taps | 打包的 agent,包含模型、提示、MCP 服务器和权限;首次使用时安装其工具依赖 | Tap 系统 |
| 角色 | 按角色的模型、温度、系统提示、工具 | 角色 |
| 工作流 | 多步骤流水线,每个步骤有自己的模型和工具集 | 工作流 |
| MCP 客户端 | stdio 和 Streamable HTTP 服务器,支持 OAuth;在会话中启用/禁用服务器 | MCP 工具 |
| Agent Skills | 来自 .agents/skills/、~/.config/agents/skills/ 和 taps 的标准 SKILL.md 技能;它们按需激活,因此你的上下文保持精简 |
技能 |
| 本地项目工具 | .agents/tools/ 中的可执行脚本自动注册为工具 |
本地工具 |
插件与 AGENTS.md |
来自 taps、.agents/plugins/ 或 ~/.config/agents/plugins/ 的 Agent Plugins(plugin.json + skills + mcp.json);项目 AGENTS.md 在会话开始时加载 |
配置 |
| Supervisor 与学习 | 第二个模型负责规划、把关完成情况并压缩工具输出;经验教训按项目和角色以文件形式持久保存 | Supervisor、Learning |
| 沙箱 | --sandbox 通过 Landlock(Linux)或 Seatbelt(macOS)将写入锁定在工作目录,每个 shell、MCP server 和子 agent 都会继承该限制 |
配置参考 |
| Token 效率 | 缓存感知的成本核算与自适应压缩 | Token 效率 |
专家
octomind run developer:general # general dev, language skills auto-activate octomind run doctor:blood # blood-test interpretation specialist octomind run lawyer:sg # legal specialist
运行专家时会从 tap registry 获取其 manifest、安装所需二进制文件、解析凭据、启动相应的 MCP server,然后打开会话。
构建并注册你自己的专家:
octomind tap init yourteam/my-tap # scaffold, validate, git-init, and register locally octomind tap yourteam/my-tap # on another machine, after publishing to GitHub
octomind- 前缀会自动添加:yourteam/my-tap 映射到仓库
yourteam/octomind-my-tap。
安装
| 方式 | 命令 |
|---|---|
| 安装脚本(推荐) | curl -fsSL https://raw.githubusercontent.com/muvon/octomind/master/install.sh | bash |
| 安装脚本(Windows PowerShell) | irm https://raw.githubusercontent.com/muvon/octomind/master/install.ps1 | iex |
| Homebrew(macOS) | brew install muvon/tap/octomind |
| Scoop(Windows) | scoop bucket add muvon https://github.com/Muvon/scoop-bucket 然后 scoop install muvon/octomind |
| Cargo(Rust 1.95+) | cargo install octomind |
| Docker | docker run --rm ghcr.io/muvon/octomind --help |
| 从源码构建 | git clone https://github.com/muvon/octomind.git && cd octomind && cargo build --release |
安装脚本会检测你的操作系统和架构(Linux 和 macOS 上的 x86_64/aarch64),并安装到 ~/.local/bin/。传入 --install-dir <DIR> 或设置 OCTOMIND_INSTALL_DIR 可覆盖。在 Windows(x86_64/aarch64)上,install.ps1 会安装到 %LOCALAPPDATA%\octomind\bin 并将其添加到用户 PATH;它也支持 OCTOMIND_INSTALL_DIR 和 OCTOMIND_VERSION。install.sh 仍可在 Git Bash 或 MSYS2 中使用。
提示找不到命令? 将安装目录添加到你的 PATH:
export PATH="$HOME/.local/bin:$PATH"
从源码构建需要 protoc;各操作系统的前置条件见 从源码构建。
验证:
octomind --version octomind config # generate the default config octomind run # start your first session
Shell 补全:octomind completion <bash|zsh|fish|elvish|powershell>。
模型访问
Octomind Cloud — octomind login(设备码登录,类似 gh auth login)会在本地存储网关密钥。默认配置已使用 octohub:auto。了解更多。
使用你自己的密钥 — 设置提供方的环境变量(OPENROUTER_API_KEY、OPENAI_API_KEY、ANTHROPIC_API_KEY、DEEPSEEK_API_KEY、……)并将模型表指向它。supervisor 和压缩配置也默认使用 octohub:auto,因此请同时更新这三处:
[model] name = "anthropic:claude-sonnet-5-5" [supervisor.model] name = "anthropic:claude-haiku-5-5" [compression.model] name = "anthropic:claude-haiku-5-5"
提供方详情与按角色覆盖:提供方与模型。
配置
配置文件位于 macOS 和 Linux 上的 ~/.local/share/octomind/config/config.toml,以及 Windows 上的 %LOCALAPPDATA%/octomind/config/ 下。设置 OCTOMIND_DATA_DIR 可覆盖数据根目录。
octomind config --show # view current config octomind config --validate # validate config
使用 -c 为单次运行覆盖任意值:
octomind run -c supervisor.enabled=false
会话命令
| 命令 | 说明 |
|---|---|
/help |
显示所有命令 |
/info |
Token 用量与成本 |
/model anthropic:claude-sonnet-5-5 |
在会话中切换模型 |
/role developer:general |
切换到已配置的角色或 tap 标签 |
/new Review auth |
开始新会话(标题可选) |
/done |
强制进行上下文压缩,并在启用时开始后台学习提取 |
/exit |
退出会话 |
完整列表:会话命令。
遥测
Octomind 会上报匿名使用情况:使用了哪些命令、工具和模型,以及耗时、token 数量和错误类型。它绝不会发送你的代码、提示词、文件路径、工具参数或环境变量值。可通过以下三种方式中的任意一种退出:
export DO_NOT_TRACK=1 # the cross-tool standard, honored first export OCTOMIND_TELEMETRY=0 # for subsequent commands in this shell # or set `telemetry = false` in config.toml
精确字段列表:遥测。
文档
| 从这里开始 | 深入了解 | 集成 | 参考 |
|---|---|---|---|
| 安装 | 角色 | WebSocket server | CLI |
| 快速开始 | 工作流 | ACP 协议 | 配置 |
| 配置 | 压缩 | 守护进程与钩子 | 会话命令 |
| 提供方与模型 | 护栏 | 编辑器集成 | 环境变量 |
完整索引:doc/README.md · 托管版本:octomind.run/docs。
贡献
最有影响力的贡献不是代码——而是专家智能体。一位心脏病专家发布 doctor:medications。一位税务律师发布 lawyer:us。一位安全研究员发布 security:owasp。一个 TOML 文件,就能让所有面临该问题的人获得专家级 AI。
也欢迎代码贡献。推送前请设置好钩子并运行门禁:
pip install pre-commit && pre-commit install make dev # fmt + clippy + test
提交遵循 Conventional Commits。完整指南、架构概览和代码约定:CONTRIBUTING.md · 内部实现:Architecture。
许可证
Apache License 2.0——见 LICENSE。
来源:Hacker News · github.com
