doc: update readme for uv

This commit is contained in:
qixinbo
2026-04-01 21:47:49 +08:00
parent 5dc6b63525
commit a4c2078e6e
2 changed files with 24 additions and 31 deletions
+10 -12
View File
@@ -103,11 +103,11 @@ uv build --wheel --out-dir ../dist
```bash
# 建议先创建虚拟环境
python -m venv .venv
uv venv
source .venv/bin/activate
# 安装 DataClaw(示例:安装根目录 dist 下的 wheel)
pip install ./dist/dataclaw-*.whl
uv pip install ./dist/dataclaw-*.whl
# 启动服务(默认 http://127.0.0.1:8000
dataclaw start
@@ -141,14 +141,14 @@ export DATA_ROOT=/absolute/path/to/data
```bash
cd backend
# 创建虚拟环境(可选但强烈建议)
python -m venv .venv
uv venv
source .venv/bin/activate
# 安装依赖
pip install -r requirements.txt
uv sync
# 启动 FastAPI 服务器
uvicorn app.main:app --reload --port 8000
uv run uvicorn app.main:app --reload --port 8000
```
```bash
@@ -168,10 +168,10 @@ npm run dev
```bash
cd whisper
python -m venv .venv
uv venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py
uv pip install -r requirements.txt
uv run python main.py
```
默认服务地址:`http://localhost:8001`
@@ -313,15 +313,13 @@ curl -X POST http://127.0.0.1:8000/api/v1/a2a/tasks/<task_id>/webhooks \
```bash
# 终端1:实例 A
cd backend
source .venv/bin/activate
DATA_ROOT=/tmp/dataclaw-a uvicorn main:app --reload --port 8000
DATA_ROOT=/tmp/dataclaw-a uv run uvicorn main:app --reload --port 8000
```
```bash
# 终端2:实例 B
cd backend
source .venv/bin/activate
DATA_ROOT=/tmp/dataclaw-b uvicorn main:app --reload --port 8001
DATA_ROOT=/tmp/dataclaw-b uv run uvicorn main:app --reload --port 8001
```
然后在两个实例分别注册并登录,拿到 token:
+14 -19
View File
@@ -103,27 +103,26 @@ Once built, the wheel is located in the project root `dist/` directory, e.g., `d
```bash
# We recommend creating a virtual environment first
python -m venv .venv
source .venv/bin/activate
uv venv
# Install DataClaw
pip install ./dist/dataclaw-*.whl
uv pip install ./dist/dataclaw-*.whl
# Start the service (defaults to http://127.0.0.1:8000)
dataclaw start
uv run dataclaw start
```
Common service control commands:
```bash
# Check running status
dataclaw status
uv run dataclaw status
# Custom host/port
dataclaw start --host 0.0.0.0 --port 8000
uv run dataclaw start --host 0.0.0.0 --port 8000
# Stop the service
dataclaw stop
uv run dataclaw stop
```
Optional environment variable:
@@ -141,14 +140,13 @@ If you want to debug the frontend code or rebuild the frontend artifacts, use th
```bash
cd backend
# Create a virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate
uv venv
# Install dependencies
pip install -r requirements.txt
uv sync
# Start the FastAPI server
uvicorn app.main:app --reload --port 8000
uv run uvicorn app.main:app --reload --port 8000
```
```bash
@@ -168,10 +166,9 @@ If you want to use voice input in chat, run the standalone `whisper` service:
```bash
cd whisper
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py
uv venv
uv pip install -r requirements.txt
uv run python main.py
```
Default service URL: `http://localhost:8001`
@@ -264,15 +261,13 @@ Run them in two terminals:
```bash
# Terminal 1 - Instance A
cd backend
source .venv/bin/activate
DATA_ROOT=/tmp/dataclaw-a uvicorn main:app --reload --port 8000
DATA_ROOT=/tmp/dataclaw-a uv run uvicorn main:app --reload --port 8000
```
```bash
# Terminal 2 - Instance B
cd backend
source .venv/bin/activate
DATA_ROOT=/tmp/dataclaw-b uvicorn main:app --reload --port 8001
DATA_ROOT=/tmp/dataclaw-b uv run uvicorn main:app --reload --port 8001
```
Create/login users and fetch tokens: