Skip to content

feat: sync CLI with scrapegraph-js v2 PR #13 head + consolidate commands#15

Closed
VinciGit00 wants to merge 2 commits intomainfrom
feat/sync-sdk-v2-pr13-head
Closed

feat: sync CLI with scrapegraph-js v2 PR #13 head + consolidate commands#15
VinciGit00 wants to merge 2 commits intomainfrom
feat/sync-sdk-v2-pr13-head

Conversation

@VinciGit00
Copy link
Copy Markdown
Member

Summary

Syncs just-scrape with the latest commits on scrapegraph-js#13 (head 096c110) and collapses the per-endpoint command files into a single src/commands.ts.

SDK sync (commits since 0738786)

  • New monitor.activity endpoint (scrapegraph-js 096c110) — paginated tick history with diffs
  • SGAI_TIMEOUT_SSGAI_TIMEOUT env var rename (scrapegraph-js 2eba148)
  • Default base URL now https://api.scrapegraphai.com/api/v2 (baked into SDK)
  • Health endpoint path fixed to /health (relative to /api/v2)

CLI changes

  • just-scrape monitor activity --id <id> [--limit N] [--cursor C] — new action calling sgai.monitor.activity()
  • src/lib/env.ts bridges legacy SGAI_TIMEOUT_S (and JUST_SCRAPE_TIMEOUT_S) → SGAI_TIMEOUT so nothing breaks for existing users
  • package.json bumps scrapegraph-js pin 0738786096c110, and CLI version 0.3.01.0.0 to track SDK v2.0.0
  • README.md: documents the new activity action, updates env-var table, adds SGAI_DEBUG

Refactor: one file per endpoint → single src/commands.ts

The 8 tiny files under src/commands/ (extract, search, scrape, markdownify, crawl, monitor, history, credits) are now merged into a single src/commands.ts with named exports. cli.ts imports them statically.

  • Single file is easier to scan and lets common helpers (e.g. buildFormats for monitor) be shared without an extra lib indirection
  • tsup output drops from 8 separate chunks to one cli.mjs (~30 KB)
  • biome.json override updated: src/commands/**src/commands.ts
  • No behavior change — same CLI surface (all commands and flags unchanged)

Test plan

  • bun run check — tsc + biome clean
  • bun run build — bundles successfully, single dist/cli.mjs
  • just-scrape --help / monitor --help show the new activity action and --limit / --cursor flags
  • Live smoke test against a real monitor ID once the SDK PR is merged

Docs follow-up in docs-mintlify#39 (already pushed).

🤖 Generated with Claude Code

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>
@VinciGit00 VinciGit00 force-pushed the feat/sync-sdk-v2-pr13-head branch from aa18cc9 to 7504628 Compare April 15, 2026 15:14
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>
@VinciGit00 VinciGit00 closed this Apr 15, 2026
@VinciGit00 VinciGit00 deleted the feat/sync-sdk-v2-pr13-head branch April 15, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant