docs: make Chinese README the default
CI / Check / ubuntu-latest (push) Has been cancelled
CI / Check / macos-latest (push) Has been cancelled
CI / Check / windows-latest (push) Has been cancelled
CI / Test / macos-latest (push) Has been cancelled
CI / Test / ubuntu-latest (push) Has been cancelled
CI / Test / windows-latest (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Security Audit (push) Has been cancelled
CI / Secrets Scan (push) Has been cancelled
CI / Install Script Smoke Test (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 10:40:42 +00:00
parent a7b00a980e
commit cedbb64f7e
+150 -146
View File
@@ -1,18 +1,24 @@
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/RightNow-AI/openfang) · [上游 README](https://github.com/RightNow-AI/openfang/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
<p align="center">
<img src="public/assets/openfang-logo.png" width="160" alt="OpenFang Logo" />
</p>
<h1 align="center">OpenFang</h1>
<h3 align="center">The Agent Operating System</h3>
<h3 align="center">智能体操作系统(Agent Operating System</h3>
<p align="center">
Open-source Agent OS built in Rust. 137K LOC. 14 crates. 1,767+ tests. Zero clippy warnings.<br/>
<strong>One binary. Battle-tested. Agents that actually work for you.</strong>
基于 Rust 构建的开源智能体操作系统(Agent OS)。137K 行代码。14 crate1,767+ 项测试。零 clippy 警告。<br/>
<strong>单一二进制文件。久经实战检验。真正为你工作的智能体。</strong>
</p>
<p align="center">
<a href="https://openfang.sh/docs">Documentation</a> &bull;
<a href="https://openfang.sh/docs/getting-started">Quick Start</a> &bull;
<a href="https://openfang.sh/docs">文档</a> &bull;
<a href="https://openfang.sh/docs/getting-started">快速入门</a> &bull;
<a href="https://x.com/openfangg">Twitter / X</a>
</p>
@@ -27,19 +33,19 @@
---
> **v0.5.10 (April 2026)**
> **v0.5.102026 年 4 月)**
>
> OpenFang is feature complete but still pre-1.0. Expect rough edges and breaking changes between minor versions. We ship fast and fix fast. Pin to a specific commit for production use until v1.0. [Report issues here.](https://github.com/RightNow-AI/openfang/issues)
> OpenFang 功能已完备,但仍处于 1.0 之前阶段。小版本之间可能出现粗糙之处和破坏性变更。我们快速发布、快速修复。在 v1.0 之前,生产环境请固定到特定 commit。[在此报告问题。](https://github.com/RightNow-AI/openfang/issues)
---
## What is OpenFang?
## OpenFang 是什么?
OpenFang is an **open-source Agent Operating System**. Not a chatbot framework. Not a Python wrapper around an LLM. Not a "multi-agent orchestrator." A full operating system for autonomous agents, built from scratch in Rust.
OpenFang 是一款**开源智能体操作系统(Agent Operating System)**。它不是聊天机器人框架,不是围绕 LLM 的 Python 封装,也不是「多智能体编排器(multi-agent orchestrator)」。它是从零用 Rust 构建的、面向自主智能体的完整操作系统。
Traditional agent frameworks wait for you to type something. OpenFang runs **autonomous agents that work for you**: on schedules, 24/7, building knowledge graphs, monitoring targets, generating leads, managing your social media, and reporting results to your dashboard.
传统智能体框架等你输入指令。OpenFang 运行**为你工作的自主智能体**:按计划定时执行、7×24 小时运转,构建知识图谱、监控目标、生成销售线索、管理你的社交媒体,并将结果汇报到你的仪表盘。
The entire system compiles to a **single ~32MB binary**. One install, one command, your agents are live.
整个系统编译为**单一约 32MB 的二进制文件**。一次安装、一条命令,你的智能体即可上线。
```bash
curl -fsSL https://openfang.sh/install | sh
@@ -61,31 +67,31 @@ openfang start
---
## Hands: Agents That Actually Do Things
## Hands:真正做事的智能体
<p align="center"><em>"Traditional agents wait for you to type. Hands work <strong>for</strong> you."</em></p>
<p align="center"><em>「传统智能体等你输入。Hands <strong></strong>你工作。」</em></p>
**Hands** are OpenFang's core innovation. Pre-built autonomous capability packages that run independently, on schedules, without you having to prompt them. This is not a chatbot. This is an agent that wakes up at 6 AM, researches your competitors, builds a knowledge graph, scores the findings, and delivers a report to your Telegram before you've had coffee.
**Hands** OpenFang 的核心创新。预构建的自主能力包,可独立运行、按计划调度,无需你反复提示。这不是聊天机器人。这是一个会在早上 6 点醒来、研究你的竞争对手、构建知识图谱、对发现进行评分,并在你喝咖啡之前把报告发到 Telegram 的智能体。
Each Hand bundles:
- **HAND.toml**: manifest declaring tools, settings, requirements, and dashboard metrics.
- **System Prompt**: multi-phase operational playbook. Not a one-liner. These are 500+ word expert procedures.
- **SKILL.md**: domain expertise reference injected into context at runtime.
- **Guardrails**: approval gates for sensitive actions (e.g. Browser Hand requires approval before any purchase).
每个 Hand 包含:
- **HAND.toml**:清单文件,声明工具、设置、依赖项和仪表盘指标。
- **System Prompt**:多阶段操作手册。不是一句话提示。这些是 500+ 词的专家级流程。
- **SKILL.md**:领域专业知识参考,在运行时注入上下文。
- **Guardrails**:敏感操作的审批关卡(例如 Browser Hand 在任何购买前都需要审批)。
All compiled into the binary. No downloading, no pip install, no Docker pull.
全部编译进二进制文件。无需下载、无需 pip install、无需 Docker pull
### The 7 Bundled Hands
### 内置的 7 个 Hands
| Hand | What It Actually Does |
| Hand | 实际功能 |
|------|----------------------|
| **Clip** | Takes a YouTube URL, downloads it, identifies the best moments, cuts them into vertical shorts with captions and thumbnails, optionally adds AI voice-over, and publishes to Telegram and WhatsApp. 8-phase pipeline. FFmpeg + yt-dlp + 5 STT backends. |
| **Lead** | Runs daily. Discovers prospects matching your ICP, enriches them with web research, scores 0-100, deduplicates against your existing database, and delivers qualified leads in CSV/JSON/Markdown. Builds ICP profiles over time. |
| **Collector** | OSINT grade intelligence. You give it a target (company, person, topic). It monitors continuously: change detection, sentiment tracking, knowledge graph construction, and critical alerts when something important shifts. |
| **Predictor** | Superforecasting engine. Collects signals from multiple sources, builds calibrated reasoning chains, makes predictions with confidence intervals, and tracks its own accuracy using Brier scores. Has a contrarian mode that deliberately argues against consensus. |
| **Researcher** | Deep autonomous researcher. Cross-references multiple sources, evaluates credibility using CRAAP criteria (Currency, Relevance, Authority, Accuracy, Purpose), generates cited reports with APA formatting, supports multiple languages. |
| **Twitter** | Autonomous Twitter/X account manager. Creates content in 7 rotating formats, schedules posts for optimal engagement, responds to mentions, tracks performance metrics. Has an approval queue, so nothing posts without your OK. |
| **Browser** | Web automation agent. Navigates sites, fills forms, clicks buttons, handles multi-step workflows. Uses Playwright bridge with session persistence. **Mandatory purchase approval gate**: it will never spend your money without explicit confirmation. |
| **Clip** | 接收 YouTube URL,下载视频,识别最佳片段,裁剪为带字幕和缩略图的竖屏短视频,可选添加 AI 配音,并发布到 Telegram WhatsApp。8 阶段流水线。FFmpeg + yt-dlp + 5 STT 后端。 |
| **Lead** | 每日运行。发现符合你 ICP 的潜在客户,通过网络调研丰富信息,按 0-100 评分,与现有数据库去重,并以 CSV/JSON/Markdown 交付合格线索。随时间构建 ICP 画像。 |
| **Collector** | OSINT 级情报能力。你指定目标(公司、人物、主题)。它持续监控:变更检测、情绪追踪、知识图谱构建,并在重要变化发生时发出关键告警。 |
| **Predictor** | 超级预测(Superforecasting)引擎。从多个来源收集信号,构建校准后的推理链,给出带置信区间的预测,并用 Brier 分数追踪自身准确度。具备刻意反驳共识的逆向(contrarian)模式。 |
| **Researcher** | 深度自主研究员。交叉引用多个来源,使用 CRAAP 标准(CurrencyRelevanceAuthorityAccuracyPurpose)评估可信度,生成带 APA 格式引用的报告,支持多种语言。 |
| **Twitter** | 自主 Twitter/X 账号管理器。以 7 种轮换格式创作内容,为最佳互动效果安排发帖,回复提及,追踪表现指标。设有审批队列,未经你确认不会发布。 |
| **Browser** | 网页自动化智能体。浏览网站、填写表单、点击按钮、处理多步骤工作流。通过 Playwright 桥接并保持会话持久化。**强制购买审批关卡**:未经你明确确认,绝不会替你花钱。 |
```bash
# Activate the Researcher Hand. It starts working immediately.
@@ -104,21 +110,21 @@ openfang hand pause lead
openfang hand list
```
**Build your own.** Define a `HAND.toml` with tools, settings, and a system prompt. Publish to FangHub.
**自行构建。** 定义一个 `HAND.toml`,配置工具、设置和 system prompt,发布到 FangHub
---
## OpenFang vs The Landscape
## OpenFang 与业界对比
<p align="center">
<img src="public/assets/openfang-vs-claws.png" width="600" alt="OpenFang vs OpenClaw vs ZeroClaw" />
</p>
### Benchmarks: Measured, Not Marketed
### 基准测试:实测,而非营销
All data from official documentation and public repositories, February 2026.
所有数据来自官方文档与公开仓库,截至 2026 年 2 月。
#### Cold Start Time (lower is better)
#### 冷启动时间(越低越好)
```
ZeroClaw ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10 ms
@@ -129,7 +135,7 @@ AutoGen ███████████████████████
OpenClaw █████████████████████████████████████████░░ 5.98 sec
```
#### Idle Memory Usage (lower is better)
#### 空闲内存占用(越低越好)
```
ZeroClaw █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5 MB
@@ -140,7 +146,7 @@ AutoGen ███████████████████████
OpenClaw ████████████████████████████████████████░░░░ 394 MB
```
#### Install Size (lower is better)
#### 安装体积(越低越好)
```
ZeroClaw █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8.8 MB
@@ -151,7 +157,7 @@ AutoGen ████████████████░░░░░░░
OpenClaw ████████████████████████████████████████░░░░ 500 MB
```
#### Security Systems (higher is better)
#### 安全体系(越高越好)
```
OpenFang ████████████████████████████████████████████ 16 ★
@@ -162,7 +168,7 @@ LangGraph █████░░░░░░░░░░░░░░░░░░
CrewAI ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1
```
#### Channel Adapters (higher is better)
#### 渠道适配器(越高越好)
```
OpenFang ████████████████████████████████████████████ 40 ★
@@ -173,7 +179,7 @@ AutoGen ░░░░░░░░░░░░░░░░░░░░░░░
LangGraph ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0
```
#### LLM Providers (higher is better)
#### LLM 提供商(数值越高越好)
```
ZeroClaw ████████████████████████████████████████████ 28
@@ -184,53 +190,53 @@ OpenClaw ██████████████░░░░░░░░░
AutoGen ███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8
```
### Feature-by-Feature Comparison
### 逐项功能对比
| Feature | OpenFang | OpenClaw | ZeroClaw | CrewAI | AutoGen | LangGraph |
| 功能 | OpenFang | OpenClaw | ZeroClaw | CrewAI | AutoGen | LangGraph |
|---------|----------|----------|----------|--------|---------|-----------|
| **Language** | **Rust** | TypeScript | **Rust** | Python | Python | Python |
| **Autonomous Hands** | **7 built-in** | None | None | None | None | None |
| **Security Layers** | **16 discrete** | 3 basic | 6 layers | 1 basic | Docker | AES enc. |
| **Agent Sandbox** | **WASM dual-metered** | None | Allowlists | None | Docker | None |
| **Channel Adapters** | **40** | 13 | 15 | 0 | 0 | 0 |
| **Built-in Tools** | **53 + MCP + A2A** | 50+ | 12 | Plugins | MCP | LC tools |
| **Memory** | **SQLite + vector** | File-based | SQLite FTS5 | 4-layer | External | Checkpoints |
| **Desktop App** | **Tauri 2.0** | None | None | None | Studio | None |
| **Audit Trail** | **Merkle hash-chain** | Logs | Logs | Tracing | Logs | Checkpoints |
| **Cold Start** | **<200ms** | ~6s | ~10ms | ~3s | ~4s | ~2.5s |
| **Install Size** | **~32 MB** | ~500 MB | ~8.8 MB | ~100 MB | ~200 MB | ~150 MB |
| **License** | MIT | MIT | MIT | MIT | Apache 2.0 | MIT |
| **编程语言** | **Rust** | TypeScript | **Rust** | Python | Python | Python |
| **自主操作能力(Autonomous Hands** | **7 个内置** | 无 | 无 | 无 | 无 | 无 |
| **安全层** | **16 个独立层** | 3 个基础层 | 6 层 | 1 个基础层 | Docker | AES 加密 |
| **智能体沙箱** | **WASM 双计量** | 无 | 白名单 | 无 | Docker | |
| **通道适配器** | **40** | 13 | 15 | 0 | 0 | 0 |
| **内置工具** | **53 + MCP + A2A** | 50+ | 12 | 插件 | MCP | LC tools |
| **记忆/存储** | **SQLite + 向量** | 基于文件 | SQLite FTS5 | 4 层 | 外部 | 检查点 |
| **桌面应用** | **Tauri 2.0** | 无 | 无 | 无 | Studio | |
| **审计追踪** | **Merkle 哈希链** | 日志 | 日志 | 追踪 | 日志 | 检查点 |
| **冷启动** | **<200ms** | ~6s | ~10ms | ~3s | ~4s | ~2.5s |
| **安装体积** | **~32 MB** | ~500 MB | ~8.8 MB | ~100 MB | ~200 MB | ~150 MB |
| **许可证** | MIT | MIT | MIT | MIT | Apache 2.0 | MIT |
---
## 16 Security Systems: Defense in Depth
## 16 套安全系统:纵深防御(Defense in Depth
OpenFang doesn't bolt security on after the fact. Every layer is independently testable and operates without a single point of failure.
OpenFang 不会事后才仓促补上安全机制。每一层都可独立测试,且运行时无单点故障。
| # | System | What It Does |
| # | 系统 | 功能说明 |
|---|--------|-------------|
| 1 | **WASM Dual-Metered Sandbox** | Tool code runs in WebAssembly with fuel metering + epoch interruption. A watchdog thread kills runaway code. |
| 2 | **Merkle Hash-Chain Audit Trail** | Every action is cryptographically linked to the previous one. Tamper with one entry and the entire chain breaks. |
| 3 | **Information Flow Taint Tracking** | Labels propagate through execution. Secrets are tracked from source to sink. |
| 4 | **Ed25519 Signed Agent Manifests** | Every agent identity and capability set is cryptographically signed. |
| 5 | **SSRF Protection** | Blocks private IPs, cloud metadata endpoints, and DNS rebinding attacks. |
| 6 | **Secret Zeroization** | `Zeroizing<String>` auto-wipes API keys from memory the instant they're no longer needed. |
| 7 | **OFP Mutual Authentication** | HMAC-SHA256 nonce-based, constant-time verification for P2P networking. |
| 8 | **Capability Gates** | Role based access control. Agents declare required tools, the kernel enforces it. |
| 9 | **Security Headers** | CSP, X-Frame-Options, HSTS, X-Content-Type-Options on every response. |
| 10 | **Health Endpoint Redaction** | Public health check returns minimal info. Full diagnostics require authentication. |
| 11 | **Subprocess Sandbox** | `env_clear()` + selective variable passthrough. Process tree isolation with cross-platform kill. |
| 12 | **Prompt Injection Scanner** | Detects override attempts, data exfiltration patterns, and shell reference injection in skills. |
| 13 | **Loop Guard** | SHA256-based tool call loop detection with circuit breaker. Handles ping-pong patterns. |
| 14 | **Session Repair** | 7-phase message history validation and automatic recovery from corruption. |
| 15 | **Path Traversal Prevention** | Canonicalization with symlink escape prevention. ``../`` doesn't work here. |
| 16 | **GCRA Rate Limiter** | Cost-aware token bucket rate limiting with per-IP tracking and stale cleanup. |
| 1 | **WASM 双计量沙箱** | 工具代码在 WebAssembly 中运行,采用 fuel 计量 + epoch 中断。看门狗线程会终止失控代码。 |
| 2 | **Merkle 哈希链审计追踪** | 每个操作在密码学上与前一操作链接。篡改任意一条记录都会破坏整条链。 |
| 3 | **信息流污点追踪(Information Flow Taint Tracking** | 标签在执行过程中传播。密钥从源到汇全程被追踪。 |
| 4 | **Ed25519 签名的智能体清单** | 每个智能体身份与能力集均经过密码学签名。 |
| 5 | **SSRF 防护** | 阻止访问私有 IP、云元数据端点及 DNS 重绑定攻击。 |
| 6 | **密钥零化(Secret Zeroization** | `Zeroizing<String>` 在 API 密钥不再需要时立即从内存中自动擦除。 |
| 7 | **OFP 双向认证** | 基于 HMAC-SHA256 随机数、恒定时间校验的 P2P 网络认证。 |
| 8 | **能力门控(Capability Gates** | 基于角色的访问控制。智能体声明所需工具,内核负责强制执行。 |
| 9 | **安全响应头** | 每个响应均设置 CSPX-Frame-OptionsHSTSX-Content-Type-Options |
| 10 | **健康检查端点信息脱敏** | 公开健康检查仅返回最少信息。完整诊断需认证。 |
| 11 | **子进程沙箱** | `env_clear()` + 选择性变量透传。进程树隔离,支持跨平台终止。 |
| 12 | **提示词注入扫描器** | 检测覆盖尝试、数据外泄模式及技能中的 shell 引用注入。 |
| 13 | **循环守卫(Loop Guard** | 基于 SHA256 的工具调用循环检测,带熔断器,可处理乒乓模式。 |
| 14 | **会话修复** | 7 阶段消息历史校验,并可从损坏状态自动恢复。 |
| 15 | **路径遍历防护** | 规范化处理并防止符号链接逃逸。``../`` 在此处无效。 |
| 16 | **GCRA 速率限制器** | 成本感知的令牌桶速率限制,按 IP 追踪并清理过期条目。 |
---
## Architecture
## 架构
14 Rust crates. 137,728 lines of code. Modular kernel design.
14 Rust crate137,728 行代码。模块化内核设计。
```
openfang-kernel Orchestration, workflows, metering, RBAC, scheduler, budget tracking
@@ -251,40 +257,40 @@ xtask Build automation
---
## 40 Channel Adapters
## 40 个通道适配器
Connect your agents to every platform your users are on.
将你的智能体连接到用户所在的各个平台。
**Core:** Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Email (IMAP/SMTP)
**Enterprise:** Microsoft Teams, Mattermost, Google Chat, Webex, Feishu/Lark, Zulip
**Social:** LINE, Viber, Facebook Messenger, Mastodon, Bluesky, Reddit, LinkedIn, Twitch
**Community:** IRC, XMPP, Guilded, Revolt, Keybase, Discourse, Gitter
**Privacy:** Threema, Nostr, Mumble, Nextcloud Talk, Rocket.Chat, Ntfy, Gotify
**Workplace:** Pumble, Flock, Twist, DingTalk, Zalo, Webhooks
**核心:** TelegramDiscordSlackWhatsAppSignalMatrixEmailIMAP/SMTP
**企业:** Microsoft TeamsMattermostGoogle ChatWebex、飞书/LarkZulip
**社交:** LINEViberFacebook MessengerMastodonBlueskyRedditLinkedInTwitch
**社区:** IRCXMPPGuildedRevoltKeybaseDiscourseGitter
**隐私:** ThreemaNostrMumbleNextcloud TalkRocket.ChatNtfyGotify
**办公:** PumbleFlockTwist、钉钉、ZaloWebhooks
Each adapter supports per-channel model overrides, DM/group policies, rate limiting, and output formatting.
每个适配器均支持按通道覆盖模型、私信/群组策略、速率限制和输出格式化。
---
## WhatsApp Web Gateway (QR Code)
## WhatsApp Web 网关(二维码)
Connect your personal WhatsApp account to OpenFang via QR code, just like WhatsApp Web. No Meta Business account required.
通过二维码将个人 WhatsApp 账号连接到 OpenFang,用法与 WhatsApp Web 相同。无需 Meta Business 账号。
### Prerequisites
### 前置条件
- **Node.js >= 18** installed ([download](https://nodejs.org/))
- OpenFang installed and initialized
- 已安装 **Node.js >= 18**[download](https://nodejs.org/))
- 已安装并完成 OpenFang 初始化
### Setup
### 设置
**1. Install the gateway dependencies:**
**1. 安装网关依赖:**
```bash
cd packages/whatsapp-gateway
npm install
```
**2. Configure `config.toml`:**
**2. 配置 `config.toml`**
```toml
[channels.whatsapp]
@@ -292,9 +298,9 @@ mode = "web"
default_agent = "assistant"
```
**3. Set the gateway URL (choose one):**
**3. 设置网关 URL(任选其一):**
Add to your shell profile for persistence:
添加到 shell 配置文件以持久化:
```bash
# macOS / Linux
@@ -302,74 +308,72 @@ echo 'export WHATSAPP_WEB_GATEWAY_URL="http://127.0.0.1:3009"' >> ~/.zshrc
source ~/.zshrc
```
Or set it inline when starting the gateway:
或在启动网关时内联设置:
```bash
export WHATSAPP_WEB_GATEWAY_URL="http://127.0.0.1:3009"
```
**4. Start the gateway:**
**4. 启动网关:**
```bash
node packages/whatsapp-gateway/index.js
```
The gateway listens on port `3009` by default. Override with `WHATSAPP_GATEWAY_PORT`.
网关默认监听端口 `3009`。可通过 `WHATSAPP_GATEWAY_PORT` 覆盖。
**5. Start OpenFang:**
**5. 启动 OpenFang**
```bash
openfang start
# Dashboard at http://localhost:4200
```
**6. Scan the QR code:**
**6. 扫描二维码:**
Open the dashboard → **Channels** → **WhatsApp**. A QR code will appear. Scan it with your phone:
打开控制台 → **Channels** → **WhatsApp**。将出现二维码。用手机扫描:
> **WhatsApp** → **Settings** → **Linked Devices** → **Link a Device**
Once scanned, the status changes to `connected` and incoming messages are routed to your configured agent.
扫描完成后,状态将变为 `connected`,入站消息会路由到你配置的智能体。
### Gateway Environment Variables
### 网关环境变量
| Variable | Description | Default |
| 变量 | 说明 | 默认值 |
|----------|-------------|---------|
| `WHATSAPP_WEB_GATEWAY_URL` | Gateway URL for OpenFang to connect to | _(empty = disabled)_ |
| `WHATSAPP_GATEWAY_PORT` | Port the gateway listens on | `3009` |
| `OPENFANG_URL` | OpenFang API URL the gateway reports to | `http://127.0.0.1:4200` |
| `OPENFANG_DEFAULT_AGENT` | Agent that handles incoming messages | `assistant` |
| `WHATSAPP_WEB_GATEWAY_URL` | OpenFang 用于连接网关的 URL | _(空 = 禁用)_ |
| `WHATSAPP_GATEWAY_PORT` | 网关监听端口 | `3009` |
| `OPENFANG_URL` | 网关上报的 OpenFang API URL | `http://127.0.0.1:4200` |
| `OPENFANG_DEFAULT_AGENT` | 处理入站消息的智能体 | `assistant` |
### Gateway API Endpoints
### 网关 API 端点
| Method | Route | Description |
| 方法 | 路由 | 说明 |
|--------|-------|-------------|
| `POST` | `/login/start` | Generate QR code (returns base64 PNG) |
| `GET` | `/login/status` | Connection status (`disconnected`, `qr_ready`, `connected`) |
| `POST` | `/message/send` | Send a message (`{ "to": "5511999999999", "text": "Hello" }`) |
| `GET` | `/health` | Health check |
### Alternative: WhatsApp Cloud API
For production workloads, use the [WhatsApp Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api) with a Meta Business account. See the [Cloud API configuration docs](https://openfang.sh/docs/channels/whatsapp).
| `POST` | `/login/start` | 生成二维码(返回 base64 PNG |
| `GET` | `/login/status` | 连接状态(`disconnected``qr_ready``connected` |
| `POST` | `/message/send` | 发送消息(`{ "to": "5511999999999", "text": "Hello" }` |
| `GET` | `/health` | 健康检查 |
### 备选方案:WhatsApp Cloud API
生产环境工作负载请使用 [WhatsApp Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api),并配合 Meta Business 账号。请参阅 [Cloud API 配置文档](https://openfang.sh/docs/channels/whatsapp).
---
## 27 LLM Providers, 123+ Models
## 27 LLM 提供商,123+ 款模型
3 native drivers (Anthropic, Gemini, OpenAI-compatible) route to 27 providers:
3 个原生驱动(AnthropicGeminiOpenAI 兼容)可路由至 27 家提供商:
Anthropic, Gemini, OpenAI, Groq, DeepSeek, OpenRouter, Together, Mistral, Fireworks, Cohere, Perplexity, xAI, AI21, Cerebras, SambaNova, HuggingFace, Replicate, Ollama, vLLM, LM Studio, Qwen, MiniMax, Zhipu, Moonshot, Qianfan, Bedrock, and more.
AnthropicGeminiOpenAIGroqDeepSeekOpenRouterTogetherMistralFireworksCoherePerplexityxAIAI21CerebrasSambaNovaHuggingFaceReplicateOllamavLLMLM StudioQwenMiniMaxZhipuMoonshotQianfanBedrock 等。
Intelligent routing with task complexity scoring, automatic fallback, cost tracking, and per-model pricing.
智能路由:任务复杂度评分、自动回退、成本追踪,以及按模型定价。
---
## Migrate from OpenClaw
## OpenClaw 迁移
Already running OpenClaw? One command:
已经在运行 OpenClaw?一条命令即可:
```bash
# Migrate everything: agents, memory, skills, configs.
@@ -382,13 +386,13 @@ openfang migrate --from openclaw --path ~/.openclaw
openfang migrate --from openclaw --dry-run
```
The migration engine imports your agents, conversation history, skills, and configuration. OpenFang reads SKILL.md natively and is compatible with the ClawHub marketplace.
迁移引擎会导入你的 agents、对话历史、skills 和配置。OpenFang 原生读取 SKILL.md,并与 ClawHub 市场兼容。
---
## OpenAI-Compatible API
## OpenAI 兼容 API
Drop-in replacement. Point your existing tools at OpenFang:
即插即用替代方案。将现有工具指向 OpenFang
```bash
curl -X POST localhost:4200/v1/chat/completions \
@@ -400,11 +404,11 @@ curl -X POST localhost:4200/v1/chat/completions \
}'
```
140+ REST/WS/SSE endpoints covering agents, memory, workflows, channels, models, skills, A2A, Hands, and more.
140+ REST/WS/SSE 端点,涵盖 agentsmemoryworkflowschannelsmodelsskillsA2AHands 等。
---
## Quick Start
## 快速开始
```bash
# 1. Install (macOS/Linux)
@@ -442,7 +446,7 @@ openfang start
---
## Development
## 开发
```bash
# Build the workspace
@@ -460,42 +464,42 @@ cargo fmt --all -- --check
---
## Stability Notice
## 稳定性说明
OpenFang v0.5.10 is pre-1.0. The architecture is solid, the test suite is comprehensive, and the security model is deep. That said:
OpenFang v0.5.10 处于 1.0 之前阶段。架构扎实,测试套件完善,安全模型深入。不过:
- **Breaking changes** may occur between minor versions until v1.0.
- **Some Hands** are more mature than others. Browser and Researcher are the most battle tested.
- **Edge cases** exist. If you find one, [open an issue](https://github.com/RightNow-AI/openfang/issues).
- **Pin to a specific commit** for production deployments until v1.0.
- 在 v1.0 之前,**破坏性变更**可能出现在各次要版本之间。
- **部分 Hands** 比其他更成熟。Browser Researcher 经过最多实战检验。
- **边缘情况**依然存在。如发现,请 [提交 issue](https://github.com/RightNow-AI/openfang/issues).
- 在 v1.0 之前,生产部署请 **固定到特定 commit**
We ship fast and fix fast. The goal is a rock solid v1.0 by mid 2026.
我们快速交付、快速修复。目标是在 2026 年年中推出坚如磐石的 v1.0。
---
## Security
## 安全
To report a security vulnerability, email **jaber@rightnowai.co**. We take all reports seriously and will respond within 48 hours.
如需报告安全漏洞,请发送邮件至 **jaber@rightnowai.co**。我们认真对待每一份报告,并将在 48 小时内回复。
---
## License
## 许可证
MIT. Use it however you want.
MIT。随意使用。
---
## Links
## 链接
- [Website & Documentation](https://openfang.sh)
- [Quick Start Guide](https://openfang.sh/docs/getting-started)
- [网站与文档](https://openfang.sh)
- [快速入门指南](https://openfang.sh/docs/getting-started)
- [GitHub](https://github.com/RightNow-AI/openfang)
- [Discord](https://discord.gg/sSJqgNnq6X)
- [Twitter / X](https://x.com/openfangg)
---
## Built by RightNow
## RightNow 打造
<p align="center">
<a href="https://www.rightnowai.co/">
@@ -504,11 +508,11 @@ MIT. Use it however you want.
</p>
<p align="center">
OpenFang is built and maintained by <a href="https://x.com/Akashi203"><strong>Jaber</strong></a>, Founder of <a href="https://www.rightnowai.co/"><strong>RightNow</strong></a>.
OpenFang <a href="https://x.com/Akashi203"><strong>Jaber</strong></a> 构建并维护,他是 <a href="https://www.rightnowai.co/"><strong>RightNow</strong></a> 的创始人。
</p>
<p align="center">
<a href="https://www.rightnowai.co/">Website</a> &bull;
<a href="https://www.rightnowai.co/">网站</a> &bull;
<a href="https://x.com/Akashi203">Twitter / X</a> &bull;
<a href="https://www.buymeacoffee.com/openfang" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
</p>
@@ -516,5 +520,5 @@ MIT. Use it however you want.
---
<p align="center">
<strong>Built with Rust. Secured with 16 layers. Agents that actually work for you.</strong>
<strong>使用 Rust 构建。16 层安全防护。真正为你效力的 Agents。</strong>
</p>