clawculator 2.8.0 → 2.8.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.
package/package.json
CHANGED
|
@@ -38,7 +38,16 @@ node {baseDir}/run.js --md
|
|
|
38
38
|
|
|
39
39
|
Return the full markdown report to the user inline.
|
|
40
40
|
|
|
41
|
+
When the user types `snapshot`, `share my grade`, `cost grade`, `clawculator snapshot`, or `what's my grade`, run:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
node {baseDir}/run.js --snapshot
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Return the terminal card output to the user. This shows their grade (A+ to D), cost range, setup complexity, and findings — designed to be screenshot and shared.
|
|
48
|
+
|
|
41
49
|
**Flags**
|
|
50
|
+
- `--snapshot` — shareable grade card (terminal output, screenshot-ready)
|
|
42
51
|
- `--md` — write markdown report and print to stdout
|
|
43
52
|
- `--json` — machine-readable JSON to stdout
|
|
44
53
|
- `--out=PATH` — custom output path for `--md`
|
|
@@ -10,11 +10,12 @@ const fs = require('fs');
|
|
|
10
10
|
|
|
11
11
|
const args = process.argv.slice(2);
|
|
12
12
|
const flags = {
|
|
13
|
-
json:
|
|
14
|
-
md:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
json: args.includes('--json'),
|
|
14
|
+
md: args.includes('--md'),
|
|
15
|
+
snapshot: args.includes('--snapshot'),
|
|
16
|
+
help: args.includes('--help') || args.includes('-h'),
|
|
17
|
+
config: args.find(a => a.startsWith('--config='))?.split('=')[1],
|
|
18
|
+
out: args.find(a => a.startsWith('--out='))?.split('=')[1],
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const BANNER = `
|
|
@@ -81,6 +82,13 @@ async function main() {
|
|
|
81
82
|
process.exit(0);
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
if (flags.snapshot) {
|
|
86
|
+
const { generateSnapshotCard } = require('./snapshotCard');
|
|
87
|
+
const outDir = flags.out || process.cwd();
|
|
88
|
+
generateSnapshotCard(analysis, outDir);
|
|
89
|
+
process.exit(0);
|
|
90
|
+
}
|
|
91
|
+
|
|
84
92
|
if (flags.md) {
|
|
85
93
|
const outPath = flags.out || path.join(process.cwd(), 'clawculator-report.md');
|
|
86
94
|
fs.writeFileSync(outPath, generateMarkdownReport(analysis), 'utf8');
|