From real runs on the cloud brain with the person's Mac (Threads patrol, a post draft, "show me my screen"): - computer_use_show: a plain picture of any computer's screen goes into the chat (the bot sees it too). The bot used to describe a screenshot in words and fail to send it. - The phone shows the bot's attachments: pictures in place, other files download on a tap (api/file, only from the chats' file folder). It showed nothing for the bot and names only for the person. - send_file works from the person's other computers (fetch_file over the relay, 20 MB, secrets stay). - The same call with the same answer again and again is warned the 3rd time and stopped from the 4th (a blank tab was read 11 times, then the bot said Threads was logged out without opening it); a blank tab says so; checking a login means opening the site. - Screenshot lists: a nameless row around a named button isn't numbered, a nameless row takes the words inside it, empty spacer rows aren't numbered (System Settings: 63 numbers -> 33, all named). - Writing "in my voice" reads the person's own recent posts first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4 |
||
|---|---|---|
| .gitea/workflows | ||
| box | ||
| deploy | ||
| docs | ||
| fonts | ||
| icons | ||
| mobile | ||
| relay | ||
| src | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| FEATURES.md | ||
| GROK_BOT_FEATURES.md | ||
| GROK_BOT_TOKENS.md | ||
| MECHANICS.md | ||
| Makefile | ||
| ORIGINAL_FEATURES.md | ||
| README.md | ||
| install.sh | ||
| mechanics.json | ||
README.md
AnyBot
你自己的 AI Bot。可以聊天,也能幫你動手做事:處理檔案、執行指令、操作瀏覽器和螢幕、跑例行任務。
- 每個 Bot 可以用不同的 AI:xAI Grok、OpenAI、Claude、Gemini、OpenRouter、OpenCode Go、Ollama(本機),或任何 OpenAI 相容的服務
- 桌面 App(macOS、Linux)+手機網頁版(可加到主畫面、收通知)
- 多台電腦一起用:一台當大腦,其他電腦當它的手腳
安裝
先決定你要裝哪一種,複製那一行到終端機執行就好。需要的東西(系統套件、Rust、Docker)腳本會自己裝。
| 我要… | 在哪台執行 | 指令 |
|---|---|---|
| 桌面 App | Mac、有螢幕的 Linux | curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh |
| 架伺服器(帳號伺服器+大腦+HTTPS) | 有網域的 Linux 主機 | curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- server |
| 加一台電腦當手腳 | 任何 Linux(有沒有螢幕都可以) | 在 AnyBot 按「加一台電腦」,貼上它給你的那一行 |
想先看腳本做什麼:install.sh。它只會裝 AnyBot 需要的套件,程式裝在你的使用者資料夾(不用 root),原始碼放在
~/AnyBot。
第一次要多久? 腳本會在你的電腦上編譯,第一次大約 5–15 分鐘(看電腦快慢),之後更新只要 1–2 分鐘。
開始使用
只用一台電腦
- 裝好桌面 App,打開。
- 設定 › 模型,貼上你的 API 金鑰(例如 xAI、OpenAI)。
- 開始聊天。
手機和多台電腦一起用
手機(網頁) 筆電(螢幕) 沒螢幕的 Linux(手腳)
\ | /
└──────── 帳號伺服器(每台都連過來)─────────┘
|
大腦:Bot、聊天、記憶、例行任務都在這裡
步驟 1:架伺服器(只做一次)
需要:一台 Linux 主機(2 GB 以上記憶體),加上一個網域(A 紀錄指到這台、80 和 443 埠打開)或 Tailscale(不用網域,只有你的裝置連得到)。
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- server
只會問三件事:網址(網域或 Tailscale)、帳號、密碼。它會自動裝 Docker、申請 HTTPS 憑證、建立帳號、啟動大腦。完成畫面會告訴你網址。
沒有伺服器?也可以先拿一台 Mac 當大腦,見 docs/multi-device.md(做法 B)。
步驟 2:手機:用瀏覽器打開你的網址並登入,再「加入主畫面」。
步驟 3:其他電腦
-
有螢幕的電腦:裝好桌面 App,到 設定 › 一般 › 手機與帳號 登入,在「大腦」那一欄選伺服器。
-
沒螢幕的 Linux:在手機 AnyBot 右上角按「⋯ › 加一台電腦」(或在電腦的 設定 › 一般 › 手機與帳號),會出現一行像這樣的指令:
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- hands https://你的網域 482913貼到那台電腦執行,就會自動裝好、接上大腦,之後開機也會自動執行。不用帳號密碼,這組碼 10 分鐘內有效、只能用一次。
更新和移除
| 要做什麼 | 指令 |
|---|---|
| 更新桌面 App 或手腳 | 再執行一次安裝的那一行 |
| 更新伺服器 | 在伺服器上 cd ~/AnyBot && make server,選「用現有設定,更新並重新啟動」 |
| 移除程式 | cd ~/AnyBot && make uninstall(你的 Bot 和聊天會留著) |
| 停掉手腳 | systemctl --user disable --now anybot |
出問題時
先執行這個,它會告訴你缺什麼:
cd ~/AnyBot && make doctor
| 看到 | 怎麼辦 |
|---|---|
編譯到一半被中斷、Killed 或 signal: 9 |
記憶體不夠。加 2 GB swap 再試:sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile |
Rust 太舊 或 requires rustc 1.95 |
rustup update stable。用 apt 裝的 rustc 太舊,請改用 rustup |
alsa 或 pkg-config 找不到 |
少了系統套件,執行 make deps |
| 伺服器的網址連不到 | 網域是不是指到這台?80、443 埠有沒有被防火牆擋?cd ~/AnyBot/deploy/server && docker compose logs caddy |
| 大腦登不進帳號 | cd ~/AnyBot/deploy/server && docker compose logs anybot |
| Mac 說「無法驗證開發者」 | 對 AnyBot 按右鍵 › 打開,只有第一次需要 |
| 手機上看到「大腦目前離線」 | 大腦那台關機、睡眠,或 AnyBot 沒開。詳見 docs/multi-device.md 的「連不上時」 |
還是不行:把 make doctor 的結果和錯誤訊息的最後幾行貼給維護的人。
自己從原始碼建置
適合想改程式的人。一般使用請用上面的一行安裝。
git clone https://code.30cm.net/daniel.w/AnyBot.git
cd AnyBot
make deps # 裝好系統套件和 Rust(只要一次;Linux 會問 sudo 密碼)
make # 建置
make install # 安裝:Mac → ~/Applications/AnyBot.app;Linux → ~/.local/bin/anybot 和應用程式選單
| 指令 | 做什麼 |
|---|---|
make run |
不安裝,直接打開 |
make test |
跑測試 |
make doctor |
檢查這台缺什麼 |
make serve |
不開視窗執行(一直開著的電腦) |
make setup |
把這台接到你的大腦(終端機裡的引導畫面) |
make server |
在這台架伺服器(同上面的 install.sh server) |
make dist |
打包發行檔到 dist/ |
make help |
列出全部 |
需要:Rust 1.95 以上、C 編譯器、git;Linux 另外需要 pkg-config 和 ALSA 開發套件(libasound2-dev)。make deps 會全部裝好。各平台細節:docs/install.md。
部署方式
| 方式 | 用在 | 說明 |
|---|---|---|
| Docker Compose(預設) | 伺服器 | install.sh server 用的就是它:帳號伺服器、大腦、Caddy(自動 HTTPS)三個容器,資料放在 Docker 磁碟區,重開機自動啟動。用 Tailscale 網址時不開 Caddy,改由 tailscale serve 提供 HTTPS。設定檔:deploy/server/docker-compose.yml |
| 免問安裝(腳本、Ansible…) | 伺服器 | 答案用環境變數給:ANYBOT_SETUP_USER=me ANYBOT_SETUP_PASSWORD=… [ANYBOT_SETUP_DOMAIN=網域] sh install.sh server;不給網域時用這台的 Tailscale 網址 |
| Portainer、Coolify、Dokploy… | 已經在用這些管理工具的伺服器 | 它們都吃標準的 docker-compose.yml:把 repo 加進去、指定 deploy/server/docker-compose.yml、在環境變數填 ANYBOT_USER、ANYBOT_PASSWORD、ANYBOT_RELAY_PUBLIC_URL。若工具自己處理 HTTPS,就拿掉 caddy 那一段,把網域導到 relay 的 8080 埠 |
| systemd(使用者服務) | 手腳、沒螢幕的 Linux 大腦 | anybot setup 會自動建立 anybot.service;登出後也要繼續跑:sudo loginctl enable-linger $USER |
| launchd | Mac 當大腦或帳號伺服器 | 見 docs/multi-device.md |
| Gitea Actions | 推 tag 自動打包發行檔 | 見 docs/release.md |
不需要另外架資料庫:資料是幾個 JSON 檔,寫入時不會寫一半。要備份伺服器,備份 Docker 磁碟區 server_relay-data、server_anybot-data 就好。
文件
| 文件 | 內容 |
|---|---|
| docs/install.md | 安裝細節:各平台需求、手動步驟、常見問題 |
| docs/multi-device.md | 大腦、手腳、螢幕:怎麼架、怎麼接、連不上時看什麼 |
| docs/architecture.md | 技術架構:程式分層、資料存放、安全設計 |
| docs/protocol.md | 帳號伺服器的介面與長連線格式 |
| docs/release.md | 打包和自動建置 |
| FEATURES.md | 所有功能 |
專案結構
install.sh 一鍵安裝(桌面 App、手腳、伺服器)
src/ AnyBot:桌面 App、無視窗模式、anybot setup
relay/ 帳號伺服器
mobile/ 手機網頁
box/ Bot 自己的電腦(Docker 容器)
deploy/ 各平台的安裝和部署檔:mac/、linux/、server/、ci/
docs/ 技術文件