Skip to content
shivang1209-dotPublic

About

Open source agentic crawler for web applications and SPAs.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

CrawlAI

Open source CLI crawler for web applications and SPAs using Playwright plus Ollama qwen3.5.

Highlights

  • Guided crawl brief for target URL, app architecture, auth mode, and objective.
  • Deterministic login workflow for authenticated crawls with reusable browser storage state.
  • Agentic crawl loop that re-evaluates the application every 30 seconds.
  • SPA-aware observations including forms, headings, recent same-origin requests, and route hints.
  • Resumable runs with persisted state, screenshots, observations, route graph JSON, and Mermaid output.
  • Ollama provider abstraction so cloud and local are both supported.

Quick start

  1. Install dependencies:

    npm install
  2. Install the Playwright browser:

    npx playwright install chromium
  3. Create your env file:

    cp .env.example .env
  4. Set your Ollama Cloud key in .env:

    OLLAMA_PROVIDER=cloud
    OLLAMA_API_KEY=your-key-here
    OLLAMA_MODEL=qwen3.5
  5. Start the crawler:

    npm run dev -- run

Commands

Interactive run:

npm run dev -- run

Run from a structured brief:

npm run dev -- run --brief-file ./brief.example.txt

Run with a persistent auth/session file:

npm run dev -- run --session-file ./sessions/customer-a.json

Resume a previous crawl:

npm run dev -- run --resume ./runs/2026-04-04T10-00-00-000Z-example-com

Brief format

Target URL: https://example.com
Application Type/Architecture: React SPA with dashboard, account settings, and internal APIs.
Crawl Mode: authenticated
Login URL: https://example.com/login
Post-Login URL: https://example.com/app
Post-Login Selector: nav a[href="/logout"]
Session File: ./sessions/example.json
Credentials:
  email=test@example.com
  password=super-secret
Objective: Map major routes, forms, API-backed flows, and account management journeys.

Environment variables

Cloud-first defaults:

  • OLLAMA_PROVIDER=cloud
  • OLLAMA_CLOUD_BASE_URL=https://ollama.com
  • OLLAMA_API_KEY=...
  • OLLAMA_MODEL=qwen3.5

Runtime:

  • CRAWLAI_MAX_STEPS=20
  • CRAWLAI_POLL_INTERVAL_MS=30000
  • CRAWLAI_NAVIGATION_TIMEOUT_MS=15000
  • CRAWLAI_HEADLESS=false

Future local switch:

OLLAMA_PROVIDER=local
OLLAMA_LOCAL_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=qwen3.5

Run artifacts

Each crawl is saved under runs/<timestamp>-<slug>/:

  • brief.json
  • state.json
  • events.ndjson
  • observations/*.json
  • screenshots/*.png
  • route-graph.json
  • route-graph.mmd
  • report.md
  • storage-state.json when auth is used and no custom session file is supplied

Production notes

  • Crawls are same-origin by default to reduce accidental scope creep.
  • Authenticated runs reuse a saved storage state so repeated customer crawls are faster.
  • Resume support is safe for long-running or interrupted explorations.
  • Route graph output is designed for downstream reporting and visualization.

Verification

npm run build
npm test

About

Open source agentic crawler for web applications and SPAs.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages