Skip to content

Commit ee8cc41

Browse files
committed
Rename clawdbot to moltbot throughout codebase
Comprehensive rename from Clawdbot to Moltbot to align with the public rebrand. The underlying CLI tool is still named 'clawdbot' so internal paths and CLI commands remain unchanged. File renames: - start-clawdbot.sh -> start-moltbot.sh - clawdbot.json.template -> moltbot.json.template Code renames: - ClawdbotEnv -> MoltbotEnv - CLAWDBOT_PORT -> MOLTBOT_PORT - CLAWDBOT_BUCKET -> MOLTBOT_BUCKET - CLAWDBOT_GATEWAY_TOKEN -> MOLTBOT_GATEWAY_TOKEN (user-facing env var) - findExistingClawdbotProcess -> findExistingMoltbotProcess - ensureClawdbotGateway -> ensureMoltbotGateway - R2 bucket: clawdbot-data -> moltbot-data - R2 mount path: /data/clawdbot -> /data/moltbot - Sandbox ID: 'clawdbot' -> 'moltbot' UI updates: - Admin page title: 'Clawdbot Admin' -> 'Moltbot Admin' - index.html title updated Documentation updates: - README.md updated with new bucket name - AGENTS.md fully updated with new naming - .dev.vars.example updated Unchanged (container still uses these internally): - /root/.clawdbot (config directory) - clawdbot.json (config file) - clawdbot CLI commands (devices list, gateway, etc.) - CLAWDBOT_GATEWAY_TOKEN, CLAWDBOT_DEV_MODE (container env vars mapped from user-facing names)
1 parent 1a800ec commit ee8cc41

31 files changed

Lines changed: 229 additions & 215 deletions

.dev.vars.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DEV_MODE=true
1010
DEBUG_ROUTES=true
1111

1212
# Optional - set a fixed token instead of auto-generated
13-
CLAWDBOT_GATEWAY_TOKEN=dev-token-change-in-prod
13+
MOLTBOT_GATEWAY_TOKEN=dev-token-change-in-prod
1414

1515
# Cloudflare Access configuration for /_admin and /api routes
1616
# Required for admin UI and device pairing API in production

AGENTS.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ Guidelines for AI agents working on this codebase.
44

55
## Project Overview
66

