diff --git a/README.md b/README.md index a08760ae6..491589d1e 100644 --- a/README.md +++ b/README.md @@ -1,505 +1,587 @@ -# 🦞 Clawdbot β€” Personal AI Assistant +# 🦞 Clawdbot + Mobile GitHub App -

- Clawdbot -

+> **This is a customized fork of Clawdbot with a mobile GitHub app for on-the-go coding sessions.** -

- EXFOLIATE! EXFOLIATE! -

+--- -

- CI status - GitHub release - DeepWiki - Discord - MIT License -

+## What is this? -**Clawdbot** is a *personal AI assistant* you run on your own devices. -It answers you on the channels you already use (WhatsApp, Telegram, Slack, Discord, Signal, iMessage, Microsoft Teams, WebChat), plus extension channels like BlueBubbles, Matrix, Zalo, and Zalo Personal. It can speak and listen on macOS/iOS/Android, and can render a live Canvas you control. The Gateway is just the control plane β€” the product is the assistant. +This is **Clawdbot** - a personal AI assistant you run on your own devices - with added **mobile GitHub integration**. -If you want a personal, single-user assistant that feels local, fast, and always-on, this is it. +### Core Features +- **Multi-platform AI agent** that can write code, run terminal commands, and manage files +- **Mobile GitHub App** (React Native/Expo) for coding sessions from your phone +- **Real-time tool streaming** - watch Claude write code, run commands, create files +- **Repository context** - automatically clones/checkout GitHub repos before coding +- **Multiple channels** - WhatsApp, Telegram, Discord, Slack, Signal, iMessage, WebChat -[Website](https://clawdbot.com) Β· [Docs](https://docs.clawd.bot) Β· [Getting Started](https://docs.clawd.bot/start/getting-started) Β· [Updating](https://docs.clawd.bot/install/updating) Β· [Showcase](https://docs.clawd.bot/start/showcase) Β· [FAQ](https://docs.clawd.bot/start/faq) Β· [Wizard](https://docs.clawd.bot/start/wizard) Β· [Nix](https://github.com/clawdbot/nix-clawdbot) Β· [Docker](https://docs.clawd.bot/install/docker) Β· [Discord](https://discord.gg/clawd) +### What's Different From Upstream? +| Feature | Upstream Clawdbot | This Fork | +|---------|-------------------|-----------| +| Mobile GitHub App | ❌ | βœ… Expo app with real-time streaming | +| Repo Context | ❌ | βœ… Auto clone/checkout before session | +| Gateway WebSocket | βœ… | βœ… Enhanced with repo support | +| All other features | βœ… | βœ… Same as upstream | -Preferred setup: run the onboarding wizard (`clawdbot onboard`). It walks through gateway, workspace, channels, and skills. The CLI wizard is the recommended path and works on **macOS, Linux, and Windows (via WSL2; strongly recommended)**. -Works with npm, pnpm, or bun. -New install? Start here: [Getting started](https://docs.clawd.bot/start/getting-started) +--- -**Subscriptions (OAuth):** -- **[Anthropic](https://www.anthropic.com/)** (Claude Pro/Max) -- **[OpenAI](https://openai.com/)** (ChatGPT/Codex) +## System Requirements -Model note: while any model is supported, I strongly recommend **Anthropic Pro/Max (100/200) + Opus 4.5** for long‑context strength and better prompt‑injection resistance. See [Onboarding](https://docs.clawd.bot/start/onboarding). +### For Mac Mini (Gateway Server) +- **macOS 13+** (Ventura or later recommended) +- **Node.js 22+** (check with `node --version`) +- **pnpm** (recommended) or npm +- **Git** and **GitHub CLI** (`gh`) - for repo operations +- **Xcode** (only if building macOS/iOS apps) -## Models (selection + auth) +### For Mobile App +- **iOS 13+** or Android 8+ +- **Expo Go** app (for development) OR native build +- iPhone must be on same network as Mac Mini OR use Tailscale -- Models config + CLI: [Models](https://docs.clawd.bot/concepts/models) -- Auth profile rotation (OAuth vs API keys) + fallbacks: [Model failover](https://docs.clawd.bot/concepts/model-failover) +--- -## Install (recommended) +## Installation Guide -Runtime: **Node β‰₯22**. +### Step 1: Install Node.js and pnpm + +Open Terminal on your Mac Mini: ```bash -npm install -g clawdbot@latest -# or: pnpm add -g clawdbot@latest +# Install Homebrew if not already installed +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -clawdbot onboard --install-daemon +# Install Node.js 22+ +brew install node@22 + +# Add Node to PATH (add to ~/.zshrc) +echo 'export PATH="/opt/homebrew/opt/node@22/bin:$PATH"' >> ~/.zshrc +source ~/.zshrc + +# Verify versions +node --version # Should be v22.x.x +npm --version ``` -The wizard installs the Gateway daemon (launchd/systemd user service) so it stays running. - -## Quick start (TL;DR) - -Runtime: **Node β‰₯22**. - -Full beginner guide (auth, pairing, channels): [Getting started](https://docs.clawd.bot/start/getting-started) - ```bash -clawdbot onboard --install-daemon +# Install pnpm +npm install -g pnpm -clawdbot gateway --port 18789 --verbose - -# Send a message -clawdbot message send --to +1234567890 --message "Hello from Clawdbot" - -# Talk to the assistant (optionally deliver back to any connected channel: WhatsApp/Telegram/Slack/Discord/Signal/iMessage/BlueBubbles/Microsoft Teams/Matrix/Zalo/Zalo Personal/WebChat) -clawdbot agent --message "Ship checklist" --thinking high +# Verify +pnpm --version ``` -Upgrading? [Updating guide](https://docs.clawd.bot/install/updating) (and run `clawdbot doctor`). - -## Development channels - -- **stable**: tagged releases (`vYYYY.M.D` or `vYYYY.M.D-`), npm dist-tag `latest`. -- **beta**: prerelease tags (`vYYYY.M.D-beta.N`), npm dist-tag `beta` (macOS app may be missing). -- **dev**: moving head of `main`, npm dist-tag `dev` (when published). - -Switch channels (git + npm): `clawdbot update --channel stable|beta|dev`. -Details: [Development channels](https://docs.clawd.bot/install/development-channels). - -## From source (development) - -Prefer `pnpm` for builds from source. Bun is optional for running TypeScript directly. +### Step 2: Clone This Repository ```bash -git clone https://github.com/clawdbot/clawdbot.git +# Clone your fork +git clone https://github.com/YOUR_USERNAME/clawdbot.git cd clawdbot +# Or if you have the repo locally +cd /path/to/clawdbot +``` + +### Step 3: Install Dependencies and Build + +```bash +# Install all dependencies (this may take a few minutes) pnpm install -pnpm ui:build # auto-installs UI deps on first run + +# Build the Control UI +pnpm ui:build + +# Build TypeScript to dist/ pnpm build -pnpm clawdbot onboard --install-daemon +# Verify build succeeded +ls dist/ # Should show many .js files +``` -# Dev loop (auto-reload on TS changes) +### Step 4: Run Onboarding Wizard + +```bash +# Run the interactive setup wizard +./node_modules/.bin/clawdbot onboard --install-daemon +``` + +The wizard will ask you to: + +1. **Model Provider Selection** + - Choose **Anthropic** (recommended) or OpenAI + - Select API Key option (not OAuth for custom keys) + +2. **API Key Setup** + - Enter your Anthropic API key (sk-ant-...) + - Or OpenAI API key (sk-...) + - These are stored in `~/.clawdbot/agents/global/agent/auth-profiles.json` + +3. **Workspace Directory** + - Default: `~/clawd` (press Enter to accept) + - This is where Claude will write code + +4. **Gateway Configuration** + - Port: `18789` (default) + - Bind: `loopback` (local only, safe) + +5. **Channels** (optional) + - You can skip or add WhatsApp/Telegram/etc. + +6. **Daemon Installation** + - Choose **Yes** to install as background service + - This keeps Gateway running after terminal closes + +### Step 5: Configure GitHub CLI + +```bash +# Login to GitHub (opens browser) +gh auth login + +# Select: GitHub.com +# Select: SSH or HTTPS (HTTPS is easier) +# Select: Login with a web browser +``` + +### Step 6: Start the Gateway + +```bash +# Start the gateway service +./node_modules/.bin/clawdbot gateway start + +# OR run directly to see logs +./node_modules/.bin/clawdbot gateway --verbose +``` + +**Verify it's running:** +```bash +# Check gateway status +./node_modules/.bin/clawdbot gateway status + +# Test connection +curl http://127.0.0.1:18789/health +``` + +### Step 7: Note Your Gateway URL + +For the mobile app, you'll need: + +**Local Network (same WiFi):** +```bash +# Get your Mac's local IP +ipconfig getifaddr en0 # WiFi +# or +ipconfig getifaddr en1 # Ethernet +``` + +Example: `ws://192.168.1.100:18789` + +**Remote (Tailscale):** +1. Install Tailscale on Mac Mini +2. Get Tailscale IP: `tailscale ip -4` +3. Use: `ws://100.x.y.z:18789` + +--- + +## Mobile App Setup + +### Option A: Expo Go (Easiest - Development) + +```bash +# In the clawdbot directory +cd apps/expo-github-mobile + +# Install dependencies +npm install + +# Start Expo dev server +npm start +``` + +1. **Install Expo Go** on your iPhone from App Store +2. **Scan the QR code** shown in terminal +3. App will open in Expo Go + +### Option B: Native Build (Production) + +For a standalone app, you need an Apple Developer account: + +```bash +# Install EAS CLI +npm install -g eas-cli + +# Login to Expo +eas login + +# Configure build +eas build:configure + +# Build for iOS (requires Apple Developer account) +eas build --platform ios +``` + +--- + +## Mobile App Configuration + +Once the app is open: + +### 1. Settings (Gear Icon) + +| Field | Description | Example | +|-------|-------------|---------| +| **GitHub Username** | Your GitHub handle | `johndoe` | +| **Gateway URL** | WebSocket address | `ws://192.168.1.100:18789` | + +### 2. Create a New Session + +1. Tap **+** button +2. Enter your coding request (e.g., "Add dark mode to my app") +3. Select: + - **Model**: Sonnet 4.5, Opus 4.5, or Haiku + - **Repository**: Your GitHub repo (fetched via API) + - **Branch**: main, develop, etc. + +### 3. Watch Claude Work + +The app shows: +- **Real-time text streaming** as Claude thinks +- **Tool execution** with collapsible cards: + - πŸ“ Write - Creating files + - πŸ’» Bash - Running commands + - πŸ“– Read - Reading files + - ✏️ Edit - Modifying code +- **Connection status** - green when connected, red when disconnected + +--- + +## API Key Configuration + +### Using Custom API Keys + +Your keys are stored securely in `~/.clawdbot/`: + +```bash +# View your configured keys +cat ~/.clawdbot/agents/global/agent/auth-profiles.json +``` + +**Format:** +```json +{ + "profiles": [ + { + "id": "anthropic-custom", + "provider": "anthropic", + "apiKey": "sk-ant-...", + "baseURL": "https://api.anthropic.com", + "model": "claude-opus-4-5" + } + ], + "defaultProfile": "anthropic-custom" +} +``` + +### Using ChatGPT (OpenAI) + +The same config works for OpenAI: + +```json +{ + "profiles": [ + { + "id": "openai-gpt4", + "provider": "openai", + "apiKey": "sk-...", + "baseURL": "https://api.openai.com/v1", + "model": "gpt-4o" + } + ], + "defaultProfile": "openai-gpt4" +} +``` + +### Using Multiple Providers (Failover) + +```json +{ + "profiles": [ + { + "id": "primary-opus", + "provider": "anthropic", + "apiKey": "sk-ant-...", + "model": "claude-opus-4-5" + }, + { + "id": "fallback-sonnet", + "provider": "anthropic", + "apiKey": "sk-ant-...", + "model": "claude-sonnet-4-5" + }, + { + "id": "backup-gpt4", + "provider": "openai", + "apiKey": "sk-...", + "model": "gpt-4o" + } + ], + "defaultProfile": "primary-opus", + "fallbackOrder": ["fallback-sonnet", "backup-gpt4"] +} +``` + +--- + +## How It Works + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” WebSocket β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ Mobile App │◄──────────────────►│ Gateway β”‚ +β”‚ (Expo/iOS/ β”‚ ws://...:18789 β”‚ (port 18789) β”‚ +β”‚ Android) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ + β”‚ β”‚ + β”‚ Select Repo β”‚ + β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + β”‚ + β–Ό + β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” + β”‚ GitHub API β”‚ + β”‚ (public repos) β”‚ + β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + + β”‚ + β–Ό + β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” + β”‚ Agent Session with repoContext β”‚ + β”‚ { owner: "...", name: "...", β”‚ + β”‚ branch: "..." } β”‚ + β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + β”‚ + β–Ό + β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” + β”‚ Workspace Setup β”‚ + β”‚ 1. Clone repo (gh or git) β”‚ + β”‚ 2. Checkout branch β”‚ + β”‚ 3. Run in repo workspace β”‚ + β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +--- + +## Troubleshooting + +### Gateway Won't Start + +```bash +# Check what's using port 18789 +lsof -nP -iTCP:18789 -sTCP:LISTEN + +# Kill zombie process +kill -9 + +# Or use a different port +./node_modules/.bin/clawdbot gateway --port 18790 +``` + +### Mobile App Can't Connect + +1. **Check Mac's firewall:** + ```bash + # Allow incoming connections on port 18789 + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/local/bin/node + ``` + +2. **Verify gateway is accessible:** + ```bash + # From your Mac, test with curl + curl http://127.0.0.1:18789/health + ``` + +3. **Check mobile app URL:** + - Wrong: `http://192.168.1.100:18789` + - Correct: `ws://192.168.1.100:18789` + +### GitHub Repos Not Loading + +1. Check GitHub username is correct (case-sensitive) +2. Verify repos are public (or use GitHub with auth) +3. Check API rate limits: + ```bash + curl -i https://api.github.com/users/YOUR_USERNAME/repos + ``` + +### Repo Clone Fails + +```bash +# Verify gh is authenticated +gh auth status + +# Test clone manually +gh repo clone owner/repo ~/test-clone + +# If gh fails, check git config +git config --global github.user +``` + +--- + +## File Locations + +| What | Location | +|------|----------| +| **Config** | `~/.clawdbot/clawdbot.json` | +| **API Keys** | `~/.clawdbot/agents/*/agent/auth-profiles.json` | +| **Sessions** | `~/.clawdbot/agents/*/sessions/` | +| **Workspace** | `~/clawd/` (default) | +| **Repo Workspaces** | `~/clawd/.workspaces/{owner}/{repo}/` | +| **Logs** | `~/Library/Logs/com.clawdbot.mac/` (macOS app) | + +--- + +## Development + +### Running Gateway from Source (Hot Reload) + +```bash +# In clawdbot root pnpm gateway:watch ``` -Note: `pnpm clawdbot ...` runs TypeScript directly (via `tsx`). `pnpm build` produces `dist/` for running via Node / the packaged `clawdbot` binary. +This auto-restarts when TypeScript files change. -## Security defaults (DM access) +### Running Mobile App in Development -Clawdbot connects to real messaging surfaces. Treat inbound DMs as **untrusted input**. +```bash +cd apps/expo-github-mobile -Full security guide: [Security](https://docs.clawd.bot/gateway/security) +# Start with tunnel (works remotely too) +npx expo start --tunnel -Default behavior on Telegram/WhatsApp/Signal/iMessage/Microsoft Teams/Discord/Slack: -- **DM pairing** (`dmPolicy="pairing"` / `channels.discord.dm.policy="pairing"` / `channels.slack.dm.policy="pairing"`): unknown senders receive a short pairing code and the bot does not process their message. -- Approve with: `clawdbot pairing approve ` (then the sender is added to a local allowlist store). -- Public inbound DMs require an explicit opt-in: set `dmPolicy="open"` and include `"*"` in the channel allowlist (`allowFrom` / `channels.discord.dm.allowFrom` / `channels.slack.dm.allowFrom`). - -Run `clawdbot doctor` to surface risky/misconfigured DM policies. - -## Highlights - -- **[Local-first Gateway](https://docs.clawd.bot/gateway)** β€” single control plane for sessions, channels, tools, and events. -- **[Multi-channel inbox](https://docs.clawd.bot/channels)** β€” WhatsApp, Telegram, Slack, Discord, Signal, iMessage, BlueBubbles, Microsoft Teams, Matrix, Zalo, Zalo Personal, WebChat, macOS, iOS/Android. -- **[Multi-agent routing](https://docs.clawd.bot/gateway/configuration)** β€” route inbound channels/accounts/peers to isolated agents (workspaces + per-agent sessions). -- **[Voice Wake](https://docs.clawd.bot/nodes/voicewake) + [Talk Mode](https://docs.clawd.bot/nodes/talk)** β€” always-on speech for macOS/iOS/Android with ElevenLabs. -- **[Live Canvas](https://docs.clawd.bot/platforms/mac/canvas)** β€” agent-driven visual workspace with [A2UI](https://docs.clawd.bot/platforms/mac/canvas#canvas-a2ui). -- **[First-class tools](https://docs.clawd.bot/tools)** β€” browser, canvas, nodes, cron, sessions, and Discord/Slack actions. -- **[Companion apps](https://docs.clawd.bot/platforms/macos)** β€” macOS menu bar app + iOS/Android [nodes](https://docs.clawd.bot/nodes). -- **[Onboarding](https://docs.clawd.bot/start/wizard) + [skills](https://docs.clawd.bot/tools/skills)** β€” wizard-driven setup with bundled/managed/workspace skills. - -## Star History - -[![Star History Chart](https://api.star-history.com/svg?repos=clawdbot/clawdbot&type=date&legend=top-left)](https://www.star-history.com/#clawdbot/clawdbot&type=date&legend=top-left) - -## Everything we built so far - -### Core platform -- [Gateway WS control plane](https://docs.clawd.bot/gateway) with sessions, presence, config, cron, webhooks, [Control UI](https://docs.clawd.bot/web), and [Canvas host](https://docs.clawd.bot/platforms/mac/canvas#canvas-a2ui). -- [CLI surface](https://docs.clawd.bot/tools/agent-send): gateway, agent, send, [wizard](https://docs.clawd.bot/start/wizard), and [doctor](https://docs.clawd.bot/gateway/doctor). -- [Pi agent runtime](https://docs.clawd.bot/concepts/agent) in RPC mode with tool streaming and block streaming. -- [Session model](https://docs.clawd.bot/concepts/session): `main` for direct chats, group isolation, activation modes, queue modes, reply-back. Group rules: [Groups](https://docs.clawd.bot/concepts/groups). -- [Media pipeline](https://docs.clawd.bot/nodes/images): images/audio/video, transcription hooks, size caps, temp file lifecycle. Audio details: [Audio](https://docs.clawd.bot/nodes/audio). - -### Channels -- [Channels](https://docs.clawd.bot/channels): [WhatsApp](https://docs.clawd.bot/channels/whatsapp) (Baileys), [Telegram](https://docs.clawd.bot/channels/telegram) (grammY), [Slack](https://docs.clawd.bot/channels/slack) (Bolt), [Discord](https://docs.clawd.bot/channels/discord) (discord.js), [Signal](https://docs.clawd.bot/channels/signal) (signal-cli), [iMessage](https://docs.clawd.bot/channels/imessage) (imsg), [BlueBubbles](https://docs.clawd.bot/channels/bluebubbles) (extension), [Microsoft Teams](https://docs.clawd.bot/channels/msteams) (extension), [Matrix](https://docs.clawd.bot/channels/matrix) (extension), [Zalo](https://docs.clawd.bot/channels/zalo) (extension), [Zalo Personal](https://docs.clawd.bot/channels/zalouser) (extension), [WebChat](https://docs.clawd.bot/web/webchat). -- [Group routing](https://docs.clawd.bot/concepts/group-messages): mention gating, reply tags, per-channel chunking and routing. Channel rules: [Channels](https://docs.clawd.bot/channels). - -### Apps + nodes -- [macOS app](https://docs.clawd.bot/platforms/macos): menu bar control plane, [Voice Wake](https://docs.clawd.bot/nodes/voicewake)/PTT, [Talk Mode](https://docs.clawd.bot/nodes/talk) overlay, [WebChat](https://docs.clawd.bot/web/webchat), debug tools, [remote gateway](https://docs.clawd.bot/gateway/remote) control. -- [iOS node](https://docs.clawd.bot/platforms/ios): [Canvas](https://docs.clawd.bot/platforms/mac/canvas), [Voice Wake](https://docs.clawd.bot/nodes/voicewake), [Talk Mode](https://docs.clawd.bot/nodes/talk), camera, screen recording, Bonjour pairing. -- [Android node](https://docs.clawd.bot/platforms/android): [Canvas](https://docs.clawd.bot/platforms/mac/canvas), [Talk Mode](https://docs.clawd.bot/nodes/talk), camera, screen recording, optional SMS. -- [macOS node mode](https://docs.clawd.bot/nodes): system.run/notify + canvas/camera exposure. - -### Tools + automation -- [Browser control](https://docs.clawd.bot/tools/browser): dedicated clawd Chrome/Chromium, snapshots, actions, uploads, profiles. -- [Canvas](https://docs.clawd.bot/platforms/mac/canvas): [A2UI](https://docs.clawd.bot/platforms/mac/canvas#canvas-a2ui) push/reset, eval, snapshot. -- [Nodes](https://docs.clawd.bot/nodes): camera snap/clip, screen record, [location.get](https://docs.clawd.bot/nodes/location-command), notifications. -- [Cron + wakeups](https://docs.clawd.bot/automation/cron-jobs); [webhooks](https://docs.clawd.bot/automation/webhook); [Gmail Pub/Sub](https://docs.clawd.bot/automation/gmail-pubsub). -- [Skills platform](https://docs.clawd.bot/tools/skills): bundled, managed, and workspace skills with install gating + UI. - -### Runtime + safety -- [Channel routing](https://docs.clawd.bot/concepts/channel-routing), [retry policy](https://docs.clawd.bot/concepts/retry), and [streaming/chunking](https://docs.clawd.bot/concepts/streaming). -- [Presence](https://docs.clawd.bot/concepts/presence), [typing indicators](https://docs.clawd.bot/concepts/typing-indicators), and [usage tracking](https://docs.clawd.bot/concepts/usage-tracking). -- [Models](https://docs.clawd.bot/concepts/models), [model failover](https://docs.clawd.bot/concepts/model-failover), and [session pruning](https://docs.clawd.bot/concepts/session-pruning). -- [Security](https://docs.clawd.bot/gateway/security) and [troubleshooting](https://docs.clawd.bot/channels/troubleshooting). - -### Ops + packaging -- [Control UI](https://docs.clawd.bot/web) + [WebChat](https://docs.clawd.bot/web/webchat) served directly from the Gateway. -- [Tailscale Serve/Funnel](https://docs.clawd.bot/gateway/tailscale) or [SSH tunnels](https://docs.clawd.bot/gateway/remote) with token/password auth. -- [Nix mode](https://docs.clawd.bot/install/nix) for declarative config; [Docker](https://docs.clawd.bot/install/docker)-based installs. -- [Doctor](https://docs.clawd.bot/gateway/doctor) migrations, [logging](https://docs.clawd.bot/logging). - -## How it works (short) - -``` -WhatsApp / Telegram / Slack / Discord / Signal / iMessage / BlueBubbles / Microsoft Teams / Matrix / Zalo / Zalo Personal / WebChat - β”‚ - β–Ό -β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” -β”‚ Gateway β”‚ -β”‚ (control plane) β”‚ -β”‚ ws://127.0.0.1:18789 β”‚ -β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ - β”‚ - β”œβ”€ Pi agent (RPC) - β”œβ”€ CLI (clawdbot …) - β”œβ”€ WebChat UI - β”œβ”€ macOS app - └─ iOS / Android nodes +# Or local only +npm start ``` -## Key subsystems +### Building All Apps -- **[Gateway WebSocket network](https://docs.clawd.bot/concepts/architecture)** β€” single WS control plane for clients, tools, and events (plus ops: [Gateway runbook](https://docs.clawd.bot/gateway)). -- **[Tailscale exposure](https://docs.clawd.bot/gateway/tailscale)** β€” Serve/Funnel for the Gateway dashboard + WS (remote access: [Remote](https://docs.clawd.bot/gateway/remote)). -- **[Browser control](https://docs.clawd.bot/tools/browser)** β€” clawd‑managed Chrome/Chromium with CDP control. -- **[Canvas + A2UI](https://docs.clawd.bot/platforms/mac/canvas)** β€” agent‑driven visual workspace (A2UI host: [Canvas/A2UI](https://docs.clawd.bot/platforms/mac/canvas#canvas-a2ui)). -- **[Voice Wake](https://docs.clawd.bot/nodes/voicewake) + [Talk Mode](https://docs.clawd.bot/nodes/talk)** β€” always‑on speech and continuous conversation. -- **[Nodes](https://docs.clawd.bot/nodes)** β€” Canvas, camera snap/clip, screen record, `location.get`, notifications, plus macOS‑only `system.run`/`system.notify`. +```bash +# Build TypeScript +pnpm build -## Tailscale access (Gateway dashboard) +# Build macOS app (requires Xcode) +./scripts/package-mac-app.sh -Clawdbot can auto-configure Tailscale **Serve** (tailnet-only) or **Funnel** (public) while the Gateway stays bound to loopback. Configure `gateway.tailscale.mode`: +# Output: dist/Clawdbot.app +``` -- `off`: no Tailscale automation (default). -- `serve`: tailnet-only HTTPS via `tailscale serve` (uses Tailscale identity headers by default). -- `funnel`: public HTTPS via `tailscale funnel` (requires shared password auth). +--- -Notes: -- `gateway.bind` must stay `loopback` when Serve/Funnel is enabled (Clawdbot enforces this). -- Serve can be forced to require a password by setting `gateway.auth.mode: "password"` or `gateway.auth.allowTailscale: false`. -- Funnel refuses to start unless `gateway.auth.mode: "password"` is set. -- Optional: `gateway.tailscale.resetOnExit` to undo Serve/Funnel on shutdown. +## Commands Reference -Details: [Tailscale guide](https://docs.clawd.bot/gateway/tailscale) Β· [Web surfaces](https://docs.clawd.bot/web) +```bash +# Gateway +./node_modules/.bin/clawdbot gateway start +./node_modules/.bin/clawdbot gateway stop +./node_modules/.bin/clawdbot gateway restart +./node_modules/.bin/clawdbot gateway status -## Remote Gateway (Linux is great) +# Send a message from CLI +./node_modules/.bin/clawdbot message send --to "+1234567890" --message "Hello" -It’s perfectly fine to run the Gateway on a small Linux instance. Clients (macOS app, CLI, WebChat) can connect over **Tailscale Serve/Funnel** or **SSH tunnels**, and you can still pair device nodes (macOS/iOS/Android) to execute device‑local actions when needed. +# Talk to agent (direct) +./node_modules/.bin/clawdbot agent --message "Explain this code" -- **Gateway host** runs the exec tool and channel connections by default. -- **Device nodes** run device‑local actions (`system.run`, camera, screen recording, notifications) via `node.invoke`. -In short: exec runs where the Gateway lives; device actions run where the device lives. +# Doctor (health check) +./node_modules/.bin/clawdbot doctor -Details: [Remote access](https://docs.clawd.bot/gateway/remote) Β· [Nodes](https://docs.clawd.bot/nodes) Β· [Security](https://docs.clawd.bot/gateway/security) +# Update from upstream +git fetch upstream +git rebase upstream/main +``` -## macOS permissions via the Gateway protocol +--- -The macOS app can run in **node mode** and advertises its capabilities + permission map over the Gateway WebSocket (`node.list` / `node.describe`). Clients can then execute local actions via `node.invoke`: +## Security Notes -- `system.run` runs a local command and returns stdout/stderr/exit code; set `needsScreenRecording: true` to require screen-recording permission (otherwise you’ll get `PERMISSION_MISSING`). -- `system.notify` posts a user notification and fails if notifications are denied. -- `canvas.*`, `camera.*`, `screen.record`, and `location.get` are also routed via `node.invoke` and follow TCC permission status. +1. **Gateway is bound to loopback** by default - only accessible from your machine +2. **To expose to network**, use Tailscale or SSH tunneling +3. **API keys are stored locally** and never sent to external servers +4. **Pairing is required** for unknown DMs (WhatsApp/Telegram) +5. **Sandbox mode** recommended for group chats -Elevated bash (host permissions) is separate from macOS TCC: +--- -- Use `/elevated on|off` to toggle per‑session elevated access when enabled + allowlisted. -- Gateway persists the per‑session toggle via `sessions.patch` (WS method) alongside `thinkingLevel`, `verboseLevel`, `model`, `sendPolicy`, and `groupActivation`. +## Architecture -Details: [Nodes](https://docs.clawd.bot/nodes) Β· [macOS app](https://docs.clawd.bot/platforms/macos) Β· [Gateway protocol](https://docs.clawd.bot/concepts/architecture) +### Gateway WebSocket Protocol -## Agent to Agent (sessions_* tools) - -- Use these to coordinate work across sessions without jumping between chat surfaces. -- `sessions_list` β€” discover active sessions (agents) and their metadata. -- `sessions_history` β€” fetch transcript logs for a session. -- `sessions_send` β€” message another session; optional reply‑back ping‑pong + announce step (`REPLY_SKIP`, `ANNOUNCE_SKIP`). - -Details: [Session tools](https://docs.clawd.bot/concepts/session-tool) - -## Skills registry (ClawdHub) - -ClawdHub is a minimal skill registry. With ClawdHub enabled, the agent can search for skills automatically and pull in new ones as needed. - -[ClawdHub](https://ClawdHub.com) - -## Chat commands - -Send these in WhatsApp/Telegram/Slack/Microsoft Teams/WebChat (group commands are owner-only): - -- `/status` β€” compact session status (model + tokens, cost when available) -- `/new` or `/reset` β€” reset the session -- `/compact` β€” compact session context (summary) -- `/think ` β€” off|minimal|low|medium|high|xhigh (GPT-5.2 + Codex models only) -- `/verbose on|off` -- `/usage off|tokens|full` β€” per-response usage footer -- `/restart` β€” restart the gateway (owner-only in groups) -- `/activation mention|always` β€” group activation toggle (groups only) - -## Apps (optional) - -The Gateway alone delivers a great experience. All apps are optional and add extra features. - -If you plan to build/run companion apps, follow the platform runbooks below. - -### macOS (Clawdbot.app) (optional) - -- Menu bar control for the Gateway and health. -- Voice Wake + push-to-talk overlay. -- WebChat + debug tools. -- Remote gateway control over SSH. - -Note: signed builds required for macOS permissions to stick across rebuilds (see `docs/mac/permissions.md`). - -### iOS node (optional) - -- Pairs as a node via the Bridge. -- Voice trigger forwarding + Canvas surface. -- Controlled via `clawdbot nodes …`. - -Runbook: [iOS connect](https://docs.clawd.bot/platforms/ios). - -### Android node (optional) - -- Pairs via the same Bridge + pairing flow as iOS. -- Exposes Canvas, Camera, and Screen capture commands. -- Runbook: [Android connect](https://docs.clawd.bot/platforms/android). - -## Agent workspace + skills - -- Workspace root: `~/clawd` (configurable via `agents.defaults.workspace`). -- Injected prompt files: `AGENTS.md`, `SOUL.md`, `TOOLS.md`. -- Skills: `~/clawd/skills//SKILL.md`. - -## Configuration - -Minimal `~/.clawdbot/clawdbot.json` (model + defaults): - -```json5 +**Request Frame:** +```json { - agent: { - model: "anthropic/claude-opus-4-5" + "type": "req", + "method": "agent", + "id": "unique-id", + "params": { + "message": "Your coding task", + "repoContext": { + "owner": "github-user", + "name": "repo-name", + "branch": "main" + }, + "idempotencyKey": "unique-key" } } ``` -[Full configuration reference (all keys + examples).](https://docs.clawd.bot/gateway/configuration) - -## Security model (important) - -- **Default:** tools run on the host for the **main** session, so the agent has full access when it’s just you. -- **Group/channel safety:** set `agents.defaults.sandbox.mode: "non-main"` to run **non‑main sessions** (groups/channels) inside per‑session Docker sandboxes; bash then runs in Docker for those sessions. -- **Sandbox defaults:** allowlist `bash`, `process`, `read`, `write`, `edit`, `sessions_list`, `sessions_history`, `sessions_send`, `sessions_spawn`; denylist `browser`, `canvas`, `nodes`, `cron`, `discord`, `gateway`. - -Details: [Security guide](https://docs.clawd.bot/gateway/security) Β· [Docker + sandboxing](https://docs.clawd.bot/install/docker) Β· [Sandbox config](https://docs.clawd.bot/gateway/configuration) - -### [WhatsApp](https://docs.clawd.bot/channels/whatsapp) - -- Link the device: `pnpm clawdbot channels login` (stores creds in `~/.clawdbot/credentials`). -- Allowlist who can talk to the assistant via `channels.whatsapp.allowFrom`. -- If `channels.whatsapp.groups` is set, it becomes a group allowlist; include `"*"` to allow all. - -### [Telegram](https://docs.clawd.bot/channels/telegram) - -- Set `TELEGRAM_BOT_TOKEN` or `channels.telegram.botToken` (env wins). -- Optional: set `channels.telegram.groups` (with `channels.telegram.groups."*".requireMention`); when set, it is a group allowlist (include `"*"` to allow all). Also `channels.telegram.allowFrom` or `channels.telegram.webhookUrl` as needed. - -```json5 +**Response Frame:** +```json { - channels: { - telegram: { - botToken: "123456:ABCDEF" - } + "type": "res", + "id": "unique-id", + "ok": true, + "payload": { + "runId": "run-123", + "status": "accepted" } } ``` -### [Slack](https://docs.clawd.bot/channels/slack) - -- Set `SLACK_BOT_TOKEN` + `SLACK_APP_TOKEN` (or `channels.slack.botToken` + `channels.slack.appToken`). - -### [Discord](https://docs.clawd.bot/channels/discord) - -- Set `DISCORD_BOT_TOKEN` or `channels.discord.token` (env wins). -- Optional: set `commands.native`, `commands.text`, or `commands.useAccessGroups`, plus `channels.discord.dm.allowFrom`, `channels.discord.guilds`, or `channels.discord.mediaMaxMb` as needed. - -```json5 +**Event Stream:** +```json { - channels: { - discord: { - token: "1234abcd" - } + "type": "event", + "event": "agent", + "payload": { + "runId": "run-123", + "stream": "assistant", + "data": { "delta": "Hello! I'll help you" } } } ``` -### [Signal](https://docs.clawd.bot/channels/signal) +--- -- Requires `signal-cli` and a `channels.signal` config section. +## Contributing -### [iMessage](https://docs.clawd.bot/channels/imessage) +This fork focuses on mobile GitHub integration. Upstream Clawdbot is at: +https://github.com/clawdbot/clawdbot -- macOS only; Messages must be signed in. -- If `channels.imessage.groups` is set, it becomes a group allowlist; include `"*"` to allow all. +To contribute: +1. Fork this repo +2. Create a feature branch +3. Make your changes +4. Submit a pull request -### [Microsoft Teams](https://docs.clawd.bot/channels/msteams) +--- -- Configure a Teams app + Bot Framework, then add a `msteams` config section. -- Allowlist who can talk via `msteams.allowFrom`; group access via `msteams.groupAllowFrom` or `msteams.groupPolicy: "open"`. +## License -### [WebChat](https://docs.clawd.bot/web/webchat) +MIT License - Same as upstream Clawdbot. -- Uses the Gateway WebSocket; no separate WebChat port/config. +--- -Browser control (optional): +## Links -```json5 -{ - browser: { - enabled: true, - controlUrl: "http://127.0.0.1:18791", - color: "#FF4500" - } -} -``` - -## Docs - -Use these when you’re past the onboarding flow and want the deeper reference. -- [Start with the docs index for navigation and β€œwhat’s where.”](https://docs.clawd.bot) -- [Read the architecture overview for the gateway + protocol model.](https://docs.clawd.bot/concepts/architecture) -- [Use the full configuration reference when you need every key and example.](https://docs.clawd.bot/gateway/configuration) -- [Run the Gateway by the book with the operational runbook.](https://docs.clawd.bot/gateway) -- [Learn how the Control UI/Web surfaces work and how to expose them safely.](https://docs.clawd.bot/web) -- [Understand remote access over SSH tunnels or tailnets.](https://docs.clawd.bot/gateway/remote) -- [Follow the onboarding wizard flow for a guided setup.](https://docs.clawd.bot/start/wizard) -- [Wire external triggers via the webhook surface.](https://docs.clawd.bot/automation/webhook) -- [Set up Gmail Pub/Sub triggers.](https://docs.clawd.bot/automation/gmail-pubsub) -- [Learn the macOS menu bar companion details.](https://docs.clawd.bot/platforms/mac/menu-bar) -- [Platform guides: Windows (WSL2)](https://docs.clawd.bot/platforms/windows), [Linux](https://docs.clawd.bot/platforms/linux), [macOS](https://docs.clawd.bot/platforms/macos), [iOS](https://docs.clawd.bot/platforms/ios), [Android](https://docs.clawd.bot/platforms/android) -- [Debug common failures with the troubleshooting guide.](https://docs.clawd.bot/channels/troubleshooting) -- [Review security guidance before exposing anything.](https://docs.clawd.bot/gateway/security) - -## Advanced docs (discovery + control) - -- [Discovery + transports](https://docs.clawd.bot/gateway/discovery) -- [Bonjour/mDNS](https://docs.clawd.bot/gateway/bonjour) -- [Gateway pairing](https://docs.clawd.bot/gateway/pairing) -- [Remote gateway README](https://docs.clawd.bot/gateway/remote-gateway-readme) -- [Control UI](https://docs.clawd.bot/web/control-ui) -- [Dashboard](https://docs.clawd.bot/web/dashboard) - -## Operations & troubleshooting - -- [Health checks](https://docs.clawd.bot/gateway/health) -- [Gateway lock](https://docs.clawd.bot/gateway/gateway-lock) -- [Background process](https://docs.clawd.bot/gateway/background-process) -- [Browser troubleshooting (Linux)](https://docs.clawd.bot/tools/browser-linux-troubleshooting) -- [Logging](https://docs.clawd.bot/logging) - -## Deep dives - -- [Agent loop](https://docs.clawd.bot/concepts/agent-loop) -- [Presence](https://docs.clawd.bot/concepts/presence) -- [TypeBox schemas](https://docs.clawd.bot/concepts/typebox) -- [RPC adapters](https://docs.clawd.bot/reference/rpc) -- [Queue](https://docs.clawd.bot/concepts/queue) - -## Workspace & skills - -- [Skills config](https://docs.clawd.bot/tools/skills-config) -- [Default AGENTS](https://docs.clawd.bot/reference/AGENTS.default) -- [Templates: AGENTS](https://docs.clawd.bot/reference/templates/AGENTS) -- [Templates: BOOTSTRAP](https://docs.clawd.bot/reference/templates/BOOTSTRAP) -- [Templates: IDENTITY](https://docs.clawd.bot/reference/templates/IDENTITY) -- [Templates: SOUL](https://docs.clawd.bot/reference/templates/SOUL) -- [Templates: TOOLS](https://docs.clawd.bot/reference/templates/TOOLS) -- [Templates: USER](https://docs.clawd.bot/reference/templates/USER) - -## Platform internals - -- [macOS dev setup](https://docs.clawd.bot/platforms/mac/dev-setup) -- [macOS menu bar](https://docs.clawd.bot/platforms/mac/menu-bar) -- [macOS voice wake](https://docs.clawd.bot/platforms/mac/voicewake) -- [iOS node](https://docs.clawd.bot/platforms/ios) -- [Android node](https://docs.clawd.bot/platforms/android) -- [Windows (WSL2)](https://docs.clawd.bot/platforms/windows) -- [Linux app](https://docs.clawd.bot/platforms/linux) - -## Email hooks (Gmail) - -- [docs.clawd.bot/gmail-pubsub](https://docs.clawd.bot/automation/gmail-pubsub) - -## Clawd - -Clawdbot was built for **Clawd**, a space lobster AI assistant. 🦞 -by Peter Steinberger and the community. - -- [clawd.me](https://clawd.me) -- [soul.md](https://soul.md) -- [steipete.me](https://steipete.me) - -## Community - -See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines, maintainers, and how to submit PRs. -AI/vibe-coded PRs welcome! πŸ€– - -Special thanks to [Mario Zechner](https://mariozechner.at/) for his support and for -[pi-mono](https://github.com/badlogic/pi-mono). - -Thanks to all clawtributors: - -

