docs: make English the default docs language and fix link paths

This commit is contained in:
zhayujie
2026-05-31 17:52:22 +08:00
parent 126649f70f
commit 7bf4ef3d05
231 changed files with 8999 additions and 8974 deletions

View File

@@ -1,11 +1,11 @@
---
title: 手动安装
description: 手动部署 CowAgent(源码 / Docker
title: Manual Install
description: Deploy CowAgent manually (source code / Docker)
---
## 源码部署
## Source Code Deployment
### 1. 克隆项目代码
### 1. Clone the project
```bash
git clone https://github.com/zhayujie/CowAgent
@@ -13,170 +13,136 @@ cd CowAgent/
```
<Tip>
若遇到网络问题可使用国内仓库地址:https://gitee.com/zhayujie/CowAgent
For network issues, use the mirror: https://gitee.com/zhayujie/CowAgent
</Tip>
### 2. 安装依赖
### 2. Install dependencies
核心依赖(必选):
Core dependencies (required):
```bash
pip3 install -r requirements.txt
```
扩展依赖(可选,建议安装):
Optional dependencies (recommended):
```bash
pip3 install -r requirements-optional.txt
```
> 国内网络可使用镜像源加速:`pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple`
### 3. Install Cow CLI
### 3. 安装 Cow CLI
安装命令行工具,用于管理服务和技能:
Install the command-line tool for managing services and skills:
```bash
pip3 install -e .
```
安装后即可使用 `cow` 命令:
Then use the `cow` command:
```bash
cow help
```
<Note>
此步骤为推荐操作。安装后可以使用 `cow start``cow stop``cow update` 等命令管理服务,也可以使用 `cow skill` 管理技能。如果不安装 CLI可以使用 `./run.sh` `python3 app.py` 运行。
This step is recommended. After installation you can use `cow start`, `cow stop`, `cow update` to manage the service, and `cow skill` to manage skills. Without the CLI, you can use `./run.sh` or `python3 app.py` to run.
</Note>
### 3.1 安装浏览器工具(可选)
### 4. Configure
如需使用浏览器工具(控制浏览器访问网页、填写表单等),运行:
```bash
cow install-browser
```
该命令会自动安装 Playwright 和 Chromium 浏览器。详细说明参考 [浏览器工具文档](/tools/browser)。
<Note>
浏览器工具依赖较重(~300MB如不需要可跳过不影响其他功能正常使用。
</Note>
### 4. 配置
复制配置文件模板并编辑:
Copy the config template and edit:
```bash
cp config-template.json config.json
```
在 `config.json` 中填写模型 API Key 和通道类型等配置,详细说明参考各 [模型文档](/models/minimax)。
Fill in model API keys, channel type, and other settings in `config.json`. See the [model docs](/models/index) for details.
### 5. 运行
### 5. Run
**使用 Cow CLI 运行(推荐):**
**Using Cow CLI (recommended):**
```bash
cow start
```
**或者本地前台运行:**
**Or run locally in foreground:**
```bash
python3 app.py
```
运行后默认启动 Web 控制台,访问 `http://localhost:9899` 开始对话和管理Agent。
By default, the Web console starts. Access `http://localhost:9899` to chat.
**服务器后台运行(不使用 CLI 时):**
**Background run on server (without CLI):**
```bash
nohup python3 app.py & tail -f nohup.out
```
<Tip>
**服务器公网访问 Web 控制台**:默认 `web_host` 仅监听 `127.0.0.1`(本机访问),需公网访问时请在 `config.json` 中将 `web_host` 设为 `0.0.0.0`,同时强烈建议设置 `web_password` 启用鉴权。此外还需在防火墙/安全组中放行 `9899` 端口,建议仅对指定 IP 开放以保证安全。
**Deploying on a server?** By default `web_host` only listens on `127.0.0.1` (local access). Set `web_host` to `0.0.0.0` in `config.json` to make the console reachable from outside, and set `web_password` to protect it. Don't forget to open port `9899` in your firewall or security group — ideally restricted to specific IPs.
</Tip>
## Docker 部署
## Docker Deployment
使用 Docker 部署无需下载源码和安装依赖。Agent模式下更推荐使用源码部署以获得更多系统访问能力。
Docker deployment does not require cloning source code or installing dependencies. For Agent mode, source deployment is recommended for broader system access.
<Note>
需要安装 [Docker](https://docs.docker.com/engine/install/) docker-compose
Requires [Docker](https://docs.docker.com/engine/install/) and docker-compose.
</Note>
**1. 下载配置文件**
**1. Download config**
```bash
curl -O https://cdn.link-ai.tech/code/cow/docker-compose.yml
```
打开 `docker-compose.yml` 填写所需配置。
Edit `docker-compose.yml` with your configuration.
**2. 启动容器**
**2. Start container**
```bash
sudo docker compose up -d
```
**3. 查看日志**
**3. View logs**
```bash
sudo docker logs -f chatgpt-on-wechat
```
<Tip>
**Docker 公网访问 Web 控制台**:在 `docker-compose.yml` 中将 `WEB_HOST` 设为 `0.0.0.0`(容器内默认绑定 `127.0.0.1` 无法从宿主机外访问),同时强烈建议设置 `WEB_PASSWORD` 启用鉴权。此外需确保 `9899` 端口正确映射到宿主机,并在防火墙/安全组放行该端口。
**Running in Docker?** Set `WEB_HOST` to `0.0.0.0` in `docker-compose.yml` so the console is reachable from outside the container, and set `WEB_PASSWORD` to protect it. Make sure port `9899` is mapped to the host and open in your firewall or security group.
</Tip>
## 核心配置项
## Core Configuration
<Tabs>
<Tab title="源码部署config.json">
```json
{
"channel_type": "web",
"model": "deepseek-v4-flash",
"deepseek_api_key": "",
"agent": true,
"agent_workspace": "~/cow",
"agent_max_context_tokens": 40000,
"agent_max_context_turns": 30,
"agent_max_steps": 15,
"cow_lang": "auto"
}
```
</Tab>
<Tab title="Docker 部署docker-compose.yml">
```yaml
environment:
CHANNEL_TYPE: 'web'
MODEL: 'deepseek-v4-flash'
DEEPSEEK_API_KEY: 'your-api-key'
DEEPSEEK_API_BASE: 'https://api.deepseek.com/v1'
AGENT: 'True'
AGENT_MAX_CONTEXT_TOKENS: 40000
AGENT_MAX_CONTEXT_TURNS: 30
AGENT_MAX_STEPS: 15
COW_LANG: 'auto'
```
</Tab>
</Tabs>
```json
{
"channel_type": "web",
"model": "deepseek-v4-flash",
"deepseek_api_key": "",
"agent": true,
"agent_workspace": "~/cow",
"agent_max_context_tokens": 40000,
"agent_max_context_turns": 30,
"agent_max_steps": 15,
"cow_lang": "auto"
}
```
| 参数 | 环境变量 | 说明 | 默认值 |
| --- | --- | --- | --- |
| `channel_type` | `CHANNEL_TYPE` | 接入渠道类型 | `web` |
| `model` | `MODEL` | 模型名称 | `deepseek-v4-flash` |
| `agent` | `AGENT` | 是否启用 Agent 模式 | `true` |
| `agent_workspace` | - | Agent 工作空间路径 | `~/cow` |
| `agent_max_context_tokens` | `AGENT_MAX_CONTEXT_TOKENS` | 最大上下文 tokens | `40000` |
| `agent_max_context_turns` | `AGENT_MAX_CONTEXT_TURNS` | 最大上下文记忆轮次 | `30` |
| `agent_max_steps` | `AGENT_MAX_STEPS` | 单次任务最大决策步数 | `15` |
| `cow_lang` | `COW_LANG` | 界面、命令文案、系统提示词等的语言,`auto` 自动检测,可设为 `zh` / `en` | `auto` |
| Parameter | Description | Default |
| --- | --- | --- |
| `channel_type` | Channel type | `web` |
| `model` | Model name | `deepseek-v4-flash` |
| `agent` | Enable Agent mode | `true` |
| `agent_workspace` | Agent workspace path | `~/cow` |
| `agent_max_context_tokens` | Max context tokens | `40000` |
| `agent_max_context_turns` | Max context turns | `30` |
| `agent_max_steps` | Max decision steps per task | `15` |
| `cow_lang` | Language for the UI, command text and system prompts; `auto` to detect, or set `zh` / `en` | `auto` |
<Tip>
全部配置项可在项目 [`config.py`](https://github.com/zhayujie/CowAgent/blob/master/config.py) 文件中查看。Docker 部署时,配置项名称需转为大写环境变量格式。
Full configuration options are in the project [`config.py`](https://github.com/zhayujie/CowAgent/blob/master/config.py).
</Tip>

View File

@@ -1,13 +1,13 @@
---
title: 一键安装
description: 使用脚本一键安装和管理 CowAgent
title: One-click Install
description: One-click install and manage CowAgent with scripts
---
项目提供了一键安装、配置、启动、管理程序的脚本,推荐使用脚本快速运行。
The project provides scripts for one-click install, configuration, startup, and management. Script-based deployment is recommended for quick setup.
支持 LinuxmacOSWindows 操作系统,需安装 Python 3.7 ~ 3.12(推荐 3.9)。
Supports Linux, macOS, and Windows. Requires Python 3.7-3.12 (3.9 recommended).
## 安装命令
## Install Command
<Tabs>
<Tab title="Linux / macOS">
@@ -22,37 +22,37 @@ description: 使用脚本一键安装和管理 CowAgent
</Tab>
</Tabs>
脚本自动执行以下流程:
The script automatically performs these steps:
1. 检查 Python 环境(需要 Python 3.7+
2. 安装必要工具(gitcurl 等)
3. 克隆项目代码到 `~/CowAgent`
4. 安装 Python 依赖和 Cow CLI
5. 引导配置 AI 模型和通信渠道
6. 启动服务
1. Check Python environment (requires Python 3.7+)
2. Install required tools (git, curl, etc.)
3. Clone project to `~/CowAgent`
4. Install Python dependencies and Cow CLI
5. Guided configuration for AI model and channel
6. Start service
运行后默认启动 Web 控制台,访问 `http://localhost:9899` 开始对话和管理Agent。
By default, the Web console starts after installation. Access `http://localhost:9899` to begin chatting.
<Note>
**服务器部署需要公网访问控制台时**,请在 `config.json` 中将 `web_host` 设为 `0.0.0.0`(默认仅监听 `127.0.0.1` 本机访问),同时强烈建议设置 `web_password` 启用鉴权。然后通过 `http://<server-ip>:9899` 访问,并确保防火墙/安全组放行 `9899` 端口。
**Deploying on a server?** By default `web_host` only listens on `127.0.0.1` (local access only). Set `web_host` to `0.0.0.0` in `config.json` to make the console reachable from outside, and set `web_password` to protect it. Don't forget to open port `9899` in your firewall or security group — ideally restricted to specific IPs.
</Note>
## 管理命令
## Management Commands
安装完成后,使用 `cow` CLI 管理服务:
After installation, use the `cow` command to manage the service:
| 命令 | 说明 |
| Command | Description |
| --- | --- |
| `cow start` | 启动服务 |
| `cow stop` | 停止服务 |
| `cow restart` | 重启服务 |
| `cow status` | 查看运行状态 |
| `cow logs` | 查看实时日志 |
| `cow update` | 更新代码并重启 |
| `cow install-browser` | 安装浏览器工具依赖 |
| `cow start` | Start service |
| `cow stop` | Stop service |
| `cow restart` | Restart service |
| `cow status` | Check run status |
| `cow logs` | View real-time logs |
| `cow update` | Update code and restart |
| `cow install-browser` | Install browser tool dependencies |
更多命令和用法参考 [命令文档](/cli/index)。
See the [Commands documentation](/cli/index) for more details.
<Note>
如果 `cow` 命令不可用,也可以使用 `./run.sh <命令>`Linux/macOS)或 `.\scripts\run.ps1 <命令>`Windows作为替代功能等效。
If the `cow` command is not available, you can use `./run.sh <command>` (Linux/macOS) or `.\scripts\run.ps1 <command>` (Windows) as a fallback. Both are functionally equivalent.
</Note>

View File

@@ -1,31 +1,31 @@
---
title: 更新升级
description: CowAgent 的升级方式说明
title: Upgrade
description: How to upgrade CowAgent
---
## 命令升级(推荐)
## Recommended: One-line upgrade
使用 `cow update` 一键完成代码更新和服务重启:
Use `cow update` to pull the latest code and restart the service in one step:
```bash
cow update
```
该命令会自动完成以下流程:
The command runs the following automatically:
1. 拉取最新代码(`git pull`
2. 停止当前服务
3. 更新 Python 依赖
4. 重新安装 CLI
5. 启动服务
1. Pull the latest code (`git pull`)
2. Stop the running service
3. Update Python dependencies
4. Reinstall the CLI
5. Start the service
<Note>
如果未安装 Cow CLI,也可以使用 `./run.sh update` 完成相同操作。
If the Cow CLI is not installed, `./run.sh update` performs the same operations.
</Note>
## 手动升级
## Manual upgrade
在项目根目录下执行:
Run the following inside the project root:
```bash
git pull
@@ -33,23 +33,23 @@ pip3 install -r requirements.txt
pip3 install -e .
```
更新完成后重启服务:
Then restart the service:
```bash
# 使用 Cow CLI (推荐)
# Using Cow CLI (recommended)
cow restart
# 或使用 run.sh
# Or using run.sh
./run.sh restart
# 或使用 nohup 直接运行
# Or restart manually with nohup
kill $(ps -ef | grep app.py | grep -v grep | awk '{print $2}')
nohup python3 app.py & tail -f nohup.out
```
## Docker 升级
## Docker upgrade
`docker-compose.yml` 所在目录下执行:
Run the following in the directory containing `docker-compose.yml`:
```bash
sudo docker compose pull
@@ -57,5 +57,5 @@ sudo docker compose up -d
```
<Tip>
升级前建议备份 `config.json` 配置文件。Docker 环境下如需保留数据,可通过 volume 挂载持久化工作空间目录。
Back up `config.json` before upgrading. For Docker deployments, mount the workspace directory as a volume to persist data across upgrades.
</Tip>