Go to file
王性驊 c71e8357b8 Hands: screen tools for the account's other computers; one pop-up per step; clearer TLS errors
- The brain's bots get computer_use_* for 手腳 (devices), as the prompt already said; before,
  they only had shell there and fell back to scrot, which can't see a Wayland desktop
- After saying yes in the 「使用電腦工具」 pop-up (it shows the step), that same step isn't asked
  again (sending messages still asks every time)
- A certificate failure says so instead of 「網路連線出了問題」
- install.sh restarts the background AnyBot after an update

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-05 07:56:19 +08:00
.gitea/workflows Release builds on Gitea Actions: macOS app, Ubuntu, headless Linux, server 2026-11-04 22:07:46 +08:00
box AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00
deploy Server setup: Tailscale address instead of a domain, and a no-questions mode 2026-11-05 01:26:33 +08:00
docs One-step install: install.sh, fixed Linux and server builds, clearer README 2026-11-05 00:52:10 +08:00
fonts AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00
icons AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00
mobile 頁面: pages a bot makes and keeps up to date (like the original's tracking pages) 2026-11-05 01:41:41 +08:00
relay One-step install: install.sh, fixed Linux and server builds, clearer README 2026-11-05 00:52:10 +08:00
src Hands: screen tools for the account's other computers; one pop-up per step; clearer TLS errors 2026-11-05 07:56:19 +08:00
.dockerignore AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00
.gitignore Release builds on Gitea Actions: macOS app, Ubuntu, headless Linux, server 2026-11-04 22:07:46 +08:00
Cargo.lock anybot setup and the server setup: guided setup with a brain picker 2026-11-04 20:38:45 +08:00
Cargo.toml One-step install: install.sh, fixed Linux and server builds, clearer README 2026-11-05 00:52:10 +08:00
FEATURES.md make, README and docs: build and install from source 2026-11-04 22:16:45 +08:00
GROK_BOT_FEATURES.md AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00
GROK_BOT_TOKENS.md AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00
MECHANICS.md AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00
Makefile One-step install: install.sh, fixed Linux and server builds, clearer README 2026-11-05 00:52:10 +08:00
ORIGINAL_FEATURES.md AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00
README.md One-step install: install.sh, fixed Linux and server builds, clearer README 2026-11-05 00:52:10 +08:00
install.sh Hands: screen tools for the account's other computers; one pop-up per step; clearer TLS errors 2026-11-05 07:56:19 +08:00
mechanics.json AnyBot: first commit of the working desktop app 2026-11-04 16:51:51 +08:00

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 分鐘。


開始使用

只用一台電腦

  1. 裝好桌面 App,打開。
  2. 設定 › 模型,貼上你的 API 金鑰(例如 xAI、OpenAI)。
  3. 開始聊天。

手機和多台電腦一起用

     手機(網頁)          筆電(螢幕)         沒螢幕的 Linux(手腳)
          \                    |                     /
           └──────── 帳號伺服器(每台都連過來)─────────┘
                               |
                大腦:Bot、聊天、記憶、例行任務都在這裡

步驟 1:架伺服器(只做一次)

需要:一台 Linux 主機(2 GB 以上記憶體)、一個網域,網域的 A 紀錄要指到這台主機,80 和 443 埠要打開。

curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- server

只會問三件事:網域、帳號、密碼。它會自動裝 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 磁碟區,重開機自動啟動。設定檔:deploy/server/docker-compose.yml
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/           技術文件