Files
Arcrun/llms.txt
T
uncle6me-web c152f5fc1d feat(onboarding+kbdb): 8.P0 cron 止血 + §7.8 onboarding + .env.example 範本
kbdb-base 8.P0:scheduled.ts cron 每分鐘 KV list → 單一 key get(lib/cron-index.ts);
  webhooks-named 維護單 key + 一次性 migrate-cron-index;acr update 自動遷移。1440 list/日 → 0。

self-hosted-init §7.8 onboarding:
  P0 init 偵測+裝完驗收(lib/preflight.ts,pip 式,冪等)
  P1 acr whoami(+--json)+ MCP arcrun_whoami(AI 不繞 CLI 猜帳號)
  P2 mcp-setup 寫完印「請重啟 client」
  P3(部分)repo .env.example 範本(每格白話說明、值留空)+ llms.txt 教 AI 幫用戶 cp 建 .env

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 19:15:51 +08:00

58 lines
3.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.
# arcrun — 給 AI 操盤手的啟動指南
> 你(Claude Code / AI 助手)正在幫一位使用者用 arcrun 做自動化。
> 使用者可能只會跟你聊天、把這個連結丟給你。接下來的事大多由你做。
> arcrun = 讓自動化變成「純文字工作流」跑在使用者自己的 Cloudflare,而不是每次重刻 Python 腳本。
## 你的第一步(務必先做)
```
npm i -g arcrun && acr install-harness
```
`acr install-harness` 會把 arcrun 的防護裝進使用者**當前專案**:
- arcrun-mindset Skill(世界觀 + 資源去哪取)
- CLAUDE.md 區塊(提醒:用 arcrun 不要自寫 Python
- arcrun-guard hook(你走歪時當場提醒/糾正)
- /arcrun slash command(使用者可打 `/arcrun <需求>`
裝完你就有完整指引,照著走即可。
## 裝 harness 前先記住的鐵則
- **使用者選 arcrun = 不要自己寫 Python/Node 一次性腳本。** 用 arcrun 工作流。
- 打外部 API → 寫 recipe`acr recipe push`),不自刻 HTTP client。
- 不自製零件(WASM)—— 零件由 arcrun 維護走 PR。你能用的是現有零件 + recipe + 工作流。
- 需要 AI 判斷時你自己做,不要讓工作流回頭呼叫 LLM。
- 所有 CLI 操作你來做,別丟指令叫使用者自己打(除非他想自己來)。
## 完整啟動流程
1. `npm i -g arcrun && acr install-harness`(裝 CLI + 防護)
2. `npm i -g wrangler`Cloudflare CLI,部署用)
3. **建 .env 並帶使用者填憑證**(憑證是唯一只有他能拿的東西,但「建檔」由你做):
- **你做**`cp .env.example .env`repo 根有 `.env.example` 範本,左邊 KEY 名都寫好了、
每格上面有白話說明)。使用者只需要找到值、填到「=」右邊。
- **帶使用者拿值**——用白話照抄式引導,**不要講 KV / Worker / R2 / zone 等術語**(他聽不懂也不需懂):
- 帳號代碼(`CLOUDFLARE_ACCOUNT_ID`):登入 https://dash.cloudflare.com 右側欄複製。
- 金鑰(`CLOUDFLARE_API_TOKEN`):https://dash.cloudflare.com/profile/api-tokens → Create Custom Token →
照抄勾**兩組**權限(Account/Workers Scripts/Edit、Account/Workers KV Storage/Edit
→ 複製產生的 token。(不需要 R2、不需要綁信用卡——只用 Workers + KV 免費額度。)
- `NAMESPACE`:隨便取個英數小名(非密碼)。`ENCRYPTION_KEY`:你可幫他產
`node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"`)。
- 使用者把值貼進 .env(或貼給你、你幫他填進對應格)。**CLOUDFLARE 兩格沒填,後面什麼都跑不了。**
- 連外部服務(如 Notion)的 token 也填進 .env 的 ③ 區,之後 `acr creds push` 加密上傳。
4. `acr init --self-hosted`(你幫跑,讀 .env 的 CF 憑證)—— 自動建資源、部署、seed、寫 .mcp.jsonMCP 連線)。
跑完會印「安裝驗收」逐項 ✓/✗;有 ✗ 照它給的指令補(多數 `acr update` 冪等重試)。
5. 跑完照提示 `wrangler secret put ENCRYPTION_KEY`CLI 會印確切指令)。
6. 把使用者需求拆成 workflow → `acr push`。完成給客觀證據(HTTP 2xx / trace)。
## 暴露提醒
部署對外 webhook / push recipe 會讓東西可被外部呼叫 → 停下來讓使用者明示同意,不替他決定公開。
## 更多
- 指令:`acr --help`
- 開始開發後讀 arcrun-mindset Skill。