|
| 1 | +# Clawdbot - AI Agent Gateway EdgeApp |
| 2 | + |
| 3 | +**Clawdbot** is an AI agent gateway that integrates WhatsApp, Telegram, Discord, and iMessage into a unified control plane. This EdgeApp runs Clawdbot as a centralized hub that local instances can connect to. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +- 🤖 **AI-Powered**: Integrates Claude (Anthropic) and other LLMs via Pi agent |
| 8 | +- 📱 **Multi-Channel**: WhatsApp, Telegram, Discord, iMessage all in one place |
| 9 | +- 🌐 **Distributed**: Central gateway with local client connections |
| 10 | +- 🔒 **Secure**: Token-based auth, per-agent sandboxing |
| 11 | +- 🎛️ **Configurable**: Dashboard UI for channel setup and credentials |
| 12 | + |
| 13 | +## Quick Start |
| 14 | + |
| 15 | +### Installation |
| 16 | + |
| 17 | +```bash |
| 18 | +# Clone or sync the edgebox-iot/apps repo |
| 19 | +cd ~/Repositories/edgebox-iot/apps |
| 20 | + |
| 21 | +# Build locally |
| 22 | +make build apps="clawd" |
| 23 | + |
| 24 | +# Run locally |
| 25 | +make run apps="clawd" |
| 26 | +``` |
| 27 | + |
| 28 | +Access the dashboard at: **http://clawd.local** |
| 29 | + |
| 30 | +### Configuration |
| 31 | + |
| 32 | +The Clawdbot gateway is configurable via the Edgebox dashboard. Key settings: |
| 33 | + |
| 34 | +- **Telegram Bot Token**: Get from [@BotFather](https://t.me/BotFather) |
| 35 | +- **Discord Bot Token**: Create at [Discord Developer Portal](https://discord.com/developers) |
| 36 | +- **Gateway Token**: Optional security token for remote access |
| 37 | +- **Primary Model**: Which LLM to use (default: Claude Opus 4.5) |
| 38 | + |
| 39 | +### Ports |
| 40 | + |
| 41 | +- **18789**: Gateway WebSocket (loopback by default, use token for remote) |
| 42 | +- **18790**: Bridge for iOS/Android node pairing |
| 43 | +- **18793**: Canvas host (WebView assets) |
| 44 | +- **80**: Web UI (reverse-proxied via Traefik) |
| 45 | + |
| 46 | +## Architecture |
| 47 | + |
| 48 | +``` |
| 49 | +┌─────────────────────────────────┐ |
| 50 | +│ Edgebox System │ |
| 51 | +│ ┌─────────────────────────┐ │ |
| 52 | +│ │ Clawdbot Gateway │ │ |
| 53 | +│ │ - WhatsApp/Telegram │ │ |
| 54 | +│ │ - Discord/iMessage │ │ |
| 55 | +│ │ - WebChat UI │ │ |
| 56 | +│ │ - Auth Management │ │ |
| 57 | +│ └─────────────────────────┘ │ |
| 58 | +│ ↑ ↓ │ |
| 59 | +│ ┌─────────────────────────┐ │ |
| 60 | +│ │ Traefik Reverse Proxy │ │ |
| 61 | +│ │ (clawd.local) │ │ |
| 62 | +│ └─────────────────────────┘ │ |
| 63 | +└─────────────────────────────────┘ |
| 64 | + ↑ |
| 65 | + LAN / Tailnet |
| 66 | + ↓ |
| 67 | +┌─────────────────────────────────┐ |
| 68 | +│ Local Clawdbot (Mac/Linux) │ |
| 69 | +│ Connects to central Gateway │ |
| 70 | +└─────────────────────────────────┘ |
| 71 | +``` |
| 72 | + |
| 73 | +## Local Client Configuration |
| 74 | + |
| 75 | +To connect a local Clawdbot instance to this central gateway: |
| 76 | + |
| 77 | +```json |
| 78 | +{ |
| 79 | + "gateway": { |
| 80 | + "bind": "remote", |
| 81 | + "host": "clawd.local", |
| 82 | + "port": 18789, |
| 83 | + "token": "${CLAWDBOT_GATEWAY_TOKEN}" |
| 84 | + }, |
| 85 | + "agents": { |
| 86 | + "defaults": { |
| 87 | + "workspace": "~/clawd-local" |
| 88 | + } |
| 89 | + } |
| 90 | +} |
| 91 | +``` |
| 92 | + |
| 93 | +## File Structure |
| 94 | + |
| 95 | +``` |
| 96 | +clawd/ |
| 97 | +├── Dockerfile # Node 22 + Clawdbot |
| 98 | +├── entrypoint.sh # Init script |
| 99 | +├── clawdbot.json.template # Default config |
| 100 | +├── edgebox-compose.yml # Docker Compose config |
| 101 | +├── edgebox.env # Metadata (EDGEAPP_NAME, etc.) |
| 102 | +├── edgeapp.template.env # Config variables for dashboard |
| 103 | +├── edgeapp-icon.png # App icon |
| 104 | +├── edgebox-postinstall.sh # Post-install hook |
| 105 | +└── src/ # Static assets (if any) |
| 106 | +``` |
| 107 | + |
| 108 | +## Environment Variables |
| 109 | + |
| 110 | +| Variable | Type | Required | Description | |
| 111 | +|----------|------|----------|-------------| |
| 112 | +| `TELEGRAM_BOT_TOKEN` | string | false | Telegram Bot API token | |
| 113 | +| `DISCORD_BOT_TOKEN` | string | false | Discord Bot token | |
| 114 | +| `CLAWDBOT_GATEWAY_TOKEN` | string | false | Security token for remote access | |
| 115 | +| `CLAWDBOT_PRIMARY_MODEL` | string | false | Primary LLM (default: claude-opus-4-5) | |
| 116 | +| `ANTHROPIC_API_KEY` | string | false | Anthropic API key | |
| 117 | +| `OPENAI_API_KEY` | string | false | OpenAI API key (fallback) | |
| 118 | + |
| 119 | +## Persistence |
| 120 | + |
| 121 | +- **Config**: `/home/system/components/clawd/config/clawdbot.json` |
| 122 | +- **Workspace**: `/home/system/components/clawd/data/clawd` |
| 123 | +- **State**: `/home/system/components/clawd/data/.clawdbot` |
| 124 | + |
| 125 | +Data persists across container restarts via Docker volumes. |
| 126 | + |
| 127 | +## Extending |
| 128 | + |
| 129 | +### Add a New Agent |
| 130 | + |
| 131 | +Edit `clawdbot.json`: |
| 132 | + |
| 133 | +```json |
| 134 | +{ |
| 135 | + "agents": { |
| 136 | + "list": [ |
| 137 | + { "id": "main", "workspace": "..." }, |
| 138 | + { "id": "work", "workspace": "..." } |
| 139 | + ] |
| 140 | + }, |
| 141 | + "bindings": [ |
| 142 | + { "agentId": "work", "match": { "channel": "discord" } } |
| 143 | + ] |
| 144 | +} |
| 145 | +``` |
| 146 | + |
| 147 | +### Multi-instance Setup |
| 148 | + |
| 149 | +Run multiple app instances with different ports: |
| 150 | + |
| 151 | +```bash |
| 152 | +# Instance 1 |
| 153 | +docker-compose -p clawd-1 up -d |
| 154 | + |
| 155 | +# Instance 2 |
| 156 | +docker-compose -p clawd-2 up -d |
| 157 | +``` |
| 158 | + |
| 159 | +## Troubleshooting |
| 160 | + |
| 161 | +### Health Check Fails |
| 162 | + |
| 163 | +```bash |
| 164 | +# Check logs |
| 165 | +docker logs edgebox-clawd-ws |
| 166 | + |
| 167 | +# Verify ports are open |
| 168 | +lsof -i :18789 |
| 169 | +``` |
| 170 | + |
| 171 | +### Can't Connect from Local Client |
| 172 | + |
| 173 | +- Ensure `CLAWDBOT_GATEWAY_TOKEN` is set in both gateway and client |
| 174 | +- Check network connectivity: `ping clawd.local` |
| 175 | +- Verify firewall allows port 18789 |
| 176 | + |
| 177 | +### Channel Credentials Not Loading |
| 178 | + |
| 179 | +- Set env variables in docker-compose or Edgebox dashboard |
| 180 | +- Restart the container after changing credentials |
| 181 | +- Check logs for auth errors |
| 182 | + |
| 183 | +## Resources |
| 184 | + |
| 185 | +- **Clawdbot Docs**: https://docs.clawd.bot |
| 186 | +- **Clawdbot GitHub**: https://github.com/clawdbot/clawdbot |
| 187 | +- **Edgebox Docs**: https://edgebox.io |
| 188 | +- **Clawdbot Discord**: https://discord.com/invite/clawd |
| 189 | + |
| 190 | +## License |
| 191 | + |
| 192 | +MIT - Same as Clawdbot |
0 commit comments