7-
This is a Cloudflare Worker that runs [Clawdbot](https://clawd.bot/) in a Cloudflare Sandbox container. It provides:
8-
- Proxying to the Clawdbot gateway (web UI + WebSocket)
7+
This is a Cloudflare Worker that runs [Moltbot](https://molt.bot/) in a Cloudflare Sandbox container. It provides:
8+
- Proxying to the Moltbot gateway (web UI + WebSocket)
99
- Admin UI at `/_admin/` for device management
1010
- API endpoints at `/api/*` for device pairing
1111
- Debug endpoints at `/debug/*` for troubleshooting
1212

13+
**Note:** The CLI tool is still named `clawdbot` (upstream hasn't renamed yet), so CLI commands and internal config paths still use that name.
14+
1315
## Project Structure
1416

1517
```
@@ -21,7 +23,7 @@ src/
2123
│ ├── jwt.ts # JWT verification
2224
│ ├── jwks.ts # JWKS fetching and caching
2325
│ └── middleware.ts # Hono middleware for auth
24-
├── gateway/ # Clawdbot gateway management
26+
├── gateway/ # Moltbot gateway management
2527
│ ├── process.ts # Process lifecycle (find, start)
2628
│ ├── env.ts # Environment variable building
2729
│ ├── r2.ts # R2 bucket mounting
@@ -43,11 +45,12 @@ src/
4345

4446
- `DEV_MODE` - Skips CF Access auth AND bypasses device pairing (maps to `CLAWDBOT_DEV_MODE` for container)
4547
- `DEBUG_ROUTES` - Enables `/debug/*` routes (disabled by default)
46-
- See `src/types.ts` for full `ClawdbotEnv` interface
48+
- See `src/types.ts` for full `MoltbotEnv` interface
4749

4850
### CLI Commands
4951

50-
When calling the clawdbot CLI from the worker, always include `--url ws://localhost:18789`:
52+
When calling the moltbot CLI from the worker, always include `--url ws://localhost:18789`.
53+
Note: The CLI is still named `clawdbot` until upstream renames it:
5154
```typescript
5255
sandbox.startProcess('clawdbot devices list --json --url ws://localhost:18789')
5356
```
@@ -111,7 +114,7 @@ Browser
111114
112115
┌─────────────────────────────────────┐
113116
│ Cloudflare Worker (index.ts) │
114-
│ - Starts Clawdbot in sandbox │
117+
│ - Starts Moltbot in sandbox
115118
│ - Proxies HTTP/WebSocket requests │
116119
│ - Passes secrets as env vars │
117120
└──────────────┬──────────────────────┘
@@ -120,7 +123,7 @@ Browser
120123
┌─────────────────────────────────────┐
121124
│ Cloudflare Sandbox Container │
122125
│ ┌───────────────────────────────┐ │
123-
│ │ Clawdbot Gateway │ │
126+
│ │ Moltbot Gateway │ │
124127
│ │ - Control UI on port 18789 │ │
125128
│ │ - WebSocket RPC protocol │ │
126129
│ │ - Agent runtime │ │
@@ -133,9 +136,9 @@ Browser
133136
| File | Purpose |
134137
|------|---------|
135138
| `src/index.ts` | Worker that manages sandbox lifecycle and proxies requests |
136-
| `Dockerfile` | Container image based on `cloudflare/sandbox` with Node 22 + Clawdbot |
137-
| `start-clawdbot.sh` | Startup script that configures clawdbot from env vars and launches gateway |
138-
| `clawdbot.json.template` | Default Clawdbot configuration template |
139+
| `Dockerfile` | Container image based on `cloudflare/sandbox` with Node 22 + Moltbot |
140+
| `start-moltbot.sh` | Startup script that configures moltbot from env vars and launches gateway |
141+
| `moltbot.json.template` | Default Moltbot configuration template |
139142
| `wrangler.jsonc` | Cloudflare Worker + Container configuration |
140143

141144
## Local Development
@@ -163,42 +166,44 @@ Local development with `wrangler dev` has issues proxying WebSocket connections
163166

164167
## Docker Image Caching
165168

166-
The Dockerfile includes a cache bust comment. When changing `clawdbot.json.template` or `start-clawdbot.sh`, bump the version:
169+
The Dockerfile includes a cache bust comment. When changing `moltbot.json.template` or `start-moltbot.sh`, bump the version:
167170

168171
```dockerfile
169172
# Build cache bust: 2026-01-26-v10
170173
```
171174

172175
## Gateway Configuration
173176

174-
Clawdbot configuration is built at container startup:
177+
Moltbot configuration is built at container startup:
175178

176-
1. `clawdbot.json.template` is copied to `~/.clawdbot/clawdbot.json`
177-
2. `start-clawdbot.sh` updates the config with values from environment variables
179+
1. `moltbot.json.template` is copied to `~/.clawdbot/clawdbot.json` (internal path unchanged)
180+
2. `start-moltbot.sh` updates the config with values from environment variables
178181
3. Gateway starts with `--allow-unconfigured` flag (skips onboarding wizard)
179182

180183
### Container Environment Variables
181184

185+
These are the env vars passed TO the container (internal names):
186+
182187
| Variable | Config Path | Notes |
183188
|----------|-------------|-------|
184-
| `ANTHROPIC_API_KEY` | (env var) | Clawdbot reads directly from env |
185-
| `CLAWDBOT_GATEWAY_TOKEN` | `--token` flag | If not set, random token is generated |
186-
| `CLAWDBOT_DEV_MODE` | `controlUi.allowInsecureAuth` | Set to `true` for local dev (allows HTTP auth) |
189+
| `ANTHROPIC_API_KEY` | (env var) | Moltbot reads directly from env |
190+
| `CLAWDBOT_GATEWAY_TOKEN` | `--token` flag | Mapped from `MOLTBOT_GATEWAY_TOKEN` |
191+
| `CLAWDBOT_DEV_MODE` | `controlUi.allowInsecureAuth` | Mapped from `DEV_MODE` |
187192
| `TELEGRAM_BOT_TOKEN` | `channels.telegram.botToken` | |
188193
| `DISCORD_BOT_TOKEN` | `channels.discord.token` | |
189194
| `SLACK_BOT_TOKEN` | `channels.slack.botToken` | |
190195
| `SLACK_APP_TOKEN` | `channels.slack.appToken` | |
191196

192-
## Clawdbot Config Schema
197+
## Moltbot Config Schema
193198

194-
Clawdbot has strict config validation. Common gotchas:
199+
Moltbot has strict config validation. Common gotchas:
195200

196201
- `agents.defaults.model` must be `{ "primary": "model/name" }` not a string
197202
- `gateway.mode` must be `"local"` for headless operation
198203
- No `webchat` channel - the Control UI is served automatically
199204
- `gateway.bind` is not a config option - use `--bind` CLI flag
200205

201-
See [Clawdbot docs](https://docs.clawd.bot/gateway/configuration) for full schema.
206+
See [Moltbot docs](https://docs.molt.bot/gateway/configuration) for full schema.
202207

203208
## Common Tasks
204209

@@ -211,7 +216,7 @@ See [Clawdbot docs](https://docs.clawd.bot/gateway/configuration) for full schem
211216

212217
### Adding a New Environment Variable
213218

214-
1. Add to `ClawdbotEnv` interface in `src/types.ts`
219+
1. Add to `MoltbotEnv` interface in `src/types.ts`
215220
2. If passed to container, add to `buildEnvVars()` in `src/gateway/env.ts`
216221
3. Update `.dev.vars.example`
217222
4. Document in README.md secrets table
@@ -230,12 +235,12 @@ Enable debug routes with `DEBUG_ROUTES=true` and check `/debug/processes`.
230235

231236
## R2 Storage Notes
232237

233-
R2 is mounted via s3fs at `/data/clawdbot`. Important gotchas:
238+
R2 is mounted via s3fs at `/data/moltbot`. Important gotchas:
234239

235240
- **rsync compatibility**: Use `rsync -r --no-times` instead of `rsync -a`. s3fs doesn't support setting timestamps, which causes rsync to fail with "Input/output error".
236241

237242
- **Mount checking**: Don't rely on `sandbox.mountBucket()` error messages to detect "already mounted" state. Instead, check `mount | grep s3fs` to verify the mount status.
238243

239-
- **Never delete R2 data**: The mount directory `/data/clawdbot` IS the R2 bucket. Running `rm -rf /data/clawdbot/*` will DELETE your backup data. Always check mount status before any destructive operations.
244+
- **Never delete R2 data**: The mount directory `/data/moltbot` IS the R2 bucket. Running `rm -rf /data/moltbot/*` will DELETE your backup data. Always check mount status before any destructive operations.
240245

241246
- **Process status**: The sandbox API's `proc.status` may not update immediately after a process completes. Instead of checking `proc.status === 'completed'`, verify success by checking for expected output (e.g., timestamp file exists after sync).

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ RUN apt-get update && apt-get install -y xz-utils ca-certificates rsync \
1414
# Install pnpm globally
1515
RUN npm install -g pnpm
1616

17-
# Install clawdbot globally
18-
RUN npm install -g clawdbot@latest \
17+
# Install moltbot (CLI is still named clawdbot until upstream renames)
18+
# Pin to specific version for reproducible builds
19+
RUN npm install -g clawdbot@2026.1.24-3 \
1920
&& clawdbot --version
2021

21-
# Create clawdbot directories
22-
# Note: When R2 is mounted, CLAWDBOT_STATE_DIR env var points to the mount path
22+
# Create moltbot directories (paths still use clawdbot until upstream renames)
2323
# Templates are stored in /root/.clawdbot-templates for initialization
2424
RUN mkdir -p /root/.clawdbot \
2525
&& mkdir -p /root/.clawdbot-templates \
2626
&& mkdir -p /root/clawd \
2727
&& mkdir -p /root/clawd/skills
2828

2929
# Copy startup script
30-
# Build cache bust: 2026-01-28-v22-force-rebuild
31-
COPY start-clawdbot.sh /usr/local/bin/start-clawdbot.sh
32-
RUN chmod +x /usr/local/bin/start-clawdbot.sh
30+
# Build cache bust: 2026-01-28-v23-moltbot-rename
31+
COPY start-moltbot.sh /usr/local/bin/start-moltbot.sh
32+
RUN chmod +x /usr/local/bin/start-moltbot.sh
3333

3434
# Copy default configuration template
35-
COPY clawdbot.json.template /root/.clawdbot-templates/clawdbot.json.template
35+
COPY moltbot.json.template /root/.clawdbot-templates/moltbot.json.template
3636

3737
# Set working directory
3838
WORKDIR /root/clawd

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ npx wrangler secret put ANTHROPIC_API_KEY
6161

6262
# Generate and set a gateway token (required for remote access)
6363
# Save this token - you'll need it to access the Control UI
64-
export CLAWDBOT_GATEWAY_TOKEN=$(openssl rand -base64 32 | tr -d '=+/' | head -c 32)
65-
echo "Your gateway token: $CLAWDBOT_GATEWAY_TOKEN"
66-
echo "$CLAWDBOT_GATEWAY_TOKEN" | npx wrangler secret put CLAWDBOT_GATEWAY_TOKEN
64+
export MOLTBOT_GATEWAY_TOKEN=$(openssl rand -base64 32 | tr -d '=+/' | head -c 32)
65+
echo "Your gateway token: $MOLTBOT_GATEWAY_TOKEN"
66+
echo "$MOLTBOT_GATEWAY_TOKEN" | npx wrangler secret put MOLTBOT_GATEWAY_TOKEN
6767

6868
# Deploy
6969
npm run deploy
@@ -182,7 +182,7 @@ By default, moltbot data (configs, paired devices, conversation history) is lost
182182
1. Go to **R2** > **Overview** in the [Cloudflare Dashboard](https://dash.cloudflare.com/)
183183
2. Click **Manage R2 API Tokens**
184184
3. Create a new token with **Object Read & Write** permissions
185-
4. Select the `clawdbot-data` bucket (created automatically on first deploy)
185+
4. Select the `moltbot-data` bucket (created automatically on first deploy)
186186
5. Copy the **Access Key ID** and **Secret Access Key**
187187

188188
### 2. Set Secrets
@@ -205,11 +205,11 @@ To find your Account ID: Go to the [Cloudflare Dashboard](https://dash.cloudflar
205205
R2 storage uses a backup/restore approach for simplicity:
206206

207207
**On container startup:**
208-
- If R2 is mounted and contains backup data, it's restored to `/root/.clawdbot`
208+
- If R2 is mounted and contains backup data, it's restored to the moltbot config directory
209209
- Moltbot uses its default paths (no special configuration needed)
210210

211211
**During operation:**
212-
- A cron job runs every 5 minutes to sync `/root/.clawdbot` R2
212+
- A cron job runs every 5 minutes to sync the moltbot config to R2
213213
- You can also trigger a manual backup from the admin UI at `/_admin/`
214214

215215
**In the admin UI:**
@@ -338,7 +338,7 @@ npm run deploy
338338
| `OPENAI_API_KEY` | No | OpenAI API key (alternative to Anthropic) |
339339
| `CF_ACCESS_TEAM_DOMAIN` | Yes* | Cloudflare Access team domain (required for admin UI) |
340340
| `CF_ACCESS_AUD` | Yes* | Cloudflare Access application audience (required for admin UI) |
341-
| `CLAWDBOT_GATEWAY_TOKEN` | Yes | Gateway token for authentication (pass via `?token=` query param) |
341+
| `MOLTBOT_GATEWAY_TOKEN` | Yes | Gateway token for authentication (pass via `?token=` query param) |
342342
| `DEV_MODE` | No | Set to `true` to skip CF Access auth + device pairing (local dev only) |
343343
| `DEBUG_ROUTES` | No | Set to `true` to enable `/debug/*` routes |
344344
| `SANDBOX_SLEEP_AFTER` | No | Container sleep timeout: `never` (default) or duration like `10m`, `1h` |

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>Clawdbot Admin</title>
6+
<title>Moltbot Admin</title>
77
</head>
88
<body>
99
<div id="root"></div>

package-lock.json

Lines changed: 8 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@cloudflare/puppeteer": "^1.0.5",
20+
"@cloudflare/townlake-trino-client": "^0.2.0",
2021
"hono": "^4.11.6",
2122
"react": "^19.0.0",
2223
"react-dom": "^19.0.0"

src/assets/config-error.html

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,23 @@
121121
margin-top: 8px;
122122
}
123123

124+
.instructions a {
125+
color: rgb(244, 129, 32);
126+
text-decoration: none;
127+
}
128+
129+
.instructions a:hover {
130+
text-decoration: underline;
131+
}
132+
124133
.info {
125134
font-size: 0.8rem;
126135
color: #707070;
127136
margin-top: 30px;
128137
}
129138

130139
.info a {
131-
color: #60a5fa;
140+
color: rgb(244, 129, 32);
132141
text-decoration: none;
133142
}
134143

@@ -156,15 +165,14 @@ <h2>Missing Variables</h2>
156165
<h2>How to Fix</h2>
157166
<p>Set the missing secrets using the Wrangler CLI:</p>
158167
<pre>wrangler secret put &lt;VARIABLE_NAME&gt;</pre>
159-
<p style="margin-top: 16px; margin-bottom: 0;">
168+
<p style="margin-top: 16px;">
160169
For example: <code>wrangler secret put ANTHROPIC_API_KEY</code>
161170
</p>
171+
<p style="margin-bottom: 0;">
172+
After setting the secrets, refresh this page to continue.
173+
See the <a href="https://github.com/cloudflare/moltworker" target="_blank">README</a> for full setup instructions.
174+
</p>
162175
</div>
163-
164-
<p class="info">
165-
After setting the secrets, refresh this page to continue.<br>
166-
See the <a href="https://github.com/cloudflare/moltworker" target="_blank">README</a> for full setup instructions.
167-
</p>
168176
</div>
169177
</body>
170178
</html>

src/assets/loading.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
@keyframes pulse {
3939
0%, 100% { opacity: 1; transform: scale(1); }
40-
50% { opacity: 0.95; transform: scale(0.98); }
40+
50% { opacity: 0.9; transform: scale(0.95); }
4141
}
4242

4343
h1 {

0 commit comments

Comments
 (0)