From bb8f29cdc82664d1febf033037a46245ed352ccb Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Mon, 16 Feb 2026 07:35:04 +0100 Subject: [PATCH 1/2] 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 --- README.md | 2 +- src/lib/log.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f829372..a8400fc 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ JUST_SCRAPE_DEBUG=1 just-scrape ... # Debug logging to stderr ## JSON Mode (`--json`) -All commands support `--json` for machine-readable output. When set, banner, spinners, and interactive prompts are suppressed — only raw JSON on stdout. +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). ```bash just-scrape credits --json | jq '.remaining_credits' diff --git a/src/lib/log.ts b/src/lib/log.ts index 68f8660..66c7467 100644 --- a/src/lib/log.ts +++ b/src/lib/log.ts @@ -30,7 +30,7 @@ export function create(quiet = false) { if (!quiet) s.message(`Status: ${status}`); }, result(data: unknown) { - if (quiet) console.log(JSON.stringify(data, null, 2)); + if (quiet) console.log(JSON.stringify(data)); else console.log(`\n${highlight(JSON.stringify(data, null, 2))}\n`); }, error(message?: string) { From ea89c970c7cc566351de995d14f58f831289c081 Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Mon, 16 Feb 2026 11:08:52 +0100 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e49bd03..3356ebb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "just-scrape", - "version": "0.1.6", + "version": "0.1.7", "description": "ScrapeGraph AI CLI tool", "type": "module", "main": "dist/cli.mjs",