Aan de slag

Skills + CLI

Draai Thunderbit vanuit de terminal — distilleer pagina's tot Markdown, extraheer gestructureerde data, stel velden voor en verwerk tot 100 URLs in batch. De CLI werkt zelfstandig of als skills-toolkit die AI coding agents kunnen ontdekken.

Distilleer, extraheer, stel velden voor en draai batch-jobs direct vanuit de terminal.

Installatie

De CLI wordt op npm gepubliceerd als @thunderbit/thunderbit-cli en stelt een thunderbit-binary beschikbaar in je PATH.

# Install globally
npm install -g @thunderbit/thunderbit-cli

# Or run one-shot via npx
npx -y @thunderbit/thunderbit-cli --help

Een Python-variant (pip install thunderbit) met dezelfde commando-oppervlakte staat op de roadmap.

Authenticatie

Voordat je de CLI gebruikt, moet je je authenticeren met je Thunderbit-API-key. Haal een key op in het Thunderbit Dashboard. Formaat: tb_ gevolgd door 32 hex-tekens.

Instellen via omgevingsvariabele

export THUNDERBIT_API_KEY=tb_YOUR_API_KEY

Per commando meegeven

thunderbit --api-key tb_YOUR_API_KEY distill https://example.com

Self-hosted / Lokale ontwikkeling

Voor self-hosted Thunderbit-gateways overschrijf je de base-URL:

# Per call
thunderbit --base-url https://api.your-domain.com distill https://example.com

# Or set via environment variable
export THUNDERBIT_API_BASE_URL=https://api.your-domain.com
thunderbit distill https://example.com

Versie controleren

thunderbit --version
# or
thunderbit -V

Globale opties

Deze flags zijn beschikbaar voor elk commando:

OptieBeschrijving
--api-key <key>, -kAPI-key (of zet THUNDERBIT_API_KEY)
--base-url <url>API base-URL (of zet THUNDERBIT_API_BASE_URL)
--format <format>, -fUitvoerformaat: json, table of markdown (standaard json)
--version, -VCLI-versie afdrukken
--help, -hCommandohulp tonen

Commando's

Distill

Distilleer een enkele URL tot schone, LLM-klare Markdown.

# Basic usage
thunderbit distill https://example.com/article

# Stream Markdown to stdout
thunderbit distill https://example.com --format markdown

# Save to file
thunderbit distill https://example.com --format markdown > article.md

Distill-opties

# Use the basic JS renderer (covers most modern sites)
thunderbit distill https://example.com --render-mode basic

# Use the full headless browser (slowest, highest fidelity)
thunderbit distill https://example.com --render-mode full

# Geo-target for region-aware sites
thunderbit distill https://example.com --country-code DE

# Bump per-page timeout
thunderbit distill https://example.com --timeout 60000

# Use sync /distill instead of the default async submit + poll
thunderbit distill https://example.com --sync

Beschikbare opties:

OptieStandaardBeschrijving
--render-mode <mode>nonenone, basic of full
--timeout <ms>30000Request-timeout per pagina in ms
--country-code <CC>USISO-2-letter code, hoofdletters
--syncfalseSync-modus in plaats van async submit + poll

Extract

Extraheer gestructureerde data uit een pagina. Het schema is een platte map van fieldName → natuurlijke-taalinstructie — elke waarde is een hint die de AI gebruikt om het veld op de pagina te vinden.

Opmerking: het voorbeeld in de upstream OpenAPI-spec toont JSON Schema ({type:"object",properties:…}). Op het moment van schrijven verwacht de live server de hieronder getoonde platte instructie-map; we trekken de spec gelijk.

# Inline schema — platte map veld → instructie
thunderbit extract https://example.com/product \
  --schema '{"name":"product name","price":"the listed price as a number","currency":"3-letter currency code"}'

# Schema uit een bestand
thunderbit extract https://example.com/product --schema ./schema.json

# Geëxtraheerde JSON opslaan
thunderbit extract https://example.com/product --schema ./schema.json --format json -o data.json

De respons retourneert data.data altijd als een array, één element per paginagedeelte dat overeenkomt met je schema:

{
  "success": true,
  "data": {
    "url": "https://example.com/product",
    "data": [
      { "name": "iPhone 15 Pro", "price": 999, "currency": "USD" }
    ]
  }
}

