clawon 0.1.6 → 0.1.8

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 (3) hide show
  1. package/README.md +16 -0
  2. package/dist/index.js +16 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -132,6 +132,22 @@ Each archive contains:
132
132
 
133
133
  Config is stored at `~/.clawon/config.json` after running `clawon login`. Contains your API key, profile ID, and API URL. Run `clawon logout` to remove it.
134
134
 
135
+ ## Telemetry
136
+
137
+ Clawon collects anonymous usage events (e.g. "backup created", "restore completed") to understand which features are used. No file contents, filenames, or personal data are sent.
138
+
139
+ **To opt out**, set either environment variable:
140
+
141
+ ```bash
142
+ # Standard convention (https://consoledonottrack.com)
143
+ export DO_NOT_TRACK=1
144
+
145
+ # Or Clawon-specific
146
+ export CLAWON_NO_TELEMETRY=1
147
+ ```
148
+
149
+ Telemetry is powered by [PostHog](https://posthog.com). The public project key is visible in the source code.
150
+
135
151
  ## Requirements
136
152
 
137
153
  - Node.js 18+
package/dist/index.js CHANGED
@@ -136,7 +136,11 @@ async function extractLocalArchive(archivePath, targetDir) {
136
136
  return meta;
137
137
  }
138
138
  var POSTHOG_KEY = "phc_LGJC4ZrED6EiK0sC1fusErOhR6gHlFCS5Qs7ou93SmV";
139
+ function telemetryDisabled() {
140
+ return process.env.DO_NOT_TRACK === "1" || process.env.CLAWON_NO_TELEMETRY === "1";
141
+ }
139
142
  function trackCliEvent(distinctId, event, properties = {}) {
143
+ if (telemetryDisabled()) return;
140
144
  fetch("https://us.i.posthog.com/capture/", {
141
145
  method: "POST",
142
146
  headers: { "content-type": "application/json" },
@@ -166,6 +170,7 @@ program.command("login").description("Connect to Clawon with your API key").requ
166
170
  });
167
171
  console.log("\u2713 Logged in");
168
172
  console.log(` Profile ID: ${connectJson.profileId}`);
173
+ trackCliEvent(connectJson.profileId, "cli_login");
169
174
  } catch (e) {
170
175
  console.error(`\u2717 Login failed: ${e.message}`);
171
176
  process.exit(1);
@@ -346,6 +351,7 @@ program.command("list").description("List your backups").option("--limit <n>", "
346
351
  }
347
352
  console.log(`
348
353
  Total: ${snapshots.length} backup(s)`);
354
+ trackCliEvent(cfg.profileId, "cli_list_viewed", { count: snapshots.length });
349
355
  } catch (e) {
350
356
  console.error(`\u2717 Failed to list backups: ${e.message}`);
351
357
  process.exit(1);
@@ -403,6 +409,7 @@ program.command("activity").description("Show recent activity").option("--limit
403
409
  const details = formatEventDetails(ev.payload);
404
410
  console.log(`${date.padEnd(20)} | ${label.padEnd(18)} | ${details}`);
405
411
  }
412
+ trackCliEvent(cfg.profileId, "cli_activity_viewed");
406
413
  } catch (e) {
407
414
  console.error(`\u2717 Failed to load activity: ${e.message}`);
408
415
  process.exit(1);
@@ -442,6 +449,7 @@ program.command("delete [id]").description("Delete a snapshot").option("--oldest
442
449
  snapshotId
443
450
  });
444
451
  console.log(`\u2713 Deleted snapshot ${snapshotId}`);
452
+ trackCliEvent(cfg.profileId, "cloud_backup_deleted");
445
453
  } catch (e) {
446
454
  console.error(`\u2717 Delete failed: ${e.message}`);
447
455
  process.exit(1);
@@ -476,6 +484,8 @@ program.command("discover").description("Preview which files would be included i
476
484
  console.log(`
477
485
  Total: ${files.length} files (${(totalSize / 1024).toFixed(1)} KB)`);
478
486
  console.log(`Source: ${OPENCLAW_DIR}`);
487
+ const cfg = readConfig();
488
+ trackCliEvent(cfg?.profileId || "anonymous", "cli_discover", { file_count: files.length });
479
489
  });
480
490
  program.command("files").description("List files in a backup").option("--snapshot <id>", "Snapshot ID (default: latest)").action(async (opts) => {
481
491
  const cfg = readConfig();
@@ -512,6 +522,7 @@ program.command("files").description("List files in a backup").option("--snapsho
512
522
  }
513
523
  console.log(`
514
524
  Total: ${files.length} files`);
525
+ trackCliEvent(cfg.profileId, "cli_files_viewed", { file_count: files.length });
515
526
  } catch (e) {
516
527
  console.error(`\u2717 Failed to list files: ${e.message}`);
517
528
  process.exit(1);
@@ -580,6 +591,8 @@ local.command("list").description("List local backups").action(async () => {
580
591
  }
581
592
  console.log(`
582
593
  Total: ${entries.length} backup(s)`);
594
+ const cfg = readConfig();
595
+ trackCliEvent(cfg?.profileId || "anonymous", "local_list_viewed", { count: entries.length });
583
596
  console.log(`
584
597
  Restore a backup:`);
585
598
  console.log(` clawon local restore Restore the latest backup (#1)`);
@@ -658,11 +671,14 @@ program.command("status").description("Show current status").action(async () =>
658
671
  } else {
659
672
  console.log(`\u2717 OpenClaw not found: ${OPENCLAW_DIR}`);
660
673
  }
674
+ trackCliEvent(cfg?.profileId || "anonymous", "cli_status_viewed");
661
675
  });
662
676
  program.command("logout").description("Remove local credentials").action(() => {
677
+ const cfg = readConfig();
663
678
  if (fs.existsSync(CONFIG_PATH)) {
664
679
  fs.unlinkSync(CONFIG_PATH);
665
680
  console.log("\u2713 Logged out");
681
+ trackCliEvent(cfg?.profileId || "anonymous", "cli_logout");
666
682
  } else {
667
683
  console.log("Already logged out");
668
684
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawon",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Backup and restore your OpenClaw workspace",
5
5
  "type": "module",
6
6
  "bin": {