clawculator 2.5.1 → 2.6.0
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.
- package/bin/clawculator.js +14 -3
- package/package.json +5 -2
- package/skills/clawculator/webDashboard.js +1219 -0
- package/src/webDashboard.js +1219 -0
package/bin/clawculator.js
CHANGED
|
@@ -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 (
|
|
41
|
-
--
|
|
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 --
|
|
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,6 +66,13 @@ async function main() {
|
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
console.log(BANNER);
|
|
69
|
+
if (flags.web) {
|
|
70
|
+
console.log(BANNER);
|
|
71
|
+
const { startWebDashboard } = require('../src/webDashboard');
|
|
72
|
+
startWebDashboard({ openclawHome, port: flags.port });
|
|
73
|
+
return; // server runs until Ctrl+C
|
|
74
|
+
}
|
|
75
|
+
|
|
65
76
|
if (flags.live) {
|
|
66
77
|
console.log(BANNER);
|
|
67
78
|
console.log(` ${D}💡 Tip: Run this in a tmux pane alongside your main session${R}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawculator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
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,8 @@
|
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=18.0.0"
|
|
32
32
|
},
|
|
33
|
-
"dependencies": {}
|
|
33
|
+
"dependencies": {},
|
|
34
|
+
"optionalDependencies": {
|
|
35
|
+
"better-sqlite3": "^11.0.0"
|
|
36
|
+
}
|
|
34
37
|
}
|