教我做(skillify)只讀那個 Bot 的工作紀錄(oplog),但一回合結束時工作紀錄就縮到只剩還在等的訊息
(通常整份刪掉)——長按的是自己早就做完的那則訊息,所以每次都回「那一回合沒有可重播的步驟」。
工作紀錄是給當掉後收尾用的,本來就只留進行中的那一回合;每一步的參數和結果另外照抄進 30 天的
稽核紀錄(oplog/audit.db,手機的稽核時間軸已經改讀它)。教我做要的正是「過去某一回合的步驟」,
所以改讀稽核紀錄,不是把工作紀錄留著。
整理做法(learn)在回答送出、這一回合 Done 之後才在背景跑(不讓使用者等),它回報的 AnyBot 自己的
問題(StreamEvent::Issues)卻排在「舊回合的零星事件一律丟掉」的檢查後面——紀錄寫了「Bot 回報了
2 個 AnyBot 自己的問題」,待改進還是空的。改成跟 Learned 一樣在那個檢查前面處理(事件的順序本來
就是 Done 在前,不能為了它讓使用者等整理做法)。
- store:records(bot) 把稽核紀錄裡 30 天內的回合和步驟還原成工作紀錄的格式(回合開頭帶使用者的話、
每一步的參數和結果、回合結束排在步驟後面);KEEP_DAYS 公開給錯誤訊息用。
- appctl skillify:讀 store::records,稽核紀錄打不開才退回工作紀錄;把手機送的訊息時間 at 交下去。
- memory::skillify:
- 學的是按的那則訊息開始的那一回合:同一句話可能做過好幾次(30 天內很常見),有 at 就取那個時間
之後第一個開始的回合,沒有 at(或時鐘對不上)才取最近的。
- 比對時兩邊都照手機 plain() 的規則整理(拿掉 * _ ` # >、連結只留字、換行併成空白)——手機送的是
plain(m.text),原本訊息裡有 >、_ 或換行就對不上。技能的名字、說明、做法改用那一回合原本的字
(併成一行),不用手機去過標記的字(teach_log.txt 不會變成 teachlog.txt)。
- 回傳 Result,分開「找不到以「…」開始的那一回合(只找得到 30 天內、由一則訊息開始的回合;做事中途
插的話不算)」和「沒有可重播的步驟」;「这件事」→「這件事」(整份 memory.rs 用 ICU Hans-Hant 掃過,
只有這一個簡體字)。
- app drain_events:Issues 跟 Learned 一樣在回合結束後也收;記在主 Bot 名下(支線的算主 Bot 的)。
- 手機:教我做帶上訊息的 at;成功後呼叫的 again() 在那裡不是函式(全域的 again 是 loadChat 的旗標),
按了會丟 TypeError,拿掉。
- verify-anybot:phone 多一個 long-press <css> [--text](觸控按住 0.8 秒),走得到長按的選單;
SKILL.md、ctl 的用法一起寫。
- 功能地圖:replay.md 的「教我做」改走真的選單(長按 › 教我做),拿掉「走不到」那一步;陷阱補上學的是
哪一回合、只找 30 天內、找不到時說什麼;garden.md、replay.md 的自動測試列上新測試。
已驗證: 完整 cargo test(金鑰清空、DOCKER_HOST 指到不存在、ANYBOT_HF_BASE 連不到)全綠(672 過、46 ignored
沒跑);cargo clippy --bin anybot --all-targets -- -D warnings 沒有警告;sh deploy/ci/lint-sh.sh 過。新測試
appctl::a_turn_that_has_ended_can_still_be_taught、memory::the_phones_plain_words_find_the_turn、
memory::the_message_pressed_is_the_turn_learned、app::anybots_own_problems_found_after_the_turn_reach_the_list,
store 的 the_trail_keeps_the_story… 加了 records、a_finished_turn_can_become_a_skill 加了「這件事」——把修正
拿掉再跑都失敗(找不到那一回合、待改進是空的、簡體字、學到後來那一回合、說明變成去過標記的字),
放回去都過。另外請一個乾淨脈絡的 Agent 照 replay.md、garden.md 審過 diff,它提的三點(同一句話學錯回合、
技能的字被手機去掉標記、插話也說「30 天內」)都改了。verify-anybot 冷開照地圖寫的跑:replay.md 三步
(做五步學會、重播填空格、教我做——長按 › 選單 › 「已存成技能」,那一回合已經做完、工作紀錄不在,技能
steps 1、參數和說明都照原樣 echo 教 >> teach.txt;長按插話跳「找不到以「…」開始的那一回合…」)都過,修改前
第三步是 HTTP 400;garden.md 沒事不報、/doctor 遮金鑰、待改進合併計次(browser_fill_contact 一條 count 2、
bots 驗證小幫手,重開後還在)、版本都過,修改前第三步待改進是空的。
未驗證: garden.md 的「電腦版 設定 › 更新」要開桌面視窗(desktop-shot),沒跑;「有事的報告、當掉」和
replay.md 的「網站地圖」照地圖寫的走不到(要明天 8:44、真的當掉、真的模型);garden.md 是在審查後那幾處
修改之前的建置上跑的(那幾處只動 skillify 和手機的教我做,沒動待改進);真的手機的長按沒有測(用無頭
Chrome 的觸控事件代替);超過 30 天的回合、別台裝置時鐘不準時的 at 只靠單元測試。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5sXAsDLzxz6UZJgoC
|
||
|---|---|---|
| .claude/skills | ||
| .gitea/workflows | ||
| bench/computer-use | ||
| box | ||
| deploy | ||
| docs | ||
| fonts | ||
| icons | ||
| install | ||
| mobile | ||
| relay | ||
| shots/readme | ||
| skills | ||
| src | ||
| .dockerignore | ||
| .gitignore | ||
| CLAUDE.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| FEATURES.md | ||
| LICENSE | ||
| MECHANICS.md | ||
| Makefile | ||
| README.en.md | ||
| README.md | ||
| SECURITY.md | ||
| build.rs | ||
| clippy.toml | ||
| install.cmd | ||
| install.ps1 | ||
| install.sh | ||
| mechanics.json | ||
README.en.md
AnyBot
An AI assistant that runs on your own computers.
It chats, and it gets things done: files, commands, forms in a browser, the screen in front of you, jobs on a clock. It asks before it acts.
中文 · English
Your pick of model. Bring your own API key: xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, or anything that speaks the OpenAI API. With ChatGPT Plus or Pro, sign in with your ChatGPT account and use the plan instead of a key. With nothing at all, use Ollama at home. Each bot can use a different model.
Your data stays with you. Chats, memory, files, and the passwords in the vault live on your computer or on a server you run. The account server is yours too and only connects your devices; backups are encrypted on your computer before they are uploaded, and the server cannot open them.
A team of bots, not one. Each row on the left is its own bot, with its own personality, model, memory, skills, and the computers it may use. They ask each other questions, hand off work, and can answer you together in a group chat.
Every feature · Feature map · Computers and phone · Security
Install in 30 seconds
Open a terminal and paste one line.
# macOS, Linux (not Ubuntu-only: apt, dnf, yum, pacman, zypper, apk, xbps)
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh
# Windows 10/11 (x64, arm64)
irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 | iex
It installs what it needs, asks which piece you want, and walks through the first setup. The first build takes 5–15 minutes, later updates 1–2. It lives in your user folder and needs no administrator account.
Account server + brain (any Linux with Docker, 2 GB RAM or more; it asks for a domain, a user, a password, and handles HTTPS itself):
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \
| sh -s -- server
Headless hands (a computer for the bot to use; a screen is optional). The URL and the pairing code come from “Add a computer” in AnyBot:
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \
| sh -s -- hands https://your-address 482913
# Hands on Windows
$env:ANYBOT_MODE='hands'
$env:ANYBOT_PAIR_URL='https://your-address'
$env:ANYBOT_PAIR_CODE='482913'
irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 | iex
Running this from an agent, with no questions asked: sh install.sh --print reports what fits this machine, then use the environment variables — see install/AGENT.md.
First run
- Open AnyBot. On a Mac, the first time: right-click the icon › Open (it has no Apple developer signature).
- On the welcome screen, press “Set up a model” and pick one: paste an API key; or choose “ChatGPT plan” and press “Continue with ChatGPT” to sign in with your ChatGPT account; or choose Ollama to run on your own machine.
- Make your first bot and give it a job, such as “sort the photos in my Downloads folder by month”. It tells you what it wants to run, and nothing happens until you press “Allow”.
- Type “/” in the input for commands, “@” to bring in another bot.
Used AnyBot on another computer? Press “Sign in” on the welcome screen and your bots and chats come along.
What it does
Hands-on, but it asks first
- Files and commands — read, edit, search, run; long jobs go to the background, interactive ones get a real terminal. On macOS and Linux (with Landlock in the kernel), commands run in a sandbox that cannot read or touch your private folders. Before a bot edits a file it keeps a copy; /rewind puts it back.
- Its own computer — a Linux desktop (XFCE, Chromium) in Docker, where each bot has its own screen and browser, kept apart from yours. You can watch what it is doing at any time and take over when needed.
- A browser — open pages, sign in, click, fill forms, upload and download. Passwords and card numbers sit in the vault and AnyBot types them into the page; the model never sees them. Before a post or comment is sent, repeats are blocked; after, the page is read again to confirm it is really there.
- The screen you are using — it reads the numbered buttons in a screenshot, then clicks. When you need to sign in or type a code, it hands you the screen. Show it once, and it learns the steps.
- Asks first — touching your computer, sending something out, or doing anything that cannot be undone shows a card first. Paying, sending, and deleting are asked every time. You can always-allow a kind of action, turn on direct mode, or type /always-approve to let everything through; what the safety rules block stays blocked whatever you set.
Hand it something big
- /plan — it looks around first and hands you a plan card to approve; only then does it start, ticking off each step.
- /goal — give it a condition (“all tests pass”). After each turn another model reads the evidence; if the goal is not met, the bot keeps going.
- Routines — say “every weekday at 9, three AI news items” and it is scheduled; routines can also run when a PR merges, CI fails, or mail arrives. Every run is logged, and two failures in a row pause it.
- Steer and branch — type while it works and it reads your note at the next step; /btw sends the same bot off to do a second thing.
- Watch — a command can wake the bot on each new line it prints, for keeping an eye on a deploy or a log.
A team of bots
- Each bot has its own soul and instructions, strengths, abilities, skills, memory, and computers it may use. Start from a template (research assistant, writing partner, computer helper…) or from scratch.
- Ask a colleague and wait for the answer, hand off work without waiting, teach a colleague a skill you know; type “@” in any chat to bring one in.
- Group chats: members answer in turn, each with its own model; questions go to whoever is good at them, and “@name” passes the turn.
Remembers, learns, writes it down
- Memory — each bot keeps its own; “About you” is shared by all of them. As you type, the memories it plans to bring along show above the input, and you can drop or add any of them.
- Skills — the Agent Skills format (SKILL.md), with 8 built in (pdf, xlsx, docx, pptx and more) and more installable from GitHub. After a long job it saves the way that worked as a skill; skills with saved steps replay next time without asking the model.
- Pages — things to track or compare become a page (tables, charts, number cards) that it keeps updating, with older versions kept.
Connects to the outside
- Connectors (MCP) — a local command or a remote URL; ones that need an account sign in with OAuth. The market lists 8 common ones and searches the official MCP Registry.
- Channels — Slack, Discord, Telegram, Teams, the Mac's Messages and Mail, SMS, X: each message that comes in is answered by the bot you chose. Outside messages are not trusted: no memory of yours, no computer tools, and your earlier approvals do not count.
- Mac apps and phone calls — Mail, Notes, Messages, Reminders, Calendar, Contacts; calls and texts from your Twilio number; posts on X. Sending, messaging, and posting are asked one at a time.
- Hooks and scripts — run your own programs at fixed points while a bot works (Claude Code's format);
anybot --ask "…" --jsonlets a script ask a bot directly.
Reach it from anywhere
- Phone — open your URL in a browser and sign in: the same chat, with approvals, questions, the bot's computer, and notifications. No server? On the same Wi-Fi or Tailscale, connect straight to your computer with a phone password.
- Voice — talk instead of typing, have a voice chat, or have answers read aloud.
- Send — drop a file or a few words from any device of your account onto another.
Chat commands
- /plan what to do — plan first; it starts once you approve.
- /goal condition — keeps going until the condition holds; /goal clear cancels.
- /btw what to do — the same bot does this on the side without stopping its current job.
- /always-approve (or /yolo) — let everything through; add off to stop.
- /rewind — put the bot's file edits and the chat back to an earlier message.
- /fork — keep a copy of this chat as a branch that goes its own way.
- /context, /compact — how much of the model's room this chat uses; summarize now.
- /usage — tokens over the last day and week, per bot and per model.
- /doctor — check the connections, model services, the bot's computer, connectors, and disk.
One machine thinks, others get used
One machine remembers and thinks (the brain). Others are there to be used (the hands). The phone is only a window. They all meet on an account server you run, so the computers at home do not open a port or need a public address. The hands only follow commands signed by the brain.
you on the phone you on a laptop a computer with no screen
\ | /
└───── account server (it only connects them) ─────┘
|
brain: bots, chats, memory, routines live here
|
hands: the brain asks this machine to see, click, read, browse
| Role | What you do |
|---|---|
| Brain | Set up the server once, or use a Mac that stays awake |
| Screen | Install the desktop app and sign in to the same account |
| Hands | Press “Add a computer” and paste the line it shows |
| Phone | Open your URL in a browser and add it to the Home screen |
No server yet? Use one always-on Mac as the brain — see method B in docs/en/multi-device.md.
What happens to a sentence
flowchart TD
you[You: desktop app or phone]
relay[Account server<br/>relays only, stores no chats]
brain[AnyBot on the brain]
model[The model you picked]
ask[Touch the computer? Ask first]
box[The bot's own computer<br/>a small desktop in Docker]
hands[One of the hands<br/>your Mac, Linux, or Windows]
you --> relay --> brain
brain --> model
brain --> ask
ask --> box
ask --> hands
- You send a message on the desktop or the phone. The phone does not think for itself; it reads the same chat on the brain.
- The brain hands that sentence, the bot's instructions, its memory, and its tools to the model you picked.
- If the model only answers, it writes back. If it wants to read a file, open a page, or click something, it proposes an action.
- That action goes through AnyBot's own rules first — the model does not decide whether it is allowed.
- Once you allow it, the action runs on the computer you chose: the bot's own computer, the one you are using, or a paired hand.
- The result goes back into the chat. Phone and laptop show the same thing because both read the brain.
Three programs are enough, and there is no database server: anybot (the desktop, the background service anybot --serve, and the terminal setup anybot setup are this one file), anybot-relay (the account server; computers connect out to it), and the phone page (one file, built into the app). Details in docs/en/architecture.md.
Documents
| You want… | Read |
|---|---|
| How a feature works, where to set it | Feature map (Chinese) |
| Every feature with its details and numbers | FEATURES.md (Chinese) |
| Phone, brain, hands, “it will not connect” | docs/en/multi-device.md |
| A platform failed, build it yourself | docs/en/install.md |
| How the code is layered | docs/en/architecture.md |
| What a bot remembers, how much reaches the model | docs/memory.md (Chinese) |
| The skill format | docs/skills.md (Chinese) |
| The account server's API | docs/en/protocol.md |
| Trust boundaries, where keys live | docs/en/security.md |
| Packaging, CI | docs/release.md (Chinese) |
Chinese is the source of truth; the docs/en/ files are English summaries of it.
Hack on it
git clone https://code.30cm.net/daniel.w/AnyBot.git
cd AnyBot
make deps && make && make install
make run opens it, make test runs the tests, make lint runs the same clippy check as CI, make help lists everything.
Before changing a feature, read its part of the feature map; when behaviour changes, update that file in the same commit — cargo test featuremap:: catches what was left out. The full rules are in CLAUDE.md.
Security
Found a vulnerability? Please do not post it publicly; report it privately as described in SECURITY.md (English summary).
License
Apache-2.0, see LICENSE.