Interactieve modus

# AI proposes fields, you toggle/edit, then extraction runs with the curated schema
thunderbit extract https://example.com/product --interactive

# Steer the suggestion with a prompt
thunderbit extract https://example.com/product -i --prompt "focus on pricing and availability"

# Persist the schema for reuse
thunderbit extract https://example.com/product -i --save-schema ./product-schema.json

Extract-opties

# Bump page-render time for SPAs
thunderbit extract https://example.com --schema ./schema.json --render-mode full

# Sync mode
thunderbit extract https://example.com --schema ./schema.json --sync

# Longer timeout for complex pages
thunderbit extract https://example.com --schema ./schema.json --timeout 120000

Beschikbare opties:

OptieStandaardBeschrijving
--schema <json-or-file>Inline JSON of pad naar schemabestand
--interactive, -ifalseVoorstellen → cureren → extraheren in één stap
--prompt <text>Hint voor AI-suggestie (met -i)
--render-mode <mode>nonenone, basic of full
--timeout <ms>60000Request-timeout per pagina in ms
--syncfalseSync-modus
--save-schema <file>Definitief schema opslaan voor hergebruik

Suggest Fields

Laat de AI extraheerbare velden voorstellen voordat je een schema schrijft.

# Basic
thunderbit suggest-fields https://example.com/product

# Steer with a prompt
thunderbit suggest-fields https://example.com/listings --prompt "extract job postings only"

# Region-aware
thunderbit suggest-fields https://example.com --country-code DE

In de interactieve editor kun je velden togglen op nummer (1 3 5), add, rm 2, edit 4, en daarna done om te bevestigen. suggest-fields retourneert [{name, type, instruction}, …]; wanneer je dat aan extract voert, zet het eerst om in een platte map:

thunderbit suggest-fields "$URL" --format json \
  | jq 'map({(.name): .instruction}) | add' > schema.json

thunderbit extract "$URL" --schema ./schema.json

Beschikbare opties:

OptieStandaardBeschrijving
--prompt <text>Sturingshint
--country-code <CC>USISO-2-letter code

Batch Distill

Dien tot 100 URLs in als één batch-job. Standaardgedrag: submit + pollen tot COMPLETED / FAILED / CANCELLED.

# URLs as positional args
thunderbit batch distill https://a.com https://b.com https://c.com

# Or read URLs from a file (one per line)
thunderbit batch distill --file urls.txt

# Submit only — print the job ID and exit (use webhook or poll later)
thunderbit batch distill --file urls.txt --no-poll

Batch Distill-opties

# Bump per-page timeout
thunderbit batch distill --file urls.txt --timeout 60000

# Pipe results into another tool
thunderbit batch distill --file urls.txt --format json \
  | jq -r '.data.results[] | select(.success == true) | .markdown' \
  > distilled.md

Beschikbare opties:

OptieStandaardBeschrijving
--file <path>URLs uit bestand lezen (één per regel)
--timeout <ms>30000Request-timeout per pagina in ms
--no-pollfalseAlleen indienen, job-ID afdrukken, beëindigen

Een lopende batch-distill-job annuleren

thunderbit batch cancel-distill <jobId>

Reeds voltooide pagina's behouden hun resultaten. Wachtende pagina's worden verwijderd en daarvoor wordt niets meer in rekening gebracht. De status springt op CANCELLED zodra de server het bevestigt.


Batch Extract

Dien tot 100 URLs in met een gedeeld schema.

# URLs as positional args + inline schema
thunderbit batch extract https://a.com https://b.com \
  --schema ./schema.json

# Read URLs from a file
thunderbit batch extract --file urls.txt --schema ./schema.json

# Submit only
thunderbit batch extract --file urls.txt --schema ./schema.json --no-poll

Beschikbare opties:

OptieStandaardBeschrijving
--file <path>URLs uit bestand lezen (één per regel)
--schema <json-or-file>Inline JSON of schemabestand (vereist)
--timeout <ms>60000Request-timeout per pagina in ms
--no-pollfalseAlleen indienen, job-ID afdrukken, beëindigen

Een lopende batch-extract-job annuleren

