Skip to content

Commit af12127

Browse files
committed
docs: clarify environment-specific setup
1 parent 1a76d53 commit af12127

4 files changed

Lines changed: 70 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# AGENTS.md
2+
3+
本文件定义 Codex 在 `AiToEarn` 仓库内的默认工作规则。
4+
5+
## Communication
6+
7+
- 默认使用简体中文回复。
8+
9+
## Project Layout
10+
11+
- `project/aitoearn-backend` 是 Nx + pnpm 后端工作区。
12+
- `project/aitoearn-web` 是 Next.js + pnpm 前端项目。
13+
- 根目录主要维护 README、Docker 部署文档、`docker-compose.yml` 和展示资源。
14+
15+
## Package & Command Rules
16+
17+
- backend/web 使用 `pnpm`
18+
- 根目录没有统一 package,不要在根目录随手执行 install/build。
19+
- backend 改动优先在 `project/aitoearn-backend``pnpm nx ...` 验证,并遵循 `project/aitoearn-backend/CLAUDE.md`
20+
- web 改动在 `project/aitoearn-web` 验证,优先使用 `pnpm run type-check``pnpm build`
21+
- 纯文档改动至少运行 `git diff --check`
22+
23+
## Documentation Rules
24+
25+
- 根 README 对外文档包含 `README.md``README_EN.md``README_JA.md`;涉及用户可见能力、安装、OpenClaw、MCP、Relay、API Key 或环境地址时默认三语同步。
26+
- Docker 部署说明涉及生产部署、环境变量或 `docker compose` 时,同步检查 `DOCKER_DEPLOYMENT_CN.md``DOCKER_DEPLOYMENT_EN.md`
27+
- README 类改动保持最小可用改写,不要把参考文档整段复制进来。
28+
- 用户可见 README、skill、capability reference 只写当前能力与环境规则,不写 `dev`、测试环境、验证日期等来源说明。
29+
30+
## Environment Rules
31+
32+
- OpenClaw、MCP、Relay 都必须明确区分中国版和国际版环境:`*.aitoearn.cn` 属于中国版,`*.aitoearn.ai` 属于国际版。
33+
- 中国版 API Key 只能搭配 `aitoearn.cn` 相关 URL;国际版 API Key 只能搭配 `aitoearn.ai` 相关 URL。环境和 Key 不匹配会导致 401。
34+
- MCP 示例需要按环境区分 `https://aitoearn.cn/api/unified/mcp` / `https://aitoearn.ai/api/unified/mcp`,SSE 示例同理区分 `/api/unified/sse`
35+
- Relay 示例需要按 `RELAY_API_KEY` 来源选择 `RELAY_SERVER_URL`:中国版使用 `https://aitoearn.cn/api`,国际版使用 `https://aitoearn.ai/api`

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,12 @@ AiToEarn 最核心的目标:**帮助每一位创作者赚钱**。
164164
npx -y @aitoearn/openclaw-plugin-cli
165165
```
166166

167-
首次运行后会先让您选择环境,请注意,AitoEarn有两个环境,分别是中国版和国际版环境。
168-
如果使用中国版环境+国际版的key会导致401报错。
169-
请确保环境与key是匹配的。
167+
首次运行后会先让你选择环境并输入 API Key。请确保环境与 Key 匹配:
168+
169+
- 中国版:使用 `aitoearn.cn` 获取的 API Key
170+
- 国际版:使用 `aitoearn.ai` 获取的 API Key
171+
172+
环境和 Key 不匹配会导致 401。
170173

171174
安装完成后,你就可以在 OpenClaw 中直接接收并执行 AiToEarn 的赚钱任务:
172175

@@ -180,6 +183,13 @@ npx -y @aitoearn/openclaw-plugin-cli
180183
181184
AiToEarn 支持所有兼容 MCP 协议的 AI 助手。以下是常见工具的配置方式:
182185

186+
请根据 API Key 来源选择地址,环境和 Key 不匹配会导致 401:
187+
188+
| 环境 | MCP 地址 | SSE 地址 |
189+
|------|---------|---------|
190+
| 中国版 | `https://aitoearn.cn/api/unified/mcp` | `https://aitoearn.cn/api/unified/sse` |
191+
| 国际版 | `https://aitoearn.ai/api/unified/mcp` | `https://aitoearn.ai/api/unified/sse` |
192+
183193
<details open>
184194
<summary><b>Claude Desktop</b></summary>
185195

