Files
openclaw/README.md

241 lines
9.6 KiB
Markdown
Raw Normal View History

2025-12-19 18:41:17 +01:00
# 🦞 CLAWDIS — Personal AI Assistant
2025-11-25 14:29:21 +01:00
<p align="center">
2025-12-21 01:51:47 +01:00
<img src="https://raw.githubusercontent.com/steipete/clawdis/main/docs/whatsapp-clawd.jpg" alt="CLAWDIS" width="400">
</p>
<p align="center">
<strong>EXFOLIATE! EXFOLIATE!</strong>
2025-11-25 14:29:21 +01:00
</p>
<p align="center">
2025-12-09 18:00:01 +00:00
<a href="https://github.com/steipete/clawdis/actions/workflows/ci.yml?branch=main"><img src="https://img.shields.io/github/actions/workflow/status/steipete/clawdis/ci.yml?branch=main&style=for-the-badge" alt="CI status"></a>
<a href="https://github.com/steipete/clawdis/releases"><img src="https://img.shields.io/github/v/release/steipete/clawdis?include_prereleases&style=for-the-badge" alt="GitHub release"></a>
2026-01-01 21:22:00 +01:00
<a href="https://discord.gg/qkhbAGHRBT"><img src="https://img.shields.io/discord/1456350064065904867?label=Discord&logo=discord&logoColor=white&color=5865F2&style=for-the-badge" alt="Discord"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" alt="MIT License"></a>
</p>
2025-12-19 18:41:17 +01:00
**Clawdis** is a *personal AI assistant* you run on your own devices.
2026-01-02 01:19:22 +01:00
It answers you on the surfaces you already use (WhatsApp, Telegram, Discord, iMessage, WebChat), can speak and listen on macOS/iOS, and can render a live Canvas you control. The Gateway is just the control plane — the product is the assistant.
2025-12-19 18:41:17 +01:00
If you want a private, single-user assistant that feels local, fast, and always-on, this is it.
2026-01-02 20:58:50 +01:00
Website: https://clawd.me · Docs: [`docs/index.md`](docs/index.md) · FAQ: [`docs/faq.md`](docs/faq.md) · Wizard: [`docs/wizard.md`](docs/wizard.md) · Docker (optional): [`docs/docker.md`](docs/docker.md) · Discord: https://discord.gg/qkhbAGHRBT
2026-01-01 21:09:24 +01:00
Preferred setup: run the onboarding wizard (`clawdis onboard`). It walks through gateway, workspace, providers, and skills. The CLI wizard is the recommended path and works on **macOS, Windows, and Linux**.
2026-01-01 20:19:00 +01:00
2025-12-31 11:35:42 +01:00
Using Claude Pro/Max subscription? See `docs/onboarding.md` for the Anthropic OAuth setup.
```
2025-12-19 18:41:17 +01:00
Your surfaces
┌───────────────────────────────┐
│ Gateway │ ws://127.0.0.1:18789
│ (control plane) │ tcp://0.0.0.0:18790 (optional Bridge)
└──────────────┬────────────────┘
├─ Pi agent (RPC)
├─ CLI (clawdis …)
├─ WebChat (browser)
├─ macOS app (Clawdis.app)
└─ iOS node (Canvas + voice)
```
2025-12-19 18:41:17 +01:00
## What Clawdis does
2025-12-19 18:41:17 +01:00
- **Personal assistant** — one user, one identity, one memory surface.
2026-01-02 01:19:22 +01:00
- **Multi-surface inbox** — WhatsApp, Telegram, Discord, iMessage, WebChat, macOS, iOS. Signal support via `signal-cli` (see `docs/signal.md`). iMessage uses `imsg` (see `docs/imessage.md`).
2025-12-19 18:41:17 +01:00
- **Voice wake + push-to-talk** — local speech recognition on macOS/iOS.
- **Canvas** — a live visual workspace you can drive from the agent.
- **Automation-ready** — browser control, media handling, and tool streaming.
- **Local-first control plane** — the Gateway owns state, everything else connects.
2025-12-22 20:36:34 +01:00
- **Group chats** — mention-based by default, `/activation always|mention` per group (owner-only).
2026-01-01 09:17:24 +01:00
- **Nix mode** — opt-in declarative config + read-only UI when `CLAWDIS_NIX_MODE=1`.
2025-12-19 18:41:17 +01:00
## How it works (short)
2025-12-19 18:41:17 +01:00
- **Gateway** is the single source of truth for sessions/providers.
- **Loopback-first**: `ws://127.0.0.1:18789` by default.
- **Bridge** (optional) exposes a paired-node port for iOS/Android.
- **Agent runtime** is **Pi** in RPC mode.
2025-12-19 18:41:17 +01:00
## Quick start (from source)
2025-12-19 18:41:17 +01:00
Runtime: **Node ≥22** + **pnpm**.
```bash
pnpm install
pnpm build
2025-12-18 22:40:46 +00:00
pnpm ui:build
2026-01-01 21:09:24 +01:00
# Recommended: run the onboarding wizard
pnpm clawdis onboard
2025-12-19 18:41:17 +01:00
# Link WhatsApp (stores creds in ~/.clawdis/credentials)
pnpm clawdis login
2025-12-19 18:41:17 +01:00
# Start the gateway
pnpm clawdis gateway --port 18789 --verbose
2025-12-25 18:44:23 +00:00
# Dev loop (auto-reload on TS changes)
pnpm gateway:watch
2025-12-19 18:41:17 +01:00
# Send a message
pnpm clawdis send --to +1234567890 --message "Hello from Clawdis"
2025-12-18 22:40:46 +00:00
2025-12-15 10:11:18 -06:00
# Talk to the assistant (optionally deliver back to WhatsApp/Telegram/Discord)
pnpm clawdis agent --message "Ship checklist" --thinking high
```
2025-12-19 18:41:17 +01:00
If you run from source, prefer `pnpm clawdis …` (not global `clawdis`).
2025-12-19 03:38:11 +01:00
2025-12-22 20:36:34 +01:00
## Chat commands
Send these in WhatsApp/Telegram/WebChat (group commands are owner-only):
- `/status` — health + session info (group shows activation mode)
- `/new` or `/reset` — reset the session
- `/think <level>` — off|minimal|low|medium|high
- `/verbose on|off`
- `/restart` — restart the gateway (owner-only in groups)
- `/activation mention|always` — group activation toggle (groups only)
2025-12-19 18:41:17 +01:00
## Architecture
2025-12-19 03:38:11 +01:00
2025-12-19 18:41:17 +01:00
### TypeScript Gateway (src/gateway/server.ts)
- **Single HTTP+WS server** on `ws://127.0.0.1:18789` (bind policy: loopback/lan/tailnet/auto). The first frame must be `connect`; AJV validates frames against TypeBox schemas (`src/gateway/protocol`).
- **Single source of truth** for sessions, providers, cron, voice wake, and presence. Methods cover `send`, `agent`, `chat.*`, `sessions.*`, `config.*`, `cron.*`, `voicewake.*`, `node.*`, `system-*`, `wake`.
- **Events + snapshot**: handshake returns a snapshot (presence/health) and declares event types; runtime events include `agent`, `chat`, `presence`, `tick`, `health`, `heartbeat`, `cron`, `node.pair.*`, `voicewake.changed`, `shutdown`.
- **Idempotency & safety**: `send`/`agent`/`chat.send` require idempotency keys with a TTL cache (5 min, cap 1000) to avoid doublesends on reconnects; payload sizes are capped per connection.
- **Bridge for nodes**: optional TCP bridge (`src/infra/bridge/server.ts`) is newlinedelimited JSON frames (`hello`, pairing, RPC, `invoke`); node connect/disconnect is surfaced into presence.
- **Control UI + Canvas Host**: HTTP serves `/ui` assets (if built) and can host a livereload Canvas host for nodes (`src/canvas-host/server.ts`), injecting the A2UI postMessage bridge.
2025-12-19 03:38:11 +01:00
2025-12-19 18:41:17 +01:00
### iOS app (apps/ios)
- **Discovery + pairing**: Bonjour discovery via `BridgeDiscoveryModel` (NWBrowser). `BridgeConnectionController` autoconnects using Keychain token or allows manual host/port.
- **Node runtime**: `BridgeSession` (actor) maintains the `NWConnection`, hello handshake, ping/pong, RPC requests, and `invoke` callbacks.
- **Capabilities + commands**: advertises `canvas`, `screen`, `camera`, `voiceWake` (settingsdriven) and executes `canvas.*`, `canvas.a2ui.*`, `camera.*`, `screen.record` (`NodeAppModel.handleInvoke`).
- **Canvas**: `WKWebView` with bundled Canvas scaffold + A2UI, JS eval, snapshot capture, and `clawdis://` deeplink interception (`ScreenController`).
- **Voice + deep links**: voice wake sends `voice.transcript` events; `clawdis://agent` links emit `agent.request`. Voice wake triggers sync via `voicewake.get` + `voicewake.changed`.
2025-12-19 18:41:17 +01:00
## Companion apps
2025-12-19 18:41:17 +01:00
The **macOS app is critical**: it runs the menubar control plane, owns local permissions (TCC), hosts Voice Wake, exposes WebChat/debug tools, and coordinates local/remote gateway mode. Most “assistant” UX lives here.
2025-12-19 18:41:17 +01:00
### macOS (Clawdis.app)
2025-12-19 18:41:17 +01:00
- Menu bar control for the Gateway and health.
- Voice Wake + push-to-talk overlay.
- WebChat + debug tools.
- Remote gateway control over SSH.
2025-12-19 18:41:17 +01:00
Build/run: `./scripts/restart-mac.sh` (packages + launches).
2025-12-19 18:41:17 +01:00
### iOS node (internal)
2025-12-19 18:41:17 +01:00
- Pairs as a node via the Bridge.
- Voice trigger forwarding + Canvas surface.
- Controlled via `clawdis nodes …`.
2025-12-19 18:41:17 +01:00
Runbook: `docs/ios/connect.md`.
2025-12-19 18:41:17 +01:00
### Android node (internal)
2025-12-19 18:41:17 +01:00
- Pairs via the same Bridge + pairing flow as iOS.
- Exposes Canvas, Camera, and Screen capture commands.
- Runbook: `docs/android/connect.md`.
2025-12-19 18:41:17 +01:00
## Agent workspace + skills
2025-12-23 23:45:20 +00:00
- Workspace root: `~/clawd` (configurable via `agent.workspace`).
2025-12-19 18:41:17 +01:00
- Injected prompt files: `AGENTS.md`, `SOUL.md`, `TOOLS.md`.
- Skills: `~/clawd/skills/<skill>/SKILL.md`.
## Configuration
2025-12-19 18:41:17 +01:00
Minimal `~/.clawdis/clawdis.json`:
```json5
{
whatsapp: {
allowFrom: ["+1234567890"]
}
}
```
### WhatsApp
- Link the device: `pnpm clawdis login` (stores creds in `~/.clawdis/credentials`).
- Allowlist who can talk to the assistant via `whatsapp.allowFrom`.
### Telegram
- Set `TELEGRAM_BOT_TOKEN` or `telegram.botToken` (env wins).
- Optional: set `telegram.requireMention`, `telegram.allowFrom`, or `telegram.webhookUrl` as needed.
```json5
{
telegram: {
botToken: "123456:ABCDEF"
}
}
```
2025-12-15 10:11:18 -06:00
### Discord
- Set `DISCORD_BOT_TOKEN` or `discord.token` (env wins).
2026-01-02 13:33:52 +01:00
- Optional: set `discord.slashCommand`, `discord.dm.allowFrom`, `discord.guilds`, or `discord.mediaMaxMb` as needed.
2025-12-15 10:11:18 -06:00
```json5
{
discord: {
token: "1234abcd"
}
}
```
2025-12-19 18:41:17 +01:00
Browser control (optional):
```json5
{
browser: {
enabled: true,
controlUrl: "http://127.0.0.1:18791",
color: "#FF4500"
}
}
```
2025-12-19 18:41:17 +01:00
## Docs
2025-12-09 20:28:10 +00:00
2025-12-20 12:27:25 +01:00
- [`docs/index.md`](docs/index.md) (overview)
- [`docs/configuration.md`](docs/configuration.md)
2025-12-22 20:36:34 +01:00
- [`docs/group-messages.md`](docs/group-messages.md)
2025-12-20 12:27:25 +01:00
- [`docs/gateway.md`](docs/gateway.md)
- [`docs/web.md`](docs/web.md)
- [`docs/discovery.md`](docs/discovery.md)
- [`docs/agent.md`](docs/agent.md)
2025-12-15 10:11:18 -06:00
- [`docs/discord.md`](docs/discord.md)
2026-01-01 21:09:24 +01:00
- [`docs/wizard.md`](docs/wizard.md)
2025-12-24 20:07:18 +00:00
- Webhooks + external triggers: [`docs/webhook.md`](docs/webhook.md)
2025-12-24 22:59:09 +00:00
- Gmail hooks (email → wake): [`docs/gmail-pubsub.md`](docs/gmail-pubsub.md)
## Email hooks (Gmail)
```bash
clawdis hooks gmail setup --account you@gmail.com
clawdis hooks gmail run
```
2025-12-20 12:27:25 +01:00
- [`docs/security.md`](docs/security.md)
- [`docs/troubleshooting.md`](docs/troubleshooting.md)
- [`docs/ios/connect.md`](docs/ios/connect.md)
- [`docs/clawdis-mac.md`](docs/clawdis-mac.md)
2025-12-09 20:28:10 +00:00
2025-12-19 18:41:17 +01:00
## Clawd
2025-12-19 18:41:17 +01:00
Clawdis was built for **Clawd**, a space lobster AI assistant.
2025-12-19 18:41:17 +01:00
- https://clawd.me
- https://soul.md
- https://steipete.me