Files
chatgpt-on-wechat/docs/zh/quick-start.mdx
2026-02-27 12:10:16 +08:00

121 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 快速开始
description: 一键安装或手动部署 CowAgent
---
# 快速开始
CowAgent 支持 Linux、macOS、Windows 操作系统,可在个人计算机及服务器上运行,需安装 Python 3.7 ~ 3.12(推荐 3.9)。
## 一键安装
项目提供了一键安装、配置、启动、管理程序的脚本,推荐使用脚本快速运行:
```bash
bash <(curl -sS https://cdn.link-ai.tech/code/cow/run.sh)
```
脚本自动执行以下流程:
1. 检查 Python 环境(需要 Python 3.7+
2. 安装必要工具git、curl 等)
3. 克隆项目代码到 `~/chatgpt-on-wechat`
4. 安装 Python 依赖
5. 引导配置 AI 模型和通信渠道
6. 启动服务
### 脚本管理命令
安装完成后,可使用以下命令管理服务:
| 命令 | 说明 |
| --- | --- |
| `./run.sh start` | 启动服务 |
| `./run.sh stop` | 停止服务 |
| `./run.sh restart` | 重启服务 |
| `./run.sh status` | 查看运行状态 |
| `./run.sh logs` | 查看实时日志 |
| `./run.sh config` | 重新配置 |
| `./run.sh update` | 更新项目代码 |
## 手动安装
### 1. 克隆项目代码
```bash
git clone https://github.com/zhayujie/chatgpt-on-wechat
cd chatgpt-on-wechat/
```
<Tip>
若遇到网络问题可使用国内仓库地址https://gitee.com/zhayujie/chatgpt-on-wechat
</Tip>
### 2. 安装依赖
核心依赖(必选):
```bash
pip3 install -r requirements.txt
```
扩展依赖(可选,建议安装):
```bash
pip3 install -r requirements-optional.txt
```
### 3. 配置
复制配置文件模板并编辑:
```bash
cp config-template.json config.json
```
填写核心配置项,详细说明参考 [配置说明](/zh/configuration)。
### 4. 运行
**本地运行:**
```bash
python3 app.py
```
运行后默认启动 Web 服务,访问 `http://localhost:9899/chat` 开始对话。
**服务器后台运行:**
```bash
nohup python3 app.py & tail -f nohup.out
```
## Docker 部署
使用 Docker 部署无需下载源码和安装依赖。Agent 模式下更推荐使用源码部署以获得更多系统访问能力。
<Note>
需要安装 [Docker](https://docs.docker.com/engine/install/) 和 docker-compose。
</Note>
**1. 下载配置文件**
```bash
wget https://cdn.link-ai.tech/code/cow/docker-compose.yml
```
打开 `docker-compose.yml` 填写所需配置。
**2. 启动容器**
```bash
sudo docker compose up -d
```
**3. 查看日志**
```bash
sudo docker logs -f chatgpt-on-wechat
```