clawculator 2.5.1 → 2.6.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.
@@ -14,9 +14,11 @@ const flags = {
14
14
  json: args.includes('--json'),
15
15
  md: args.includes('--md'),
16
16
  live: args.includes('--live'),
17
+ web: args.includes('--web'),
17
18
  help: args.includes('--help') || args.includes('-h'),
18
19
  config: args.find(a => a.startsWith('--config='))?.split('=')[1],
19
20
  out: args.find(a => a.startsWith('--out='))?.split('=')[1],
21
+ port: parseInt(args.find(a => a.startsWith('--port='))?.split('=')[1] || '3457'),
20
22
  };
21
23
 
22
24
  const BANNER = `
@@ -37,9 +39,10 @@ Usage: clawculator [options]
37
39
 
38
40
  Options:
39
41
  (no flags) Full terminal analysis
40
- --live Real-time cost dashboard (watches transcripts)
41
- --md Save markdown report to ./clawculator-report.md
42
+ --live Real-time cost dashboard in terminal (great for tmux)
43
+ --web Browser dashboard at localhost:3457 (pin the tab!)
42
44
  --report Generate HTML report and open in browser
45
+ --md Save markdown report to ./clawculator-report.md
43
46
  --json Output raw JSON
44
47
  --out=PATH Custom output path for --md or --report
45
48
  --config=PATH Path to openclaw.json (auto-detected by default)
@@ -47,7 +50,8 @@ Options:
47
50
 
48
51
  Examples:
49
52
  npx clawculator # Terminal analysis
50
- npx clawculator --live # Real-time cost dashboard
53
+ npx clawculator --web # Browser dashboard (localhost:3457)
54
+ npx clawculator --live # Real-time terminal dashboard
51
55
  npx clawculator --md # Markdown report (readable by your AI agent)
52
56
  npx clawculator --report # Visual HTML dashboard
53
57
  npx clawculator --json # JSON for piping
@@ -62,18 +66,26 @@ async function main() {
62
66
  }
63
67
 
64
68
  console.log(BANNER);
69
+
70
+ const openclawHome = process.env.OPENCLAW_HOME || path.join(os.homedir(), '.openclaw');
71
+
72
+ if (flags.web) {
73
+ const { startWebDashboard } = require('../src/webDashboard');
74
+ startWebDashboard({ openclawHome, port: flags.port });
75
+ return;
76
+ }
77
+
65
78
  if (flags.live) {
66
- console.log(BANNER);
79
+ const D = '\x1b[90m', R = '\x1b[0m';
67
80
  console.log(` ${D}💡 Tip: Run this in a tmux pane alongside your main session${R}`);
68
81
  console.log(` ${D} tmux split-window -h "npx clawculator --live"${R}\n`);
69
82
  const { startLiveDashboard } = require('../src/liveDashboard');
70
83
  startLiveDashboard({ openclawHome });
71
- return; // dashboard runs until user quits
84
+ return;
72
85
  }
73
86
 
74
87
  console.log('\x1b[90mScanning your setup...\x1b[0m\n');
75
88
 
76
- const openclawHome = process.env.OPENCLAW_HOME || path.join(os.homedir(), '.openclaw');
77
89
  const configPath = flags.config || path.join(openclawHome, 'openclaw.json');
78
90
 
79
91
  // Auto-discover sessions path: find first agent with a sessions.json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawculator",
3
- "version": "2.5.1",
3
+ "version": "2.6.1",
4
4
  "description": "AI cost forensics for OpenClaw and multi-model setups. Your friendly penny pincher. 100% offline. Zero AI. Pure deterministic logic.",
5
5
  "main": "src/analyzer.js",
6
6
  "bin": {
@@ -30,5 +30,7 @@
30
30
  "engines": {
31
31
  "node": ">=18.0.0"
32
32
  },
33
- "dependencies": {}
33
+ "optionalDependencies": {
34
+ "better-sqlite3": "^11.10.0"
35
+ }
34
36
  }