Readmes: lead with the picture, and take the pictures fresh
Both languages now open with what AnyBot does, in plain words, before the install table and the flow diagram. The four stills are re-taken from this build (shots/readme/) and tracked, since the READMEs point at them; the old shots/ stayed ignored.
This commit is contained in:
parent
f006aeee35
commit
dba6df198e
|
|
@ -4,7 +4,10 @@
|
|||
|
||||
# Test and screenshot output (regenerated by the test scripts)
|
||||
/linux-shots/
|
||||
/shots/
|
||||
/shots/**
|
||||
# …except the four stills the READMEs show, which come from the current build.
|
||||
!/shots/readme/
|
||||
!/shots/readme/*.png
|
||||
|
||||
# Local secrets (deploy/server/.env.example is the template)
|
||||
.env
|
||||
|
|
|
|||
251
README.en.md
251
README.en.md
|
|
@ -2,117 +2,206 @@
|
|||
|
||||
[中文 README](README.md) · **English**
|
||||
|
||||
Your own AI bot. It chats, and it *does things*: files, shell commands, your browser, your screen, scheduled jobs. Self-hosted — your data stays on machines you own.
|
||||
Your own AI assistant. It chats, and it can also *do* things: files, commands, web pages, the screen in front of you, and jobs that run on a schedule.
|
||||
|
||||
- Every bot can use a different model: xAI Grok, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama (local), or any OpenAI-compatible endpoint
|
||||
- Desktop app (macOS, Linux) + mobile web app (install to home screen, push notifications)
|
||||
- Multiple computers: one **brain**, the others are its **hands** — all linked through your own account server, no ports opened
|
||||
It runs on **your computers**. You bring the model key (or run Ollama at home). Chats, files, and passwords are not stored on someone else's account server.
|
||||
|
||||
## Demo
|
||||
<p>
|
||||
<img src="shots/readme/chat.png" alt="A list of bots on the left, a chat with one of them on the right" width="780">
|
||||
</p>
|
||||
|
||||
<!-- Drop a GIF/video at docs/demo/anybot.gif (see docs/demo/README.md) and it shows here. -->
|
||||
📹 *No recording yet — see [docs/demo/README.md](docs/demo/README.md).*
|
||||
Each row is a bot. Research, writing, and “touch the computer” can each use a different model.
|
||||
|
||||
## How it compares
|
||||
---
|
||||
|
||||
| | AnyBot | OpenClaw | OpenHands | Khoj | UI-TARS-Desktop |
|
||||
|---|---|---|---|---|---|
|
||||
| Positioning | Personal bot across your machines | Agent gateway on your hardware | Coding agent in sandboxes | Personal knowledge/RAG assistant | GUI agent on one desktop |
|
||||
| Chat with your own bots | ✅ multi-bot, per-bot model | ✅ via gateways | coding-focused | ✅ | — |
|
||||
| Controls your real desktop/browser | ✅ + approvals, VNC takeover | via plugins | sandboxed, not your desktop | — | ✅ (its whole product) |
|
||||
| Multi-device brain/hands/phone | ✅ built in, zero open ports | bring your own | — | server + apps | single machine |
|
||||
| Bot's own sandboxed computer (Docker, optional gVisor) | ✅ | host shell | ✅ | — | — |
|
||||
| Secrets never enter the model (vault fills forms directly) | ✅ | — | — | — | — |
|
||||
| Phone web app + push, no app store | ✅ | community | — | ✅ | — |
|
||||
| One binary, JSON files, no database server | ✅ | ✅ | — | needs services | Electron |
|
||||
| License | Apache-2.0 | MIT | MIT | AGPL-3.0 | Apache-2.0 |
|
||||
## It asks before it acts
|
||||
|
||||
AnyBot's bet: a bot that touches your real machines is only trustworthy when the **harness** — not the model — owns the safety gates: per-action approvals, a sensitive-click policy the model cannot talk its way past, secrets painted out of screenshots, and an audit trail that survives crashes.
|
||||
If you say “do this on my computer”, it does not just run it. You see the exact step and choose allow once, always, or no. Sending, paying, and deleting are asked every time, even if you turned other prompts off.
|
||||
|
||||
<p>
|
||||
<img src="shots/readme/ask.png" alt="A card asking permission before a command runs on your computer" width="780">
|
||||
</p>
|
||||
|
||||
The phone is the same chat. Open your URL, sign in, and you can watch from outside — and take the screen when a login needs a person.
|
||||
|
||||
<p>
|
||||
<img src="shots/readme/phone.png" alt="The phone page asks you to sign in" width="280">
|
||||
</p>
|
||||
|
||||
## What you can ask it to do
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Chat, edit, look things up | Each bot has a one-line job description and its own model |
|
||||
| Files and commands | It asks first. Or it works only inside its own computer, a small desktop kept apart from yours |
|
||||
| Web pages and forms | Its own browser. Passwords and card numbers are filled by the app, not read out to the model |
|
||||
| The screen you are using | It looks at buttons, then clicks. If it needs you to sign in, it hands you the screen |
|
||||
| A clock | “Every weekday at 9, three news items” becomes a routine |
|
||||
|
||||
<p>
|
||||
<img src="shots/readme/routines.png" alt="A weekday 9:00 news routine created from the chat" width="780">
|
||||
</p>
|
||||
|
||||
Models: xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama on your machine, or any OpenAI-compatible endpoint.
|
||||
|
||||
---
|
||||
|
||||
## One computer is enough
|
||||
|
||||
If you do not want a server, stop here.
|
||||
|
||||
1. Paste the desktop line below into a terminal. If it asks what to install, choose the desktop app.
|
||||
2. Open AnyBot. On a Mac, the first time: right-click the icon › Open.
|
||||
3. Settings › Models, paste an API key. Or pick Ollama and skip the key.
|
||||
4. Make a bot and talk to it.
|
||||
|
||||
The first build takes about 5–15 minutes. Later updates take 1–2. The app lives in your user folder. No administrator account.
|
||||
|
||||
---
|
||||
|
||||
## A phone, and other computers
|
||||
|
||||
One machine remembers and thinks (the **brain**). Others are there to be used (the **hands**). The phone is only a window. They meet on an **account server you run**, so the computers at home do not open a port or need a public address.
|
||||
|
||||
```
|
||||
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 | In plain words | What you do |
|
||||
|---|---|---|
|
||||
| Brain | Holds every bot and chat. Thinks and runs the clock. Must stay on | Set up the server once, or use a Mac that stays awake |
|
||||
| Screen | The computer you sit at. You see the brain's bots, and the brain can use this machine | Install the desktop app and sign in |
|
||||
| Hands | A computer for the bot. A screen is optional | In AnyBot, press “Add a computer” and paste the line it shows |
|
||||
| Phone | The same chat | Open your URL in a browser and add it to the home screen |
|
||||
|
||||
The server is a Linux machine with 2 GB of RAM, plus a domain or Tailscale (no domain; only your devices can open it).
|
||||
|
||||
```sh
|
||||
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- server
|
||||
```
|
||||
|
||||
It asks for three things: URL, account, password. Docker and HTTPS are its job.
|
||||
|
||||
No server yet? A Mac can be the brain first. That is method B in [docs/multi-device.md](docs/multi-device.md) ([English summary](docs/en/multi-device.md)).
|
||||
|
||||
---
|
||||
|
||||
## How a sentence becomes an action
|
||||
|
||||
For people who want the path, not the source tree. The module map is [docs/architecture.md](docs/architecture.md) ([English summary](docs/en/architecture.md)).
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
you[You: desktop app or phone]
|
||||
relay[Account server<br/>forwards only, does not keep the chat]
|
||||
brain[AnyBot on the brain]
|
||||
model[The model you chose]
|
||||
ask[Touch a computer? Ask you first]
|
||||
box[The bot's own computer<br/>a desktop inside Docker]
|
||||
hands[A paired machine<br/>your Mac, Linux, or Windows]
|
||||
|
||||
you --> relay --> brain
|
||||
brain --> model
|
||||
brain --> ask
|
||||
ask --> box
|
||||
ask --> hands
|
||||
```
|
||||
|
||||
1. You send a message on the desktop or the phone. The phone does not think on its own. It is looking at the brain's copy of the chat.
|
||||
2. The brain sends that message, the bot's instructions, and the tools it may use, to your model.
|
||||
3. If the model only needs to answer, the reply comes back. If it wants to read a file, open a page, or click, it proposes one action.
|
||||
4. AnyBot's own rules decide, not the model. Ordinary actions ask you. Send, pay, and delete always ask.
|
||||
5. After you allow it, the action runs on the computer you named: the bot's sealed desktop, the machine you are using, or a paired hands machine.
|
||||
6. The result returns to the chat. Phone and laptop see the same thread, because both are watching the brain.
|
||||
|
||||
Three programs. No database server.
|
||||
|
||||
| Program | What it is |
|
||||
|---|---|
|
||||
| `anybot` | The window, the background process (`anybot --serve`), and terminal setup (`anybot setup`) are one file |
|
||||
| `anybot-relay` | The account server. Computers connect out to it, so you do not open a port at home |
|
||||
| Phone page | One file, built into the program. A browser pointed at your URL is the app |
|
||||
|
||||
State is a few JSON files, written to a temp file and renamed, so a crash cannot leave a half-written save. macOS: `~/Library/Application Support/AnyBot/`. Linux: `~/.local/share/AnyBot/`. Windows: `%APPDATA%\AnyBot\`.
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
Pick one row, paste it into a terminal. The script installs what's needed (system packages, Rust, Docker).
|
||||
In a terminal it asks what you want, then walks through the first key or the first pairing. You do not have to understand the flags.
|
||||
|
||||
| I want… | On which machine | Command |
|
||||
| I want… | On | Paste |
|
||||
|---|---|---|
|
||||
| **Desktop app** | macOS, Linux with a screen | `curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \| sh` |
|
||||
| **Account server** (+ brain + HTTPS) | A Linux host with a domain | `curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \| sh -s -- server` |
|
||||
| **Add a computer as hands** | Any Linux (headless fine) | In AnyBot press “Add a computer”, paste the one-liner it shows |
|
||||
| Desktop app | Mac, or Linux with a screen | `curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \| sh -s -- app` |
|
||||
| Desktop app | Windows 10/11 | `irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 \| iex` |
|
||||
| Account server and brain | Any Linux with Docker | `curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \| sh -s -- server` |
|
||||
| Another computer as hands | Mac, Linux (headless is fine), signed-in Windows | In the app, “Add a computer”, paste the line it shows |
|
||||
|
||||
First run compiles on your machine (5–15 min); later updates take 1–2 min. Read the script first: [install.sh](install.sh). It installs into your user folders — no root.
|
||||
Linux is not Ubuntu-only. The script knows apt, dnf, yum, pacman, zypper, apk, and xbps.
|
||||
|
||||
## Getting started
|
||||
|
||||
**One computer:** install the desktop app → Settings › Models → paste an API key → chat.
|
||||
|
||||
**Phone + several computers:** run the server once (asks only for URL, account, password; gets HTTPS by itself), open the URL on your phone and “Add to Home Screen”, then pair other computers with one-time pairing codes. Any Linux box can become the bot's own computer, running inside Docker (optionally gVisor). A Mac can be the brain instead of a server ([docs/multi-device.md](docs/multi-device.md), method B). No database to run: state is a handful of JSON files, crash-safe writes; back up two Docker volumes.
|
||||
|
||||
## Updates, removal
|
||||
|
||||
| What | Command |
|
||||
| Later | |
|
||||
|---|---|
|
||||
| Update app / hands | re-run the install line |
|
||||
| Update server | on the server: `cd ~/AnyBot && make server` → “keep settings, update, restart” |
|
||||
| Uninstall the program | `cd ~/AnyBot && make uninstall` (your bots and chats are kept) |
|
||||
| Stop a hands machine | `systemctl --user disable --now anybot` |
|
||||
| Update the app or a hands machine | Paste the install line again |
|
||||
| Update the server | On the server, `cd ~/AnyBot && make server`, keep the current settings |
|
||||
| Remove the program | `cd ~/AnyBot && make uninstall` (bots and chats stay) |
|
||||
| Install failed | `cd ~/AnyBot && make doctor`, then [docs/install.md](docs/install.md) ([English](docs/en/install.md)) |
|
||||
|
||||
## Troubleshooting
|
||||
Scripts and other agents, with no questions: [install/AGENT.md](install/AGENT.md). Start with `sh install.sh --print`.
|
||||
|
||||
```sh
|
||||
cd ~/AnyBot && make doctor
|
||||
```
|
||||
---
|
||||
|
||||
It tells you what's missing. Common: `Killed`/`signal: 9` while compiling → add 2 GB swap; `requires rustc 1.95` → `rustup update stable`; Mac says “cannot verify developer” → right-click › Open once; phone says “brain offline” → the brain machine is asleep ([docs/multi-device.md](docs/multi-device.md)).
|
||||
## Which document
|
||||
|
||||
## Build from source
|
||||
The Chinese `docs/` files are the ones that stay current. `docs/en/` is a short English copy of each.
|
||||
|
||||
| You want… | Read |
|
||||
|---|---|
|
||||
| To chat on one computer | “One computer is enough” above |
|
||||
| Phone, brain, hands, “brain offline” | [docs/multi-device.md](docs/multi-device.md) ([en](docs/en/multi-device.md)) |
|
||||
| A platform that will not install | [docs/install.md](docs/install.md) ([en](docs/en/install.md)) |
|
||||
| Layers, files, where a turn lives | [docs/architecture.md](docs/architecture.md) ([en](docs/en/architecture.md)) |
|
||||
| The account-server wire format | [docs/protocol.md](docs/protocol.md) ([en](docs/en/protocol.md)) |
|
||||
| Trust boundary and where keys sit | [SECURITY.md](SECURITY.md) ([en](docs/en/security.md)) |
|
||||
| Every feature, as a list | [FEATURES.md](FEATURES.md) (Chinese) |
|
||||
| Release builds | [docs/release.md](docs/release.md) |
|
||||
|
||||
From source:
|
||||
|
||||
```sh
|
||||
git clone https://code.30cm.net/daniel.w/AnyBot.git
|
||||
cd AnyBot
|
||||
make deps && make && make install # deps: system packages + Rust 1.95+ (one time)
|
||||
make deps && make && make install
|
||||
```
|
||||
|
||||
`make run` · `make test` · `make doctor` · `make serve` (headless) · `make setup` (pair this machine) · `make server` · `make dist` · `make help`. Needs: Rust ≥1.95, a C compiler, git; on Linux also `pkg-config` + `libasound2-dev` (deps installs all).
|
||||
`make run` opens it without installing. `make test` runs tests. `make help` lists the rest.
|
||||
|
||||
## Deployment
|
||||
### If you are comparing it to other projects
|
||||
|
||||
| Method | For | Notes |
|
||||
|---|---|---|
|
||||
| **Docker Compose** (default) | server | `install.sh server`: relay + brain + Caddy (auto-HTTPS) containers; data in Docker volumes; Tailscale URLs skip Caddy ([compose file](deploy/server/docker-compose.yml)) |
|
||||
| Unattended | servers, Ansible | `ANYBOT_SETUP_USER=… ANYBOT_SETUP_PASSWORD=… [ANYBOT_SETUP_DOMAIN=…] sh install.sh server` |
|
||||
| Portainer/Coolify/Dokploy | existing PaaS | they take the standard `deploy/server/docker-compose.yml` — set `ANYBOT_USER`, `ANYBOT_PASSWORD`, `ANYBOT_RELAY_PUBLIC_URL` |
|
||||
| **systemd** user service | hands, headless brains | `anybot setup` installs `anybot.service`; `loginctl enable-linger` to keep it running logged-out |
|
||||
| **launchd** | Mac as brain/relay | see [docs/multi-device.md](docs/multi-device.md) |
|
||||
| Gitea Actions | release builds on `v*` tags | see [docs/release.md](docs/release.md) |
|
||||
| | AnyBot | OpenClaw | OpenHands | Khoj | UI-TARS-Desktop |
|
||||
|---|---|---|---|---|---|
|
||||
| What it is | A personal bot across your machines | An agent gateway on your hardware | A coding agent in sandboxes | A personal knowledge assistant | A GUI agent on one desktop |
|
||||
| Your real screen, with a person in the loop | Yes. It asks, and you can take the screen | Via plugins | Sandbox, not your desktop | — | Yes. That is the product |
|
||||
| Phone and several computers | Built in. No port opened at home | You assemble it | — | Server and apps | One machine |
|
||||
| The bot's own sealed computer | Docker, optional gVisor | Host shell | Yes | — | — |
|
||||
| Secrets stay out of the model | The app fills the form | — | — | — | — |
|
||||
| License | Apache-2.0 | MIT | MIT | AGPL-3.0 | Apache-2.0 |
|
||||
|
||||
## Security in one paragraph
|
||||
The bet: a bot that can touch your machines is only trustworthy if the program, not the model, owns the gates.
|
||||
|
||||
Commands run in a macOS sandbox (deny ~/.aws, Keychain, AnyBot's own data; allow only the attachments dir); per-action approvals with a policy layer the model cannot negotiate; clicking anything labelled “send/pay/transfer” is asked *every time*, even in direct mode, with no grant that silences it; card numbers and OTPs in screenshots are painted black before the model sees them; everything read from outside is wrapped as `<untrusted>` data, never treated as orders; the bot's own computer is a Docker container (gVisor for a second wall); relay stores only hashes (argon2id) and supports 2FA with recovery codes; egress binds loopback + detected bridge gateways, never 0.0.0.0. Details: [SECURITY.md](SECURITY.md) ([summary here](docs/en/security.md)) and [docs/architecture.md](docs/architecture.md) (Chinese; [English summary](docs/en/architecture.md)).
|
||||
---
|
||||
|
||||
## Documentation
|
||||
## Security
|
||||
|
||||
| Doc | Contents |
|
||||
|---|---|
|
||||
| [docs/install.md](docs/install.md) ([en](docs/en/install.md)) | per-platform details, manual steps, FAQ |
|
||||
| [docs/multi-device.md](docs/multi-device.md) ([en](docs/en/multi-device.md)) | brain / hands / screen: setup, pairing, offline |
|
||||
| [docs/architecture.md](docs/architecture.md) ([en](docs/en/architecture.md)) | layers, data storage, security design |
|
||||
| [docs/protocol.md](docs/protocol.md) ([en](docs/en/protocol.md)) | relay API and long-connection wire format |
|
||||
| [docs/release.md](docs/release.md) | packaging, CI |
|
||||
| [FEATURES.md](FEATURES.md) | every feature (Chinese) |
|
||||
The bot runs on your machines. It asks before it uses them. Text that arrived from a page or a screenshot is data, not orders. Card numbers and one-time codes are painted out of screenshots before a model sees them. Limits and where keys live: [SECURITY.md](SECURITY.md) ([summary](docs/en/security.md)).
|
||||
|
||||
Report a vulnerability through the repo's security advisory, not a public issue.
|
||||
|
||||
## License
|
||||
|
||||
Apache License 2.0 — see [LICENSE](LICENSE). Copyright the contributors (The AnyBot contributors). Calls to third-party services (xAI, OpenAI, …) go through their public APIs; follow each service's terms and your own key agreements.
|
||||
|
||||
## Repository layout
|
||||
|
||||
```
|
||||
install.sh one-line installer (app, hands, server)
|
||||
src/ AnyBot: desktop app, headless, `anybot setup`
|
||||
relay/ account server
|
||||
mobile/ phone web app (single file, embedded)
|
||||
box/ the bot's own computer (Docker container)
|
||||
deploy/ per-platform install & deployment files
|
||||
docs/ technical docs (docs/en/ = English)
|
||||
bench/ computer-use benchmark (tasks, scoring, red-team suite)
|
||||
```
|
||||
[Apache License 2.0](LICENSE). Calls to xAI, OpenAI, and the others go through those companies' public APIs. Follow their terms and your key agreement.
|
||||
|
|
|
|||
240
README.md
240
README.md
|
|
@ -2,177 +2,195 @@
|
|||
|
||||
中文 · [English →](README.en.md)
|
||||
|
||||
你自己的 AI Bot。可以聊天,也能幫你動手做事:處理檔案、執行指令、操作瀏覽器和螢幕、跑例行任務。
|
||||
你自己的 AI 助理。可以聊天,也能幫你做事:整理檔案、跑指令、看網頁、操作螢幕、到點提醒你。
|
||||
|
||||
- 每個 Bot 可以用不同的 AI:xAI Grok、OpenAI、Claude、Gemini、OpenRouter、OpenCode Go、Ollama(本機),或任何 OpenAI 相容的服務
|
||||
- 桌面 App(macOS、Linux)+手機網頁版(可加到主畫面、收通知)
|
||||
- 多台電腦一起用:一台當**大腦**,其他電腦當它的**手腳**
|
||||
它跑在**你的電腦**上。模型用你自己的金鑰(或你家裡的 Ollama)。聊天、檔案、密碼不會先送到別人的帳號伺服器。
|
||||
|
||||
<p>
|
||||
<img src="shots/readme/chat.png" alt="左邊是不同的 Bot,右邊是跟其中一個聊天" width="780">
|
||||
</p>
|
||||
|
||||
左邊每一個都是一個 Bot。研究、寫作、管電腦,可以各用各的 AI。
|
||||
|
||||
---
|
||||
|
||||
## 安裝
|
||||
## 它會先問你,再動手
|
||||
|
||||
先決定你要裝哪一種,複製那一行到終端機執行就好。需要的東西(系統套件、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 按「加一台電腦」,貼上它給你的那一行 |
|
||||
<p>
|
||||
<img src="shots/readme/ask.png" alt="Bot 要在你的電腦上執行指令前,先跳出允許一次、一律允許或拒絕" width="780">
|
||||
</p>
|
||||
|
||||
> 想先看腳本做什麼:[install.sh](install.sh)。它只會裝 AnyBot 需要的套件,程式裝在你的使用者資料夾(不用 root),原始碼放在 `~/AnyBot`。
|
||||
手機是同一個聊天。瀏覽器打開你的網址、登入,就能在外面看它做到哪,必要時自己接手畫面。
|
||||
|
||||
**第一次要多久?** 腳本會在你的電腦上編譯,第一次大約 5–15 分鐘(看電腦快慢),之後更新只要 1–2 分鐘。
|
||||
<p>
|
||||
<img src="shots/readme/phone.png" alt="手機瀏覽器打開你的網址,先登入" width="280">
|
||||
</p>
|
||||
|
||||
## 你可以用它做什麼
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| 聊天、改稿、查資料 | 每個 Bot 一句話說明它是誰,模型可以各自不同 |
|
||||
| 整理檔案、跑指令 | 做之前先問你。也可以只讓它用「它自己的電腦」(一個跟你分開的小桌面) |
|
||||
| 看網頁、填表 | 用它自己的瀏覽器。密碼、卡號由程式直接填,不會先念給模型聽 |
|
||||
| 操作你正在用的畫面 | 看截圖上的按鈕再點。點不到、或是要你登入時,會把畫面交給你 |
|
||||
| 到點自己做 | 例如每個工作日早上整理三則新聞 |
|
||||
|
||||
<p>
|
||||
<img src="shots/readme/routines.png" alt="跟 Bot 說每個工作日早上九點整理新聞,它就排好例行任務" width="780">
|
||||
</p>
|
||||
|
||||
模型可以是 xAI、OpenAI、Claude、Gemini、OpenRouter、OpenCode Go、你電腦上的 Ollama,或任何講 OpenAI 那套介面的服務。
|
||||
|
||||
---
|
||||
|
||||
## 開始使用
|
||||
## 只用一台電腦
|
||||
|
||||
### 只用一台電腦
|
||||
給不想管伺服器的人。裝好、貼上金鑰、開始聊。
|
||||
|
||||
1. 裝好桌面 App,打開。
|
||||
2. 設定 › 模型,貼上你的 API 金鑰(例如 xAI、OpenAI)。
|
||||
3. 開始聊天。
|
||||
1. 打開終端機,貼下面「桌面 App」那一行。它會問你要裝哪一種,選桌面。
|
||||
2. 打開 AnyBot。Mac 第一次要對圖示按右鍵 › 打開。
|
||||
3. 設定 › 模型,貼上你的 API 金鑰。沒有金鑰也可以選 Ollama,在你自己的電腦上跑。
|
||||
4. 建立一個 Bot,跟它說話。
|
||||
|
||||
### 手機和多台電腦一起用
|
||||
第一次編譯大約 5–15 分鐘,之後更新 1–2 分鐘。程式裝在你的使用者資料夾,不需要系統管理員。
|
||||
|
||||
---
|
||||
|
||||
## 手機、還有別的電腦
|
||||
|
||||
一台負責想和記(**大腦**),其他電腦負責被操作(**手腳**),手機只是一個視窗。它們都連到你自己的**帳號伺服器**,所以家裡的電腦不用開連接埠、也不用固定 IP。
|
||||
|
||||
```
|
||||
手機(網頁) 筆電(螢幕) 沒螢幕的 Linux(手腳)
|
||||
你在手機上說話 你在筆電上說話 沒螢幕的電腦也行
|
||||
\ | /
|
||||
└──────── 帳號伺服器(每台都連過來)─────────┘
|
||||
└──────── 帳號伺服器(只負責把大家接起來)────────┘
|
||||
|
|
||||
大腦:Bot、聊天、記憶、例行任務都在這裡
|
||||
大腦:Bot、聊天、記憶、例行任務在這裡
|
||||
|
|
||||
手腳:大腦叫它看畫面、點擊、讀檔、開瀏覽器
|
||||
```
|
||||
|
||||
**步驟 1:架伺服器**(只做一次)
|
||||
| 角色 | 用人話說 | 你要做的 |
|
||||
|---|---|---|
|
||||
| 大腦 | 記著所有 Bot 和聊天,負責想、負責排程。要一直開著 | 架一次伺服器,或先用一台常開的 Mac |
|
||||
| 螢幕 | 你坐在前面的那台。看到的就是大腦裡的 Bot,同時也能被操作 | 桌面 App 登入同一個帳號 |
|
||||
| 手腳 | 給 Bot 用的電腦。有沒有螢幕都行 | 在 AnyBot 按「加一台電腦」,把那一行貼過去 |
|
||||
| 手機 | 跟桌面同一個聊天 | 瀏覽器打開你的網址,加入主畫面 |
|
||||
|
||||
需要:一台 Linux 主機(2 GB 以上記憶體),加上一個網域(A 紀錄指到這台、80 和 443 埠打開)或 Tailscale(不用網域,只有你的裝置連得到)。
|
||||
**只做一次的那台伺服器**要一台 Linux(2 GB 記憶體以上),加上網域,或用 Tailscale(沒有網域也行,只有你的裝置連得到)。
|
||||
|
||||
```sh
|
||||
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- server
|
||||
```
|
||||
|
||||
只會問三件事:**網址(網域或 Tailscale)、帳號、密碼**。它會自動裝 Docker、申請 HTTPS 憑證、建立帳號、啟動大腦。完成畫面會告訴你網址。
|
||||
它只問三件事:網址、帳號、密碼。Docker 和 HTTPS 它自己處理。
|
||||
|
||||
> 沒有伺服器?也可以先拿一台 Mac 當大腦,見 [docs/multi-device.md](docs/multi-device.md)(做法 B)。
|
||||
沒有伺服器也可以先拿一台 Mac 當大腦,見 [docs/multi-device.md](docs/multi-device.md) 的做法 B。
|
||||
|
||||
**步驟 2:手機**:用瀏覽器打開你的網址並登入,再「加入主畫面」。
|
||||
---
|
||||
|
||||
**步驟 3:其他電腦**
|
||||
## 整套是怎麼跑的
|
||||
|
||||
- **有螢幕的電腦**:裝好桌面 App,到 設定 › 一般 › 手機與帳號 登入,在「大腦」那一欄選伺服器。
|
||||
- **沒螢幕的 Linux**:在手機 AnyBot 右上角按「⋯ › 加一台電腦」(或在電腦的 設定 › 一般 › 手機與帳號),會出現一行像這樣的指令:
|
||||
給想知道「一句話進去之後發生什麼」的人。實作細節在 [docs/architecture.md](docs/architecture.md)。
|
||||
|
||||
```sh
|
||||
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- hands https://你的網域 482913
|
||||
```mermaid
|
||||
flowchart TD
|
||||
you[你:桌面 App 或手機]
|
||||
relay[帳號伺服器<br/>只轉送,不保存聊天]
|
||||
brain[大腦上的 AnyBot]
|
||||
model[你選的模型]
|
||||
ask[要動電腦?先問你]
|
||||
box[Bot 自己的電腦<br/>Docker 裡的小桌面]
|
||||
hands[某一台手腳<br/>你的 Mac、Linux 或 Windows]
|
||||
|
||||
you --> relay --> brain
|
||||
brain --> model
|
||||
brain --> ask
|
||||
ask --> box
|
||||
ask --> hands
|
||||
```
|
||||
|
||||
貼到那台電腦執行,就會自動裝好、接上大腦,之後開機也會自動執行。不用帳號密碼,這組碼 10 分鐘內有效、只能用一次。
|
||||
一句話從你嘴裡出去,到事情做完,順序是:
|
||||
|
||||
---
|
||||
1. 你在桌面或手機送出訊息。手機不自己想,它看的是大腦上的同一份聊天。
|
||||
2. 大腦把這句話、這個 Bot 的指示、以及它能用的工具,交給你選的模型。
|
||||
3. 模型如果只要回答,就直接寫回來。如果要讀檔、開網頁、點畫面,就提出一個動作。
|
||||
4. 這個動作先過 AnyBot 自己的規則,不讓模型決定能不能做。平常會問你;寄出、付款、刪除每次都問。
|
||||
5. 你允許之後,動作在**你指定的那台電腦**上做:Bot 自己的隔離桌面、你正在用的這台,或一台配對過的手腳。
|
||||
6. 結果回到聊天。手機、筆電看到的是同一份,因為都在看大腦。
|
||||
|
||||
## 更新和移除
|
||||
三支程式就夠了,沒有資料庫伺服器:
|
||||
|
||||
| 要做什麼 | 指令 |
|
||||
| 程式 | 是什麼 |
|
||||
|---|---|
|
||||
| 更新桌面 App 或手腳 | 再執行一次安裝的那一行 |
|
||||
| 更新伺服器 | 在伺服器上 `cd ~/AnyBot && make server`,選「用現有設定,更新並重新啟動」 |
|
||||
| 移除程式 | `cd ~/AnyBot && make uninstall`(你的 Bot 和聊天會留著) |
|
||||
| 停掉手腳 | `systemctl --user disable --now anybot` |
|
||||
| `anybot` | 桌面、背景(`anybot --serve`)、終端機設定(`anybot setup`)都是這一個檔案 |
|
||||
| `anybot-relay` | 帳號伺服器。電腦主動連過去,所以不用在家裡開埠 |
|
||||
| 手機網頁 | 一個檔案,做在程式裡。瀏覽器打開你的網址就是 |
|
||||
|
||||
資料是幾個 JSON 檔,寫的時候先寫暫存再改名,不會寫一半。在 macOS 是 `~/Library/Application Support/AnyBot/`,Linux 是 `~/.local/share/AnyBot/`,Windows 是 `%APPDATA%\AnyBot\`。
|
||||
|
||||
---
|
||||
|
||||
## 出問題時
|
||||
## 安裝
|
||||
|
||||
先執行這個,它會告訴你缺什麼:
|
||||
有終端機會先問你要裝哪一種,並引導第一次設定。看不懂後面的參數沒關係,選單會說人話。
|
||||
|
||||
```sh
|
||||
cd ~/AnyBot && make doctor
|
||||
```
|
||||
| 我要… | 在哪台 | 貼這一行 |
|
||||
|---|---|---|
|
||||
| 桌面 App | Mac,或有螢幕的 Linux | `curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \| sh -s -- app` |
|
||||
| 桌面 App | Windows 10/11 | `irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 \| iex` |
|
||||
| 帳號伺服器+大腦 | 任何有 Docker 的 Linux | `curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \| sh -s -- server` |
|
||||
| 加一台手腳 | Mac、Linux(沒螢幕也行)、已登入的 Windows | App 裡按「加一台電腦」,貼它給的那一行 |
|
||||
|
||||
| 看到 | 怎麼辦 |
|
||||
Linux 不限 Ubuntu。腳本認得 apt、dnf、yum、pacman、zypper、apk、xbps。
|
||||
|
||||
| 之後 | |
|
||||
|---|---|
|
||||
| 編譯到一半被中斷、`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](docs/multi-device.md) 的「連不上時」 |
|
||||
| 更新桌面或手腳 | 再貼一次安裝那一行 |
|
||||
| 更新伺服器 | 在伺服器上 `cd ~/AnyBot && make server`,選用現有設定 |
|
||||
| 移除程式 | `cd ~/AnyBot && make uninstall`(Bot 和聊天還在) |
|
||||
| 裝失敗 | `cd ~/AnyBot && make doctor`,對照 [docs/install.md](docs/install.md) |
|
||||
|
||||
還是不行:把 `make doctor` 的結果和錯誤訊息的最後幾行貼給維護的人。
|
||||
給腳本、Ansible 或別的代理程式、不要出現問句:見 [install/AGENT.md](install/AGENT.md)。先 `sh install.sh --print` 看這台適不適合。
|
||||
|
||||
---
|
||||
|
||||
## 自己從原始碼建置
|
||||
## 文件怎麼看
|
||||
|
||||
適合想改程式的人。一般使用請用上面的一行安裝。
|
||||
產品說明以這份 README 和中文 `docs/` 為準。`docs/en/` 是給不讀中文的人的摘要。
|
||||
|
||||
| 你想… | 看 |
|
||||
|---|---|
|
||||
| 裝好、開始聊 | 上面「只用一台電腦」 |
|
||||
| 手機、大腦、手腳、連不上 | [docs/multi-device.md](docs/multi-device.md) |
|
||||
| 某個平台裝失敗、要自己編譯 | [docs/install.md](docs/install.md) |
|
||||
| 一句話進去之後,程式怎麼分層 | [docs/architecture.md](docs/architecture.md) |
|
||||
| 帳號伺服器的介面 | [docs/protocol.md](docs/protocol.md) |
|
||||
| 信任邊界、金鑰放哪 | [SECURITY.md](SECURITY.md) |
|
||||
| 功能一條條清單 | [FEATURES.md](FEATURES.md) |
|
||||
| 打包、自動建置 | [docs/release.md](docs/release.md) |
|
||||
|
||||
自己改程式:
|
||||
|
||||
```sh
|
||||
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 deps && make && make install
|
||||
```
|
||||
|
||||
| 指令 | 做什麼 |
|
||||
|---|---|
|
||||
| `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](docs/install.md)。
|
||||
`make run` 直接打開,`make test` 跑測試,`make help` 看全部。
|
||||
|
||||
---
|
||||
|
||||
## 部署方式
|
||||
|
||||
| 方式 | 用在 | 說明 |
|
||||
|---|---|---|
|
||||
| **Docker Compose**(預設) | 伺服器 | `install.sh server` 用的就是它:帳號伺服器、大腦、Caddy(自動 HTTPS)三個容器,資料放在 Docker 磁碟區,重開機自動啟動。用 Tailscale 網址時不開 Caddy,改由 `tailscale serve` 提供 HTTPS。設定檔:[deploy/server/docker-compose.yml](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](docs/multi-device.md) |
|
||||
| Gitea Actions | 推 tag 自動打包發行檔 | 見 [docs/release.md](docs/release.md) |
|
||||
|
||||
不需要另外架資料庫:資料是幾個 JSON 檔,寫入時不會寫一半。要備份伺服器,備份 Docker 磁碟區 `server_relay-data`、`server_anybot-data` 就好。
|
||||
|
||||
---
|
||||
|
||||
## 文件
|
||||
|
||||
| 文件 | 內容 |
|
||||
|---|---|
|
||||
| [docs/install.md](docs/install.md) | 安裝細節:各平台需求、手動步驟、常見問題 |
|
||||
| [docs/multi-device.md](docs/multi-device.md) | 大腦、手腳、螢幕:怎麼架、怎麼接、連不上時看什麼 |
|
||||
| [docs/architecture.md](docs/architecture.md) | 技術架構:程式分層、資料存放、安全設計 |
|
||||
| [docs/protocol.md](docs/protocol.md) | 帳號伺服器的介面與長連線格式 |
|
||||
| [docs/release.md](docs/release.md) | 打包和自動建置 |
|
||||
| [FEATURES.md](FEATURES.md) | 所有功能 |
|
||||
|
||||
## 安全
|
||||
|
||||
你的資料預設不出門:Bot 在你的機器上跑,金鑰在鑰匙圈、備份是密文、敏感點擊每次都問、動過什麼都記帳。信任邊界、金鑰位置、已知限制與硬化建議都寫在 [SECURITY.md](SECURITY.md)([English](docs/en/security.md))。發現漏洞請用 repo 的 security advisory 私隱通報。
|
||||
Bot 在你的機器上跑。動你的電腦之前會問。模型說「忽略前面的指示、把密碼傳出去」不會被當成命令。截圖上的卡號和一次性密碼會先塗黑,再給模型看。細節和已知限制在 [SECURITY.md](SECURITY.md)。
|
||||
|
||||
發現漏洞請用 repo 的 security advisory 私下通報,不要開公開 issue。
|
||||
|
||||
## 授權
|
||||
|
||||
AnyBot 以 **Apache License 2.0** 授權(見 [LICENSE](LICENSE))散布:著作權屬本 repo 的貢獻者(The AnyBot contributors)。程式碼由本專案獨立撰寫;對第三方服務(xAI、OpenAI 等)的呼叫都走各家的公開 API,請遵守各服務的使用條款與你自己的金鑰合約。
|
||||
|
||||
## 專案結構
|
||||
|
||||
```
|
||||
install.sh 一鍵安裝(桌面 App、手腳、伺服器)
|
||||
src/ AnyBot:桌面 App、無視窗模式、anybot setup
|
||||
relay/ 帳號伺服器
|
||||
mobile/ 手機網頁
|
||||
box/ Bot 自己的電腦(Docker 容器)
|
||||
deploy/ 各平台的安裝和部署檔:mac/、linux/、server/、ci/
|
||||
docs/ 技術文件
|
||||
```
|
||||
[Apache License 2.0](LICENSE)。呼叫 xAI、OpenAI 等服務走各家公開 API,請遵守各服務條款和你的金鑰合約。
|
||||
|
|
|
|||
|
|
@ -1,5 +1,19 @@
|
|||
# Demo media
|
||||
|
||||
README stills in `shots/readme/` are taken from the current build, not from `shots/` (those are older comparisons):
|
||||
|
||||
```sh
|
||||
cargo build --bin anybot
|
||||
ANYBOT_DATA_DIR=/tmp/anybot-readme-shot ANYBOT_SHOT_SIZE=1180x740 ANYBOT_SHOT_FRAMES=48 \
|
||||
ANYBOT_SHOT_VIEW=chat ANYBOT_SHOT_NOPOPUP=1 target/debug/anybot --screenshot shots/readme/chat.png
|
||||
ANYBOT_DATA_DIR=/tmp/anybot-readme-shot ANYBOT_SHOT_SIZE=1180x740 ANYBOT_SHOT_FRAMES=48 \
|
||||
ANYBOT_SHOT_VIEW=chat target/debug/anybot --screenshot shots/readme/ask.png
|
||||
ANYBOT_DATA_DIR=/tmp/anybot-readme-shot ANYBOT_SHOT_SIZE=1180x740 ANYBOT_SHOT_FRAMES=48 \
|
||||
ANYBOT_SHOT_VIEW=routines ANYBOT_SHOT_NOPOPUP=1 target/debug/anybot --screenshot shots/readme/routines.png
|
||||
```
|
||||
|
||||
`shots/readme/phone.png` is the current `mobile/index.html` sign-in page, captured in a 390×844 browser. It is not the old collage in `shots/phone.png`.
|
||||
|
||||
The README shows a demo here. To record one:
|
||||
|
||||
1. Start AnyBot (desktop) and a bot with a key; run at 1440p, hide notifications.
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 203 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 160 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
Loading…
Reference in New Issue