clawmacdo 0.38.0 → 0.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +148 -2
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Rust CLI tool for deploying [OpenClaw](https://openclaw.ai) to **DigitalOcean**, **AWS Lightsail**, **Tencent Cloud**, **Microsoft Azure**, or **BytePlus Cloud** — with Claude Code, Codex, and Gemini CLI pre-installed.
7
7
 
8
- ## ✨ What's New in v0.38.0
8
+ ## ✨ What's New in v0.40.1
9
9
 
10
10
  - **`update-model` subcommand** — change the AI model on a running OpenClaw instance without redeploying (updates API keys, provider config, model settings, and restarts the gateway)
11
11
  - **`update-ip` subcommand** — refresh the IP address of a deployed instance from the cloud provider API (Lightsail, DigitalOcean, BytePlus) and update both JSON deploy record and SQLite
@@ -21,6 +21,8 @@ Rust CLI tool for deploying [OpenClaw](https://openclaw.ai) to **DigitalOcean**,
21
21
  - **AWS credential passthrough** — web UI credentials are written to `~/.aws/credentials` so the AWS CLI uses them instead of stale local config
22
22
  - **Lightsail destroy with credentials** — destroy modal now prompts for AWS Access Key ID and Secret Access Key
23
23
  - **Lightsail snapshot listing** — credentials from the web UI are now passed through to the AWS CLI for snapshot listing
24
+ - **`whatsapp-setup` subcommand** — set up WhatsApp on a deployed instance (set phone number, enable plugin, restart gateway, fetch pairing QR code)
25
+ - **`whatsapp-qr` subcommand** — fetch the WhatsApp pairing QR code from a deployed instance (re-fetch if expired)
24
26
  - **`plugin-install` subcommand** — install OpenClaw plugins on deployed instances via `clawmacdo plugin-install --instance <id> --plugin @openguardrails/moltguard` (installs via pnpm, enables plugin, restarts gateway)
25
27
  - **Windows PowerShell scripts** — all shell scripts now have `.ps1` equivalents for Windows support (`release.ps1`, `npm-package.ps1`, `npm-publish.ps1`, scan scripts, etc.)
26
28
  - **Agent Docker Access warning** — deploy form shows the common Docker socket permission error with a clear fix instruction
@@ -207,6 +209,150 @@ cargo build --release --no-default-features --features aws-only
207
209
  | `aws-only` | Lightsail-only build (no DO or Tencent) | ❌ |
208
210
  | `minimal` | CLI-only, no web UI or optional features | ❌ |
209
211
 
212
+ ## Programmatic Usage (Node.js)
213
+
214
+ The npm package exports `getBinaryPath()` so you can call clawmacdo from Node.js scripts or automation tools.
215
+
216
+ ```bash
217
+ npm install clawmacdo
218
+ ```
219
+
220
+ ```javascript
221
+ const { execSync, spawn } = require("child_process");
222
+ const { getBinaryPath } = require("clawmacdo");
223
+
224
+ const bin = getBinaryPath(); // absolute path to the clawmacdo binary
225
+
226
+ // --- Deploy a new instance ---
227
+ const deploy = execSync(`${bin} deploy \
228
+ --provider lightsail \
229
+ --customer-name "my-openclaw" \
230
+ --customer-email "you@example.com" \
231
+ --aws-access-key-id "${process.env.AWS_ACCESS_KEY_ID}" \
232
+ --aws-secret-access-key "${process.env.AWS_SECRET_ACCESS_KEY}" \
233
+ --anthropic-key "${process.env.ANTHROPIC_API_KEY}" \
234
+ --primary-model anthropic \
235
+ --json`, { encoding: "utf8" });
236
+ console.log(JSON.parse(deploy));
237
+
238
+ // --- Track deploy progress (streaming) ---
239
+ const track = spawn(bin, ["track", "<deploy-id>", "--follow", "--json"]);
240
+ track.stdout.on("data", (chunk) => {
241
+ console.log("progress:", chunk.toString());
242
+ });
243
+
244
+ // --- Set up Telegram bot ---
245
+ execSync(`${bin} telegram-setup \
246
+ --instance <deploy-id> \
247
+ --bot-token "${process.env.TELEGRAM_TOKEN}"`, { stdio: "inherit" });
248
+
249
+ // --- Set up WhatsApp (displays QR code) ---
250
+ execSync(`${bin} whatsapp-setup \
251
+ --instance <deploy-id> \
252
+ --phone-number "+6512345678"`, { stdio: "inherit" });
253
+
254
+ // --- Fetch WhatsApp QR code ---
255
+ const qr = execSync(`${bin} whatsapp-qr --instance <deploy-id>`, { encoding: "utf8" });
256
+ console.log(qr); // ASCII QR code
257
+
258
+ // --- Change AI model ---
259
+ execSync(`${bin} update-model \
260
+ --instance <deploy-id> \
261
+ --primary-model openai \
262
+ --openai-key "${process.env.OPENAI_API_KEY}"`, { stdio: "inherit" });
263
+
264
+ // --- Install a plugin ---
265
+ execSync(`${bin} plugin-install \
266
+ --instance <deploy-id> \
267
+ --plugin "@openguardrails/moltguard"`, { stdio: "inherit" });
268
+
269
+ // --- Refresh IP after restart ---
270
+ execSync(`${bin} update-ip --instance <deploy-id>`, { stdio: "inherit" });
271
+
272
+ // --- Create snapshot ---
273
+ execSync(`${bin} do-snapshot \
274
+ --do-token "${process.env.DO_TOKEN}" \
275
+ --droplet-id 12345 \
276
+ --snapshot-name "my-backup"`, { stdio: "inherit" });
277
+
278
+ // --- Restore from snapshot ---
279
+ execSync(`${bin} do-restore \
280
+ --do-token "${process.env.DO_TOKEN}" \
281
+ --snapshot-name "my-backup"`, { stdio: "inherit" });
282
+
283
+ // --- Destroy an instance ---
284
+ execSync(`${bin} destroy \
285
+ --provider digitalocean \
286
+ --do-token "${process.env.DO_TOKEN}" \
287
+ --name "openclaw-abc123" --yes`, { stdio: "inherit" });
288
+
289
+ // --- Start the web UI programmatically ---
290
+ const server = spawn(bin, ["serve", "--port", "3456"], { stdio: "inherit" });
291
+ ```
292
+
293
+ ### TypeScript
294
+
295
+ ```typescript
296
+ import { getBinaryPath } from "clawmacdo";
297
+ import { execSync } from "child_process";
298
+
299
+ const bin: string = getBinaryPath();
300
+ execSync(`${bin} deploy --provider lightsail ...`, { stdio: "inherit" });
301
+ ```
302
+
303
+ ## Quick Start (CLI)
304
+
305
+ ```bash
306
+ # Install
307
+ npm install -g clawmacdo
308
+
309
+ # Deploy to DigitalOcean
310
+ clawmacdo deploy --provider digitalocean \
311
+ --customer-name "my-openclaw" --customer-email "you@example.com" \
312
+ --do-token "$DO_TOKEN" --anthropic-key "$ANTHROPIC_API_KEY"
313
+
314
+ # Deploy to AWS Lightsail
315
+ clawmacdo deploy --provider lightsail \
316
+ --customer-name "my-openclaw" --customer-email "you@example.com" \
317
+ --aws-access-key-id "$AWS_ACCESS_KEY_ID" \
318
+ --aws-secret-access-key "$AWS_SECRET_ACCESS_KEY"
319
+
320
+ # Track deploy progress
321
+ clawmacdo track <deploy-id> --follow
322
+
323
+ # Set up Telegram bot
324
+ clawmacdo telegram-setup --instance <deploy-id> --bot-token "$TELEGRAM_TOKEN"
325
+ clawmacdo telegram-pair --instance <deploy-id> --code <PAIRING_CODE>
326
+
327
+ # Set up WhatsApp (displays QR code to scan)
328
+ clawmacdo whatsapp-setup --instance <deploy-id> --phone-number "+6512345678"
329
+ clawmacdo whatsapp-qr --instance <deploy-id> # re-fetch QR if expired
330
+
331
+ # Change AI model on a running instance
332
+ clawmacdo update-model --instance <deploy-id> \
333
+ --primary-model openai --openai-key "$OPENAI_API_KEY"
334
+
335
+ # Install a plugin
336
+ clawmacdo plugin-install --instance <deploy-id> --plugin "@openguardrails/moltguard"
337
+
338
+ # Refresh IP after instance restart
339
+ clawmacdo update-ip --instance <deploy-id>
340
+
341
+ # Enable Tailscale Funnel (public HTTPS access)
342
+ clawmacdo tailscale-funnel --instance <deploy-id> --auth-key "$TAILSCALE_AUTH_KEY"
343
+ clawmacdo funnel-on --instance <deploy-id>
344
+
345
+ # Create and restore snapshots
346
+ clawmacdo do-snapshot --do-token "$DO_TOKEN" --droplet-id 12345 --snapshot-name "backup"
347
+ clawmacdo do-restore --do-token "$DO_TOKEN" --snapshot-name "backup"
348
+
349
+ # Destroy an instance
350
+ clawmacdo destroy --provider digitalocean --do-token "$DO_TOKEN" --name "openclaw-abc123"
351
+
352
+ # Start the web UI
353
+ clawmacdo serve --port 3456
354
+ ```
355
+
210
356
  ## Usage
211
357
 
212
358
  > **Full CLI reference with all examples, curl commands, and sample responses:** [docs/clawmacdo_usage.md](docs/clawmacdo_usage.md)
@@ -773,7 +919,7 @@ See [CHANGELOG.md](CHANGELOG.md) for version history and breaking changes.
773
919
  ---
774
920
 
775
921
  **Last updated:** March 19, 2026
776
- **Current version:** 0.38.0
922
+ **Current version:** 0.40.1
777
923
  **Architecture version:** 2.0 (modular workspace)
778
924
 
779
925
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawmacdo",
3
- "version": "0.38.0",
3
+ "version": "0.40.1",
4
4
  "description": "CLI tool for deploying OpenClaw to multiple cloud providers with pre-installed AI dev tools",
5
5
  "keywords": [
6
6
  "openclaw",
@@ -30,8 +30,8 @@
30
30
  "node": ">=16"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@clawmacdo/darwin-arm64": "0.38.0",
34
- "@clawmacdo/linux-x64": "0.38.0",
35
- "@clawmacdo/win32-x64": "0.38.0"
33
+ "@clawmacdo/darwin-arm64": "0.40.1",
34
+ "@clawmacdo/linux-x64": "0.40.1",
35
+ "@clawmacdo/win32-x64": "0.40.1"
36
36
  }
37
37
  }