@@ -251,6 +261,8 @@ docker compose up -d
251261
252262
`docker-compose.yml``aitoearn-server` 服务中添加(API Key 获取方式见 [上方说明](#get-api-key)):
253263

264+
请根据 `RELAY_API_KEY` 来源选择 `RELAY_SERVER_URL`:中国版 Key 使用 `https://aitoearn.cn/api`,国际版 Key 使用 `https://aitoearn.ai/api`。环境和 Key 不匹配会导致 401。
265+
254266
```yaml
255267
RELAY_SERVER_URL: https://aitoearn.ai/api
256268
RELAY_API_KEY: 你的API-Key

README_EN.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The simplest way — just open your browser:
163163
npx -y @aitoearn/openclaw-plugin-cli
164164
```
165165

166-
On first run, follow the prompts to complete the required selections and enter your API Key to finish setup.
166+
On first run, select the environment and enter your API Key. Make sure they match: China uses an API Key from `aitoearn.cn`, and international uses one from `aitoearn.ai`. A mismatch returns 401.
167167

168168
After setup, you can receive and execute AiToEarn earning tasks directly inside OpenClaw:
169169

@@ -177,6 +177,13 @@ After setup, you can receive and execute AiToEarn earning tasks directly inside
177177
178178
AiToEarn works with any MCP-compatible AI assistant. Here's how to configure the most popular ones:
179179

180+
Choose the URL that matches your API Key. A mismatched environment and key returns 401:
181+
182+
| Environment | MCP URL | SSE URL |
183+
|-------------|---------|---------|
184+
| China | `https://aitoearn.cn/api/unified/mcp` | `https://aitoearn.cn/api/unified/sse` |
185+
| International | `https://aitoearn.ai/api/unified/mcp` | `https://aitoearn.ai/api/unified/sse` |
186+
180187
<details open>
181188
<summary><b>Claude Desktop</b></summary>
182189

@@ -248,6 +255,8 @@ Open **[http://localhost:8080](http://localhost:8080)** and you're ready to go.
248255
249256
Add to `docker-compose.yml` under `aitoearn-server` (see [How to Get an API Key](#get-api-key)):
250257

258+
Choose `RELAY_SERVER_URL` based on where `RELAY_API_KEY` was created: use `https://aitoearn.cn/api` for China keys and `https://aitoearn.ai/api` for international keys. A mismatch returns 401.
259+
251260
```yaml
252261
RELAY_SERVER_URL: https://aitoearn.ai/api
253262
RELAY_API_KEY: your-api-key

README_JA.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ AiToEarnブラウザ拡張機能を通じて、上記のすべてのプラット
168168
npx -y @aitoearn/openclaw-plugin-cli
169169
```
170170

171-
初回実行時は案内に従って必要な項目を選択し、API Key を入力してインストールと設定を完了してください
171+
初回実行時は環境を選択し、API Key を入力してください。中国版は `aitoearn.cn` の API Key、国際版は `aitoearn.ai` の API Key を使用します。環境と Key が一致しない場合は 401 になります
172172

173173
設定後は、OpenClaw 内で AiToEarn の収益化タスクを直接受け取り実行できます。
174174

@@ -182,6 +182,13 @@ npx -y @aitoearn/openclaw-plugin-cli
182182
183183
AiToEarnはMCPプロトコルに対応するすべてのAIアシスタントで動作します。一般的なツールの設定方法:
184184

185+
API Key の取得元に合わせて URL を選択してください。環境と Key が一致しない場合は 401 になります。
186+
187+
| 環境 | MCP URL | SSE URL |
188+
|------|---------|---------|
189+
| 中国版 | `https://aitoearn.cn/api/unified/mcp` | `https://aitoearn.cn/api/unified/sse` |
190+
| 国際版 | `https://aitoearn.ai/api/unified/mcp` | `https://aitoearn.ai/api/unified/sse` |
191+
185192
<details open>
186193
<summary><b>Claude Desktop</b></summary>
187194

@@ -253,6 +260,8 @@ docker compose up -d
253260
254261
`docker-compose.yml``aitoearn-server`サービスに以下を追加(API Keyの取得方法は[上記](#get-api-key)を参照):
255262

263+
`RELAY_API_KEY` の取得元に合わせて `RELAY_SERVER_URL` を選択してください。中国版 Key は `https://aitoearn.cn/api`、国際版 Key は `https://aitoearn.ai/api` を使用します。環境と Key が一致しない場合は 401 になります。
264+
256265
```yaml
257266
RELAY_SERVER_URL: https://aitoearn.ai/api
258267
RELAY_API_KEY: あなたのAPI-Key

0 commit comments

Comments
 (0)