thunderbit batch cancel-extract <jobId>

Zelfde semantiek als cancel-distill — voltooide rijen blijven behouden, wachtende rijen worden verwijderd, en de facturatie stopt voor de rest.

Uitvoer-afhandeling

De CLI schrijft standaard naar stdout, wat pipen of redirecten makkelijk maakt.

# Pipe Markdown into another tool
thunderbit distill https://example.com --format markdown | head -50

# Redirect to a file
thunderbit distill https://example.com --format markdown > output.md

# Save extraction JSON
thunderbit extract https://example.com --schema ./schema.json --format json > data.json

Formaat-gedrag

  • --format json (standaard): volledige API-respons als compacte JSON, inclusief success, data, creditsUsed, enz. Pipen naar jq.
  • --format markdown: rauwe Markdown-body voor distill; volledige JSON voor andere commando's.
  • --format table: ASCII-tabel voor tabulaire resultaten (extract, suggest-fields).
# Markdown body straight to disk
thunderbit distill https://example.com --format markdown

# Full structured response
thunderbit distill https://example.com --format json

Voorbeelden

Snelle Distill

# Distill an article
thunderbit distill https://docs.thunderbit.com/introduction --format markdown

# Save HTML-converted Markdown to disk
thunderbit distill https://example.com --format markdown -o page.md

Bulk RAG-ingestie

# Distill a docs site listed in urls.txt and write each page to disk
thunderbit batch distill --file urls.txt --format json \
  | jq -r '.data.results[] | select(.success == true) | "\(.url)\t\(.markdown)"' \
  > corpus.tsv

Eerst ontdekken, dan extraheren

# Step 1: AI proposes fields, you curate, schema saved to disk
thunderbit extract https://example.com/product -i --save-schema ./schema.json

# Step 2: re-use across the catalog
thunderbit batch extract --file urls.txt --schema ./schema.json --format json > products.json

CI-gate — falen wanneer extractie niets oplevert

thunderbit extract "$URL" --schema ./schema.json --format json \
  | jq -e '.data | length > 0'

Combineren met andere tools

# Extract URLs from a search-result JSON
thunderbit distill https://example.com --format json \
  | jq -r '.data.metadata.canonicalUrl'

# Pipe distilled content into a model for summarisation
thunderbit distill "$URL" --format markdown \
  | claude -p "summarise the article in 5 bullets"

# Count successful pages in a batch
thunderbit batch distill --file urls.txt --format json \
  | jq '[.data.results[] | select(.success == true)] | length'

Exit-codes

CodeBetekenis
0Succes. Het resultaat staat op stdout in het formaat dat met --format is gekozen.
1Elke fout — ontbrekende API-key, auth-fout, HTTP 4xx/5xx, netwerkfout, ontbrekend schemabestand, ontbrekend verplicht argument.

Alle foutmeldingen worden naar stderr geschreven. Bij een fout blijft stdout leeg (ja, ook met --format json). Dat betekent dat een jq-pipeline nooit een halfgaar envelope ontvangt — controleer de exit-code (of set -e) voordat je gaat parsen.

Polling-voortgang (bijv. Processing... (3) van async submit + poll) wordt ook naar stderr geschreven. Pipe 2>/dev/null om dat te dempen. Synchrone single-page calls (--sync) sturen geen voortgang.

Probleemoplossing

Error: API key is required. Exporteer THUNDERBIT_API_KEY of geef --api-key mee.

Netwerkfouten achter een bedrijfsproxy. Stel HTTPS_PROXY en HTTP_PROXY in — zowel Node- als Python-clients respecteren deze.

Traag batch-pollen. Verhoog --timeout voor het per-pagina-budget. De pollfrequentie zelf staat vast op enkele seconden en is op dit moment niet configureerbaar vanuit de CLI.

Open source

De Thunderbit CLI is MIT-gelicentieerd en open source op GitHub: GitHub repository (dezelfde repo bevat ook de MCP-server en de Claude Code-plugin). Gedistribueerd op npm als @thunderbit/thunderbit-cli.

Gerelateerd

  • MCP Server — dezelfde operaties, beschikbaar gesteld als MCP-tools
  • SDKs — aanroepen vanuit eigen code
  • API Reference — rauw HTTP