From 041209a875d65c7c95e563161412c15e51b1229b Mon Sep 17 00:00:00 2001 From: FrancescoSaverioZuppichini Date: Mon, 16 Feb 2026 15:36:28 +0100 Subject: [PATCH 1/2] feat: add JUST_SCRAPE_API_URL env var to override API base URL Co-Authored-By: Claude Opus 4.6 --- README.md | 12 ++++++++---- package.json | 2 +- src/lib/scrapegraphai.ts | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a8400fc..e4f8a2a 100644 --- a/README.md +++ b/README.md @@ -79,10 +79,14 @@ Four ways to provide it (checked in order): 3. **Config file**: `~/.scrapegraphai/config.json` 4. **Interactive prompt**: the CLI asks and saves to config -```bash -export JUST_SCRAPE_TIMEOUT_S=300 # Request/polling timeout in seconds (default: 120) -JUST_SCRAPE_DEBUG=1 just-scrape ... # Debug logging to stderr -``` +### Environment Variables + +| Variable | Description | Default | +|---|---|---| +| `SGAI_API_KEY` | ScrapeGraph API key | — | +| `JUST_SCRAPE_API_URL` | Override API base URL | `https://api.scrapegraphai.com/v1` | +| `JUST_SCRAPE_TIMEOUT_S` | Request/polling timeout in seconds | `120` | +| `JUST_SCRAPE_DEBUG` | Set to `1` to enable debug logging to stderr | `0` | ## JSON Mode (`--json`) diff --git a/package.json b/package.json index 3356ebb..3e95a3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "just-scrape", - "version": "0.1.7", + "version": "0.1.8", "description": "ScrapeGraph AI CLI tool", "type": "module", "main": "dist/cli.mjs", diff --git a/src/lib/scrapegraphai.ts b/src/lib/scrapegraphai.ts index 4d5f499..5cdfed6 100644 --- a/src/lib/scrapegraphai.ts +++ b/src/lib/scrapegraphai.ts @@ -36,7 +36,7 @@ export type { SmartScraperParams, } from "../types/index.js"; -const BASE_URL = "https://api.scrapegraphai.com/v1"; +const BASE_URL = process.env.JUST_SCRAPE_API_URL || "https://api.scrapegraphai.com/v1"; const POLL_INTERVAL_MS = 3000; function debug(label: string, data?: unknown) { From 82d53ae1c860d011a6603787aaa259b4b30c4b8e Mon Sep 17 00:00:00 2001 From: FrancescoSaverioZuppichini Date: Mon, 16 Feb 2026 15:39:10 +0100 Subject: [PATCH 2/2] removed space in banner from tag line --- src/utils/banner.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/banner.ts b/src/utils/banner.ts index 9a8c4f9..66c6386 100644 --- a/src/utils/banner.ts +++ b/src/utils/banner.ts @@ -19,7 +19,7 @@ const BANNER = [ "╚═╝╚═╝╚═╝ ╩ ╚═╝╚═╝╩╚═╩ ╩╩ ╚═╝", ]; -const TAGLINE = " made with ♥ from scrapegraphai team"; +const TAGLINE = "made with ♥ from scrapegraphai team"; const BANNER_COLOR = "#bd93f9"; @@ -30,5 +30,8 @@ export function showBanner() { console.log(text); console.log(chalk.hex(BANNER_COLOR)(TAGLINE)); console.log(chalk.hex(BANNER_COLOR)(`v${getVersion()}`)); + if (process.env.JUST_SCRAPE_API_URL) { + console.log(chalk.yellow(`→ Custom API: ${process.env.JUST_SCRAPE_API_URL}`)); + } console.log(); }