展示 HN:Omnara – Claude 管理代理的开源替代品
Claude 管理代理和 OpenAI 的 Agents API 的自托管替代品。网站 · 快速入门 · 文档 · API · 更新日志 · Discord Omnara 是一个开源的管理代理平台。使用 API 在任何模型和任何机器上运行 AI 代理,内置工具、秘密、权限和流式传输。根据 Apache 2.0 自托管,或者使用 Omnara Cloud。快速入门 Omnara Cloud 在 app.omnara.com 登录。您的第一个项目包含一个模型提供者(omnara-openrouter)和一个管理沙箱池(default-pool),因此此配置可以按原样运行。将其保存为 agent.yaml: version: v1 instruction: | 您是工程助手。使用您的机器运行命令。模型: provider_config:omnara-openrouter 名称:anthropic/claude-fable-5.1 machine_sources: - machine_pool_name: default-pool 通过 CLI 启动它(Node.js 22 或更高版本)。如果您尚未登录,第一次命令会打开浏览器以进行登录。 npx omnara agents launch --file agent.yaml \ --name "机器助手" \ --message "报告此机器的操作系统和可用磁盘空间。" 在终端与代理聊天,使用 npx omnara agents chat <agent-id>,或者在仪表板中打开它以观察它的工具调用和回复。通过 TypeScript SDK 从代码启动它 在仪表板中创建一个 API 密钥并将其导出为 OMNARA_TOKEN,使用 npm install @omnara/sdk 安装 SDK,并使用 npx omnara config 打印的组织和项目 ID: import { readFile } from 'node:fs/promises' import { bearerToken, createOmnaraClient, openAgentEventStream, sdk } from '@omnara/sdk' const client = createOmnaraClient({ auth: bearerToken(process.env.OMNARA_TOKEN!) }) const path = { orgID: 'org_...', projectID: 'proj_...' } const config = await sdk.createAgentConfig({ client, path, body: { source: await readFile('agent.yaml', 'utf8'), source_format: 'yaml', }, }) const launched = await sdk.createAgent({ client, path, body: { config: config.data.id, message: "报告此机器的可用磁盘空间。" }, }) const agentID = launched.data.agent.id for await (const event of openAgentEventStream({ client, path: { ...path, agentID } })) { console.log(event) } 快速入门展示了使用 REST API 相同的流程。让您的编码代理进行设置,给它这个提示:帮助我通过访问 https://www.omnara.com/SKILL.md 设置 Omnara 自托管 需要使用 Docker 和 Compose。 git clone https://github.com/omnara-ai/omnara.git cd omnara docker compose -f compose.yaml --profile app up -d 打开 http://localhost:8000 并注册。本地开发在 docker compose logs api 中打印验证链接,因此不需要电子邮件提供商。要从源构建而不是使用发布的镜像,请运行 docker compose --profile app up -d --build 。新实例没有模型或机器。在控制台中,添加一个模型提供者和一个模型,将该计算机连接到机器下,并将两者与您的项目共享。一旦您的实例有了公共 URL,沙箱也能正常工作。将 CLI 指向您的实例并登录: npx omnara config --api-url http://localhost:8000/api/v1 --issuer-url http://localhost:8000 npx omnara login 在 agent.yaml 中,使用您的提供者和模型名称,并将 machine_pool_name 条目替换为 machine_name: <您的机器>。然后使用与上面相同的命令启动它。地方默认值故意不安全。对于实际部署,请遵循自托管指南和配置参考。工作原理 您的产品与 Omnara 通信,Omnara 使用配置中的模型、工具和机器运行每个代理。 flowchart TB subgraph yours["您的端" ] users(["您的用户" ]) --> app["您的应用<br/>REST API · TypeScript SDK" ] team["您的团队<br/>CLI · 仪表板<br/>Slack · Discord · GitHub" ] end subgraph omnara["Omnara" ] api["API<br/>launch · input<br/>event stream · approvals" ] <--> pg[("Postgres<br/>每个代理的事件日志" )] <--> worker["Workers<br/>运行代理循环" ] end subgraph plug[" " ] models["模型<br/>OpenAI · Anthropic<br/>OpenRouter · 自托管" ] tools["工具<br/>内置 · 技能<br/>MCP · 自定义" ] machines["机器<br/>沙箱或您自己的<br/>笔记本电脑、虚拟机、容器" ] end app --> api team --> api worker --> models worker --> tools worker --> machines classDef side fill:none,stroke:#8b949e,stroke-width:1px classDef core fill:#506FCF,stroke:#3D5BB5,stroke-width:1px,color:#ffffff classDef store fill:#3D5BB5,stroke:#2E4794,stroke-width:1px,color:#ffffff classDef plugin fill:none,stroke:#85A0E6,stroke-width:1.5px class users,app,team side class api,worker core class pg store class models,tools,machines plugin style yours fill:none,stroke:#8b949e,stroke-dasharray:4 3 style omnara fill:#506FCF14,stroke:#506FCF,stroke-width:1.5px style plug fill:none,stroke:#85A0E6,stroke-dasharray:4 3 linkStyle default stroke:#8b949e,stroke-width:1.5px 正在加载 API。您的应用、CLI 和仪表板都使用相同的 REST API 启动代理、发送消息并回答。
本站免费、广告极少。如果觉得有帮助,可以请我们喝杯咖啡 —— 任何金额都对持续运营有实际帮助。
☕请我喝杯咖啡