Skip to content

WIP: CLI v0.1.0#1

Merged
VinciGit00 merged 7 commits into
mainfrom
feat/v0.1.0-cli
Feb 11, 2026
Merged

WIP: CLI v0.1.0#1
VinciGit00 merged 7 commits into
mainfrom
feat/v0.1.0-cli

Conversation

@FrancescoSaverioZuppichini
Copy link
Copy Markdown
Member

@FrancescoSaverioZuppichini FrancescoSaverioZuppichini commented Feb 9, 2026

Summary

  • 10 commands wrapping all ScrapeGraph API endpoints (smart-scraper, search-scraper, markdownify, crawl, scrape, sitemap, agentic-scraper, generate-schema, credits, validate)
  • SDK layer with zod validation, async polling, elapsed time tracking, debug logging
  • Config: env var → .env → ~/.scrapegraphai/config.json → interactive prompt
  • API key source detection: correctly reports whether key comes from shell env var, .env file, or config file
  • Syntax-highlighted JSON output, TypeScript + tsup ESM, Node 22

Testing

  • 30 unit tests covering the SDK layer (tests/scrapegraphai.test.ts)
  • Mocked fetch via spyOn(globalThis, "fetch") — no network calls, no API key needed
  • Covers: success paths, polling, HTTP error mapping (401/402/422/429/500), Zod validation, timeouts, network failures
  • CI via GitHub Actions: runs bun test + bun run check (typecheck + lint) on every PR

Test plan

  • bun test — 30 pass, 109 assertions
  • bun run check — tsc + biome pass
  • bun run dev credits
  • bun run dev smart-scraper https://example.com -p "Extract title"
  • bun run build

Complete rewrite from scaffolding to working CLI tool:
- 10 commands: smart-scraper, search-scraper, markdownify, crawl, sitemap, scrape, agentic-scraper, generate-schema, credits, validate
- SDK layer with zod validation, async polling, debug logging, elapsed time tracking
- Config: env var → .env (dotenv) → ~/.scrapegraphai/config.json → interactive prompt
- Syntax-highlighted JSON output via chalk
- TypeScript + tsup ESM build targeting Node 22

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mand

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 tests covering all scrapegraphai.ts functions — mocked fetch, polling,
HTTP error mapping, validation, timeouts. GitHub Actions runs tests + lint
on PRs to main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FrancescoSaverioZuppichini FrancescoSaverioZuppichini marked this pull request as ready for review February 10, 2026 21:45
@VinciGit00 VinciGit00 merged commit 34ceacf into main Feb 11, 2026
3 checks passed
@VinciGit00 VinciGit00 deleted the feat/v0.1.0-cli branch February 11, 2026 08:11
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.

2 participants