OpenHarness 是一个面向开源社区的 Agent Harness。它提供轻量、可扩展、可检查的 Agent 基础设施,包括:
ohmo personal-agent appoh setupohmo personal-agent appohmo 使用 ~/.ohmo 作为 home workspace,支持 gateway、bootstrap prompts 和交互式 channel 配置curl -fsSL https://raw.githubusercontent.com/HKUDS/OpenHarness/main/scripts/install.sh | bash
常用安装参数:
--from-source:从源码安装,适合贡献者--with-channels:一并安装 IM channel 依赖例如:
curl -fsSL https://raw.githubusercontent.com/HKUDS/OpenHarness/main/scripts/install.sh | bash -s -- --from-source --with-channels
git clone https://github.com/HKUDS/OpenHarness.git
cd OpenHarness
uv sync --extra dev
uv run oh
现在最推荐的入口是:
oh setup
oh setup 会按下面的顺序引导:
当前内置 workflow 包括:
Anthropic-Compatible APIClaude SubscriptionOpenAI-Compatible APICodex SubscriptionGitHub Copilot适合这类后端:
适合这类后端:
# 统一配置入口
oh setup
# 查看已有 workflow/profile
oh provider list
# 切换当前 workflow
oh provider use codex
# 查看认证状态
oh auth status
如果内置 preset 不够,可以直接新增 profile:
oh provider add my-endpoint \
--label "My Endpoint" \
--provider anthropic \
--api-format anthropic \
--auth-source anthropic_api_key \
--model my-model \
--base-url https://example.com/anthropic
这一版开始,兼容接口可以按 profile 绑定凭据。
也就是说,Kimi、GLM、MiniMax 这类 Anthropic-compatible 后端,不需要再共用一把全局 anthropic key。
运行:
oh
你会得到 React/Ink TUI,支持:
/ 命令选择器/model 模型切换/permissions 权限模式切换/resume 会话恢复/provider workflow 选择非交互模式也支持:
oh -p "Explain this repository"
oh -p "List all functions in main.py" --output-format json
oh -p "Fix the bug" --output-format stream-json
OpenHarness 现在把 provider 视为 workflow + profile,而不是只暴露底层协议名。
| Workflow | 说明 |
|---|---|
Anthropic-Compatible API | Anthropic 风格接口,适合 Claude/Kimi/GLM/MiniMax 等 |
Claude Subscription | 复用本地 ~/.claude/.credentials.json |
OpenAI-Compatible API | OpenAI 风格接口,适合 OpenAI/OpenRouter/各种兼容网关 |
Codex Subscription | 复用本地 ~/.codex/auth.json |
GitHub Copilot | GitHub Copilot OAuth workflow |
日常推荐用法:
oh setup oh provider list oh provider use <profile>
ohmo 是基于 OpenHarness 的 personal-agent app,不是 core 的一个 mode。
ohmo init
这会创建:
~/.ohmo/soul.md~/.ohmo/identity.md~/.ohmo/user.md~/.ohmo/BOOTSTRAP.md~/.ohmo/memory/~/.ohmo/gateway.json其中:
soul.md:长期人格与行为原则identity.md:ohmo 自己是谁user.md:用户画像、偏好、关系信息BOOTSTRAP.md:首轮 landing / onboarding ritualmemory/:personal memorygateway.json:gateway 的 profile 和 channel 配置ohmo config
ohmo config 会用和 oh setup 一致的 workflow 语言来配置 gateway,例如:
Anthropic-Compatible APIClaude SubscriptionOpenAI-Compatible APICodex SubscriptionGitHub Copilot目前 ohmo init / ohmo config 已支持引导式配置这些 channel:
如果 gateway 已经在运行,配置完成后也可以直接选择是否重启。
# 运行 personal agent
ohmo
# 前台运行 gateway
ohmo gateway run
# 查看 gateway 状态
ohmo gateway status
# 重启 gateway
ohmo gateway restart
anthropics/skillsCLAUDE.md 自动发现与注入MEMORY.md 持久记忆oh setup
oh provider list
oh provider use codex
oh auth status
oh -p "Explain this codebase"
oh
ohmo init ohmo config ohmo ohmo gateway run ohmo gateway status ohmo gateway restart
uv run pytest -q python scripts/test_harness_features.py python scripts/test_real_skills_plugins.py
欢迎贡献:
开发环境:
git clone https://github.com/HKUDS/OpenHarness.git
cd OpenHarness
uv sync --extra dev
uv run pytest -q
更多信息:
MIT,见 LICENSE。