- steipete bohdanpodvirnyi joaohlisboa mneves75 MatthieuBizien MaudeBot rahthakor vrknetha radek-paclt Tobias Bischoff - joshp123 mukhtharcm maxsumrall xadenryan juanpablodlc hsrvc magimetal meaningfool NicholasSpisak sebslight - abhisekbasu1 jamesgroat zerone0x claude SocialNerd42069 Hyaxia dantelex daveonkels mteam88 Eng. Juan Combetto - Mariano Belinky dbhurley TSavo julianengel benithors bradleypriest timolins nachx639 sreekaransrinath gupsammy - cristip73 nachoiacovino Vasanth Rao Naik Sabavat cpojer lc0rp scald gumadeiras andranik-sahakyan davidguttman sleontenko - sircrumpet peschee rafaelreis-r thewilloftheshadow ratulsarna lutr0 danielz1z emanuelst KristijanJovanovski CashWilliams - rdev osolmaz joshrad-dev kiranjd adityashaw2 sheeek artuskg onutc tyler6204 manuelhettich - minghinmatthewlam myfunc vignesh07 buddyh connorshea mcinteerj dependabot[bot] John-Rood timkrase gerardward2007 - obviyus tosh-hamburg azade-c roshanasingh4 bjesuiter cheeeee Josh Phillips Whoaa512 YuriNachos chriseidhof - ysqander dlauer superman32432432 Yurii Chukhlib grp06 antons austinm911 blacksmith-sh[bot] damoahdominic dan-dr - HeimdallStrategy imfing jalehman jarvis-medmatic kkarimi mahmoudashraf93 ngutman petter-b pkrmf RandyVentures - robbyczgw-cla Ryan Lisse dougvk erikpr1994 Ghost jonasjancarik Keith the Silly Goose L36 Server Marc mitschabaude-bot - mkbehr neist chrisrodz czekaj Friederike Seiler gabriel-trigo iamadig Jonathan D. Rhyne (DJ-D) Kit koala73 - manmal ogulcancelik pasogott petradonka rubyrunsstuff sibbl siddhantjain suminhthanh VACInc wes-davis - zats 24601 ameno- Chris Taylor Django Navarro evalexpr henrino3 humanwritten larlyssa oswalpalash - pcty-nextgen-service-account Syhids Aaron Konyer aaronveklabs adam91holt cash-echo-bot Clawd ClawdFx erik-agens fcatuhe - ivanrvpereira jayhickey jeffersonwarrior jeffersonwarrior jverdi longmaba mickahouan mjrussell p6l-richard philipp-spiess - robaxelsen Sash Catanzarite T5-AndyML VAC zknicker aj47 alejandro maza andrewting19 Andrii anpoirier - Asleep123 bolismauro conhecendoia Dimitrios Ploutarchos Drake Thomsen Felix Krause gtsifrikas HazAT hrdwdmrbl hugobarauna - Jamie Openshaw Jarvis Jefferson Nunn Kevin Lin kitze levifig Lloyd loukotal martinpucik Matt mini - Miles mrdbstn MSch Mustafa Tag Eldeen ndraiman nexty5870 odysseus0 prathamdby ptn1411 reeltimeapps - RLTCmpe rodrigouroz Rolf Fredheim Rony Kelner Samrat Jha siraht snopoke testingabc321 The Admiral thesash - Ubuntu voidserf Vultr-Clawd Admin Wimmie wstock yazinsai Zach Knickerbocker Alphonse-arianee Azade carlulsoe - ddyo Erik latitudeki5223 Manuel Maly Mourad Boustani odrobnik pauloportella pcty-nextgen-ios-builder Quentin Randy Torres - rhjoh ronak-guliani William Stock -

+- **Upstream**: https://github.com/clawdbot/clawdbot +- **Docs**: https://docs.clawd.bot +- **Discord**: https://discord.gg/clawd +- **Expo**: https://expo.dev