Repository navigation
Adds a pluggable scraper provider abstraction to king-scrape. Firecrawl stays the zero-config default. Crawl4AI is now available as a local opt-in backend (beta) for users who want to index docs without external credits, without sending HTML to a third party, or with full transparency over the HTML to Markdown conversion.
Added
- Pluggable scraper provider abstraction for
king-scrape. Choose backend viaSCRAPE_PROVIDERenv var or--providerflag. Stage-aware overrides viaSCRAPE_DISCOVER_PROVIDERandSCRAPE_FETCH_PROVIDER. Mirrors the layout ofsrc/llm_providers/(ADR-0009, ADR-0010). - Crawl4AI local backend (beta, ADR-0011). Bundled by default in the
[all]extra thatnpx @king-context/cli initruns, so the package ships in the project venv. Activation only requires runningcrawl4ai-setuponce to download the Playwright chromium. .github/workflows/test.ymlwith atestjob (pytest on the firecrawl path) and asmoke-crawl4aijob that runsscripts/smoke-crawl4ai.pyto detect API churn acrosscrawl4ai>=0.8.5,<0.9minor versions.
Changed
firecrawl-pymoved from core dependencies to the[firecrawl]extra.npx @king-context/cli initcontinues to install everything via the[all]extra, so the default flow is preserved with no breaking change.installer/lib/python.jsnow installsking-context[all]via PEP 508 direct reference (king-context[all] @ git+...), soinitandupdatekeep pulling firecrawl-py and crawl4ai after the core dependency move.
Enable Crawl4AI
After npx @king-context/cli init (or update from a previous version), run:
.king-context/core/venv/bin/crawl4ai-setup
Then either:
king-scrape https://docs.example.com --provider=crawl4ai
Or set SCRAPE_PROVIDER=crawl4ai in .env to make it the default for the project.
Crawl4AI support is beta. If something breaks or feels off, open an issue at https://github.com/deandevz/king-context/issues with the URL, the command, and the error.
Validation
- 683 pytest tests passing
- Crawl4AI end to end on python-httpx.org: 114 sections exported
- Firecrawl end to end on python-httpx.org: 112 sections exported (zero breaking change confirmed)
- Public smoke from the npm registry:
npx @king-context/cli@0.4.0 initfollowed bycrawl4ai-setupandking-scrape --provider=crawl4aiworks end to end on a clean directory
Decisions
- ADR-0009: Pluggable scraper provider abstraction for king-scrape
- ADR-0010: Thin scraper provider with pipeline-owned concurrency, checkpoint, and IO
- ADR-0011: Crawl4AI selected as first local scraping backend
Pull request: #45