Skip to content

Commit bb8f29c

Browse files
VinciGit00claude
andcommitted
feat: minify JSON output when --json flag is used
Output compact JSON (no whitespace) in --json mode to save tokens when piped to AI agents. Closes #6 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 524ee2f commit bb8f29c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ JUST_SCRAPE_DEBUG=1 just-scrape ... # Debug logging to stderr
8686

8787
## JSON Mode (`--json`)
8888

89-
All commands support `--json` for machine-readable output. When set, banner, spinners, and interactive prompts are suppressed — only raw JSON on stdout.
89+
All commands support `--json` for machine-readable output. When set, banner, spinners, and interactive prompts are suppressed — only minified JSON on stdout (saves tokens when piped to AI agents).
9090

9191
```bash
9292
just-scrape credits --json | jq '.remaining_credits'

src/lib/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function create(quiet = false) {
3030
if (!quiet) s.message(`Status: ${status}`);
3131
},
3232
result(data: unknown) {
33-
if (quiet) console.log(JSON.stringify(data, null, 2));
33+
if (quiet) console.log(JSON.stringify(data));
3434
else console.log(`\n${highlight(JSON.stringify(data, null, 2))}\n`);
3535
},
3636
error(message?: string) {

0 commit comments

Comments
 (0)