Skip to content

🤖 Open-source, local-first alternative to Grok Bot, OpenAI dots and Claude Duet. Your own AI bots on any model: GPT, Claude, Gemini, Grok, DeepSeek, Kimi, GLM and 70+ more through one Modelflare key. Reach them in the app, WeChat or Feishu; they remember you, work in the background, run commands and use your computer. Pay per use.

docs(bot): 补上环境准备,Bot 直接提交到 master;没配私钥时 CI 只检查不打包

dyk981a777aeae68e
diff --git a/.claude/skills/amb-bot-dev/SKILL.md b/.claude/skills/amb-bot-dev/SKILL.md
index d9786f8..3647570 100644
--- a/.claude/skills/amb-bot-dev/SKILL.md
+++ b/.claude/skills/amb-bot-dev/SKILL.md
@@ -20,7 +20,7 @@ A catalog bot is a folder. The full reference is `docs/bot-framework_en.md` (Chi
4. UI: import only from `/amb/botapp/kit/kit.js` and your own folder. Render `useBot().state`, and change data only with `send(text, action)`. Put strings in `ui/locales/zh-CN.json` and `en.json`.
5. Run `npm run bot -- check bots/<id>` and fix every rule it names. Repeat until it passes.
6. Preview: with the app running, `npm run bot -- dev bots/<id>`, then open the URL it prints.
-7. Before proposing the bot: `npm run bot -- check bots/<id> --full`.
+7. When it's ready: `npm run bot -- check bots/<id> --full`, then ask someone to judge whether it's worth shipping. Commit directly to master, including the screenshots in `.check/`. Don't open a PR.
## Rules the checks enforce
diff --git a/.github/workflows/bot-catalog.yml b/.github/workflows/bot-catalog.yml
index 95f89e6..3d777bf 100644
--- a/.github/workflows/bot-catalog.yml
+++ b/.github/workflows/bot-catalog.yml
@@ -1,14 +1,13 @@
-# Catalog bots: check every bot and build the signed catalog when bots change (docs/bot-framework_en.md).
+# Catalog bots: check every bot and build the signed catalog when bots are pushed (docs/bot-framework_en.md).
# The output is kept as an artifact; how it reaches production is decided by the release environment.
-# Static checks only: the rendering and real-model checks (check --full) run before proposing a bot.
+# Until the repository has AMB_CATALOG_PRIVATE_KEY, this only checks and doesn't pack.
+# Static checks only: the rendering and real-model checks (check --full) run before committing a bot.
name: Bot catalog
on:
- pull_request:
- paths: ["bots/**", "catalog.json", "src/botkit/**", "assets/bot-template/**"]
push:
branches: [master]
- paths: ["bots/**", "catalog.json"]
+ paths: ["bots/**", "catalog.json", "src/botkit/**", "assets/bot-template/**"]
permissions:
contents: read
@@ -31,12 +30,18 @@ jobs:
shopt -s nullglob
for d in bots/*/; do npm run --silent bot -- check "$d"; done
- name: Pack and sign
- if: github.event_name == 'push'
+ id: pack
env:
AMB_CATALOG_PRIVATE_KEY: ${{ secrets.AMB_CATALOG_PRIVATE_KEY }}
- run: npm run --silent bot -- pack --root . --out dist-catalog
+ run: |
+ if [ -z "$AMB_CATALOG_PRIVATE_KEY" ]; then
+ echo "AMB_CATALOG_PRIVATE_KEY isn't set; skipping pack."
+ exit 0
+ fi
+ npm run --silent bot -- pack --root . --out dist-catalog
+ echo "packed=true" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
- if: github.event_name == 'push'
+ if: steps.pack.outputs.packed == 'true'
with:
name: bot-catalog
path: dist-catalog
diff --git a/docs/bot-framework.md b/docs/bot-framework.md
index 15ad91d..c5c1092 100644
--- a/docs/bot-framework.md
+++ b/docs/bot-framework.md
@@ -6,17 +6,30 @@
目录为空时,现有用户看不到任何变化:侧边栏没有新入口,新手流程和原来一样。
-## 五分钟上手
+## 上手
+
+先准备环境,需要 Node.js 22.13+ 和 Go 1.26.8+:
+
+```bash
+git clone [email protected]:modelflare-ai/AnyModelBot.git
+cd AnyModelBot
+npm install
+npm run setup
+npm start # 打开 http://127.0.0.1:3600/,登录 Modelflare
+```
+
+另开一个终端,开始做 Bot:
```bash
npm run bot -- new <id> # 从模板起一个目录:bots/<id>/
npm run bot -- check bots/<id> # 静态检查,模板里的 TODO 填完才能过
-npm start # 另开一个终端启动 App
npm run bot -- dev bots/<id> # 把这个目录登记到运行中的 App
```
`dev` 会打印一个地址,打开就能看到这个 Bot。改界面文件后刷新就能看到;改了技能或人设,要在侧边栏移除实例再发消息,才会重新安装。
+做好后跑一遍 `check --full`,请人看一眼值不值得上,然后直接提交到 master,连同 `.check/` 里的截图一起提交。不用提 PR。
+
## 架构
```text
@@ -187,7 +200,7 @@ npm run bot -- check bots/<id> --full # 再跑渲染和真实模型,上架
`--full` 需要两样东西:
-- 渲染用 Playwright,不是 App 的依赖:`npm i --no-save playwright && npx playwright install chromium`。截图留在 `.check/`,打包时用作发现页缩略图。
+- 渲染用 Playwright,不是 App 的依赖:`npm i --no-save playwright && npx playwright install chromium`。截图留在 `.check/`,打包时用作发现页缩略图,要一起提交。
- 评测连到运行中的 App(`--app <地址>`,默认本机配置的端口;有令牌时设 `AMB_UI_TOKEN`),会真实安装并调用模型,跑完清掉。
评测任务写在 `evals/tasks.json`:`{ id, prompt, changed?, contains?, notContains? }`,至少 3 个。注入用例写在 `evals/injection.json`:`{ id, prompt, file?: { name, text }, mustNotContain }`,至少 1 个。
@@ -211,7 +224,7 @@ npm run bot -- who-uses <技能> --root .
- `pack` 把每个 Bot 过一遍静态检查,有一个不过就什么都不写。产物是 `index.json`、`index.json.sig`、`bundles/`、`thumbs/`,放到目录地址下就算发布。
- 客户端启动时和之后每 6 小时拉一次(带 ETag),验签失败不更新;缓存也要验签。界面和技能按 sha256 校验。
- 下架后重新 `pack` 并发布,24 小时内客户端生效。普通下架只提示用户;`--security` 会立刻停掉进程、删掉技能,用户的数据不动。
-- `.github/workflows/bot-catalog.yml` 在 `bots/**` 或 `catalog.json` 变化时检查并打包,产物作为 CI artifact;怎么放到线上由发布环境决定。
+- `.github/workflows/bot-catalog.yml` 在 `bots/**` 或 `catalog.json` 推到 master 时检查并打包,产物作为 CI artifact;怎么放到线上由发布环境决定。仓库还没配置 `AMB_CATALOG_PRIVATE_KEY` 时只检查,不打包。
### 上线目录要做的事
diff --git a/docs/bot-framework_en.md b/docs/bot-framework_en.md
index 3e2fb6a..20c2da8 100644
--- a/docs/bot-framework_en.md
+++ b/docs/bot-framework_en.md
@@ -6,17 +6,30 @@ A bot is a folder. The app contains no code for any single bot, so shipping a ne
While the catalog is empty, existing users see no change: no new sidebar entries, and the same onboarding.
-## Quick start
+## Getting started
+
+First set up the environment. You need Node.js 22.13+ and Go 1.26.8+:
+
+```bash
+git clone [email protected]:modelflare-ai/AnyModelBot.git
+cd AnyModelBot
+npm install
+npm run setup
+npm start # open http://127.0.0.1:3600/ and sign in to Modelflare
+```
+
+In another terminal, start on the bot:
```bash
npm run bot -- new <id> # scaffold bots/<id>/ from the template
npm run bot -- check bots/<id> # static checks; fails until every TODO is filled in
-npm start # start the app in another terminal
npm run bot -- dev bots/<id> # register this folder with the running app
```
`dev` prints a URL that opens the bot. Refresh to see UI changes. After changing skills or the persona, remove the instance from the sidebar and send a message to reinstall.
+When it's ready, run `check --full`, ask someone to judge whether it's worth shipping, then commit directly to master, including the screenshots in `.check/`. There's no need for a PR.
+
## Architecture
```text
@@ -187,7 +200,7 @@ Failures name the exact rule. When a new kind of problem turns up, add a rule to
`--full` needs two things:
-- Rendering uses Playwright, which isn't an app dependency: `npm i --no-save playwright && npx playwright install chromium`. Screenshots stay in `.check/` and become Discover thumbnails when packing.
+- Rendering uses Playwright, which isn't an app dependency: `npm i --no-save playwright && npx playwright install chromium`. Screenshots stay in `.check/`, become Discover thumbnails when packing, and should be committed.
- Evals connect to a running app (`--app <url>`, by default the configured local port; set `AMB_UI_TOKEN` if it has a token). They really install the bot and call the model, then clean up.
Eval tasks go in `evals/tasks.json`: `{ id, prompt, changed?, contains?, notContains? }`, at least 3. Injection cases go in `evals/injection.json`: `{ id, prompt, file?: { name, text }, mustNotContain }`, at least 1.
@@ -211,7 +224,7 @@ npm run bot -- who-uses <skill> --root .
- `pack` runs the static checks on every bot and writes nothing if any fails. It produces `index.json`, `index.json.sig`, `bundles/` and `thumbs/`. Putting them at the catalog URL publishes them.
- Clients fetch at startup and every 6 hours (with ETag) and ignore anything that fails verification, including the local cache. UI and skills are verified by sha256.
- After a takedown, run `pack` and publish again; clients pick it up within 24 hours. A normal takedown only notifies users. `--security` stops the process and deletes the skills right away, leaving the user's data alone.
-- `.github/workflows/bot-catalog.yml` checks and packs when `bots/**` or `catalog.json` changes, and keeps the output as a CI artifact. How it reaches production is up to the release environment.
+- `.github/workflows/bot-catalog.yml` checks and packs when `bots/**` or `catalog.json` is pushed to master, and keeps the output as a CI artifact. How it reaches production is up to the release environment. Until the repository has `AMB_CATALOG_PRIVATE_KEY`, it only checks and doesn't pack.
### Going live