feat: sync CLI with scrapegraph-js v2 PR #13 head + consolidate commands#15
Closed
VinciGit00 wants to merge 2 commits intomainfrom
Closed
feat: sync CLI with scrapegraph-js v2 PR #13 head + consolidate commands#15VinciGit00 wants to merge 2 commits intomainfrom
VinciGit00 wants to merge 2 commits intomainfrom
Conversation
Full migration of just-scrape to the v2 API via scrapegraph-js PR #13 (pinned to head 096c110). The CLI surface, commands, and flags all move to v2 semantics and a single src/commands.ts holds every endpoint. ## CLI surface - extract, search, scrape, markdownify, crawl, monitor, history, credits - monitor gains full lifecycle: create, list, get, update, delete, pause, resume, and activity (paginated tick history with --limit / --cursor) - scrape supports 8 formats (markdown, html, screenshot, branding, links, images, summary, json) plus multi-format via comma-separated -f - crawl uses the v2 formats array and supports multi-format - search gains --country, --time-range, --format - Removed from API: agentic-scraper, generate-schema, sitemap, validate - --stealth is now a separate boolean; fetch mode is --mode auto|fast|js ## Environment - New default base URL: https://api.scrapegraphai.com/api/v2 - SGAI_TIMEOUT (was SGAI_TIMEOUT_S); legacy SGAI_TIMEOUT_S and JUST_SCRAPE_TIMEOUT_S are bridged transparently - SGAI_API_KEY, SGAI_API_URL, SGAI_DEBUG honored; JUST_SCRAPE_* still bridged ## Refactor - 8 per-endpoint files under src/commands/ merged into one src/commands.ts with named exports; cli.ts imports them statically - tsup output: single dist/cli.mjs (~30 KB) instead of 8 chunks - biome override scoped to src/commands.ts - scrapegraph-js ships without a prebuilt dist/, so CI builds it in-place after install Version bumped 0.3.0 → 1.0.0 to track SDK v2.0.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aa18cc9 to
7504628
Compare
The SDK v2 exports the factory as ScrapeGraphAI (capital) and the crawl status method is crawl.get, not crawl.status. The previous names caused CI to fail with "Export named 'scrapegraphai' not found". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Syncs
just-scrapewith the latest commits on scrapegraph-js#13 (head096c110) and collapses the per-endpoint command files into a singlesrc/commands.ts.SDK sync (commits since
0738786)monitor.activityendpoint (scrapegraph-js 096c110) — paginated tick history with diffsSGAI_TIMEOUT_S→SGAI_TIMEOUTenv var rename (scrapegraph-js 2eba148)https://api.scrapegraphai.com/api/v2(baked into SDK)/health(relative to/api/v2)CLI changes
just-scrape monitor activity --id <id> [--limit N] [--cursor C]— new action callingsgai.monitor.activity()src/lib/env.tsbridges legacySGAI_TIMEOUT_S(andJUST_SCRAPE_TIMEOUT_S) →SGAI_TIMEOUTso nothing breaks for existing userspackage.jsonbumpsscrapegraph-jspin0738786→096c110, and CLI version0.3.0→1.0.0to track SDK v2.0.0README.md: documents the newactivityaction, updates env-var table, addsSGAI_DEBUGRefactor: one file per endpoint → single
src/commands.tsThe 8 tiny files under
src/commands/(extract, search, scrape, markdownify, crawl, monitor, history, credits) are now merged into a singlesrc/commands.tswith named exports.cli.tsimports them statically.buildFormatsfor monitor) be shared without an extra lib indirectioncli.mjs(~30 KB)biome.jsonoverride updated:src/commands/**→src/commands.tsTest plan
bun run check— tsc + biome cleanbun run build— bundles successfully, singledist/cli.mjsjust-scrape --help/monitor --helpshow the newactivityaction and--limit/--cursorflagsDocs follow-up in docs-mintlify#39 (already pushed).
🤖 Generated with Claude Code