Skills + CLI
터미널에서 Thunderbit 실행 — 페이지를 Markdown으로 디스틸, 구조화 데이터 추출, 필드 제안, 최대 100 URL 배치 처리. CLI는 단독으로도, AI 코딩 Agent가 발견할 수 있는 skills 툴킷으로도 사용할 수 있습니다.
터미널에서 직접 디스틸, 추출, 필드 제안, 배치 작업을 실행하세요.
설치
CLI는 npm에 @thunderbit/thunderbit-cli로 게시되며 PATH에 thunderbit 바이너리를 노출합니다.
# Install globally
npm install -g @thunderbit/thunderbit-cli
# Or run one-shot via npx
npx -y @thunderbit/thunderbit-cli --help동일한 명령 표면을 가진 Python(
pip install thunderbit) 버전이 로드맵에 있습니다.
인증
CLI를 사용하기 전에 Thunderbit API key로 인증해야 합니다. app.thunderbit.com/console에서 key를 발급받으세요. 형식: tb_ 뒤에 32자리 16진수.
환경 변수로 설정
export THUNDERBIT_API_KEY=tb_YOUR_API_KEY명령마다 전달
thunderbit --api-key tb_YOUR_API_KEY distill https://example.com셀프호스트 / 로컬 개발
셀프호스트 Thunderbit 게이트웨이의 경우 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버전 확인
thunderbit --version
# or
thunderbit -V글로벌 옵션
이 flag들은 모든 명령에서 사용할 수 있습니다:
| 옵션 | 설명 |
|---|---|
--api-key <key>, -k | API key(또는 THUNDERBIT_API_KEY 설정) |
--base-url <url> | API base URL(또는 THUNDERBIT_API_BASE_URL 설정) |
--format <format>, -f | 출력 형식: json, table, markdown(기본 json) |
--version, -V | CLI 버전 출력 |
--help, -h | 명령 도움말 표시 |
명령
Distill
단일 URL을 깔끔하고 LLM 친화적인 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.mdDistill 옵션
# 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사용 가능한 옵션:
| 옵션 | 기본값 | 설명 |
|---|---|---|
--render-mode <mode> | none | none, basic, full |
--timeout <ms> | 30000 | 페이지당 요청 타임아웃(ms) |
--country-code <CC> | US | ISO 2글자 코드, 대문자 |
--sync | false | 기본 비동기 제출 + 폴링 대신 동기 모드 사용 |
Extract
페이지에서 구조화 데이터를 추출합니다. schema는 fieldName → 자연어 지시의 평탄한 맵입니다 — 각 값은 AI가 페이지에서 해당 필드를 찾는 데 사용하는 힌트입니다.
참고: 업스트림 OpenAPI 스펙 예제는 JSON Schema (
{type:"object",properties:…})를 보여줍니다. 작성 시점 기준 운영 서버는 아래에 보이는 평탄한 지시 맵을 기대하며, 스펙을 맞춰가는 중입니다.
# 인라인 schema — 필드 → 지시의 평탄한 맵
thunderbit extract https://example.com/product \
--schema '{"name":"product name","price":"the listed price as a number","currency":"3-letter currency code"}'
# 파일에서 schema 읽기
thunderbit extract https://example.com/product --schema ./schema.json
# 추출된 JSON 저장
thunderbit extract https://example.com/product --schema ./schema.json --format json -o data.json응답은 항상 data.data를 배열로 반환하며, 스키마와 일치하는 페이지 영역마다 한 요소씩 들어갑니다:
{
"success": true,
"data": {
"url": "https://example.com/product",
"data": [
{ "name": "iPhone 15 Pro", "price": 999, "currency": "USD" }
]
}
}인터랙티브 모드
# 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.jsonExtract 옵션
# 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사용 가능한 옵션:
| 옵션 | 기본값 | 설명 |
|---|---|---|
--schema <json-or-file> | — | 인라인 JSON 또는 schema 파일 경로 |
--interactive, -i | false | 제안 → 정리 → 추출을 한 번에 |
--prompt <text> | — | AI 제안에 대한 힌트(-i와 함께) |
--render-mode <mode> | none | none, basic, full |
--timeout <ms> | 60000 | 페이지당 요청 타임아웃(ms) |
--sync | false | 동기 모드 |
--save-schema <file> | — | 재사용을 위해 최종 schema 저장 |
Suggest Fields
스키마를 작성하기 전에 AI가 추출 가능한 필드를 제안하도록 합니다.
# 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인터랙티브 에디터에서는 번호로 필드를 토글(1 3 5)하거나 add, rm 2, edit 4를 사용하고, done을 입력해 확정합니다. suggest-fields는 [{name, type, instruction}, …]를 반환합니다. 이를 extract에 넣을 때는 먼저 평탄한 맵으로 변환하세요:
thunderbit suggest-fields "$URL" --format json \ | jq 'map({(.name): .instruction}) | add' > schema.json thunderbit extract "$URL" --schema ./schema.json
사용 가능한 옵션:
| 옵션 | 기본값 | 설명 |
|---|---|---|
--prompt <text> | — | 가이드 힌트 |
--country-code <CC> | US | ISO 2글자 코드 |
Batch Distill
하나의 배치 작업으로 최대 100개의 URL을 제출합니다. 기본은 제출 + 폴링으로 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-pollBatch Distill 옵션
# 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사용 가능한 옵션:
| 옵션 | 기본값 | 설명 |
|---|---|---|
--file <path> | — | 파일에서 URL 읽기(한 줄에 하나) |
--timeout <ms> | 30000 | 페이지당 요청 타임아웃(ms) |
--no-poll | false | 제출만, job ID 출력 후 종료 |
실행 중인 batch distill 작업 취소
thunderbit batch cancel-distill <jobId>이미 완료된 페이지는 결과가 유지됩니다. 대기 중인 페이지는 폐기되며 해당 부분에 대한 과금도 중단됩니다. 서버가 확인하면 상태는 CANCELLED로 바뀝니다.
Batch Extract
공통 스키마로 최대 100개의 URL을 제출합니다.
# 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사용 가능한 옵션:
| 옵션 | 기본값 | 설명 |
|---|---|---|
--file <path> | — | 파일에서 URL 읽기(한 줄에 하나) |
--schema <json-or-file> | — | 인라인 JSON 또는 schema 파일(필수) |
--timeout <ms> | 60000 | 페이지당 요청 타임아웃(ms) |
--no-poll | false | 제출만, job ID 출력 후 종료 |
실행 중인 batch extract 작업 취소
thunderbit batch cancel-extract <jobId>cancel-distill과 동일한 동작입니다 — 완료된 행은 보존되고, 대기 중인 행은 폐기되며, 나머지에 대한 과금이 중단됩니다.
출력 처리
CLI는 기본으로 stdout에 출력하므로 파이프나 리다이렉트가 쉽습니다.
# 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형식 동작
--format json(기본): 전체 API 응답을 컴팩트 JSON으로,success,data,creditsUsed등을 포함.jq에 파이프 가능.--format markdown:distill은 raw Markdown 본문을, 다른 명령은 전체 JSON을 출력.--format table: 표 형식 결과(extract, suggest-fields)를 ASCII 테이블로 출력.
# Markdown body straight to disk
thunderbit distill https://example.com --format markdown
# Full structured response
thunderbit distill https://example.com --format json예시
빠른 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대량 RAG 인제스천
# 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발견 후 추출
# 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.jsonCI 게이트 — 추출 결과가 없을 때 실패
thunderbit extract "$URL" --schema ./schema.json --format json \
| jq -e '.data | length > 0'다른 도구와 결합
# 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'종료 코드
| 코드 | 의미 |
|---|---|
0 | 성공. 결과는 --format에서 선택한 형식으로 stdout에 출력됩니다. |
1 | 모든 실패 — API key 누락, 인증 오류, HTTP 4xx/5xx, 네트워크 오류, schema 파일 누락, 필수 인수 누락. |
모든 오류 텍스트는 stderr로 출력됩니다. 실패 시 stdout은 비어 있습니다 (--format json에서도 마찬가지). 따라서 jq 파이프라인은 절반쯤 만들어진 봉투를 받지 않습니다 — 파싱하기 전에 종료 코드(또는 set -e)를 확인하세요.
폴링 진행 상황(예: async submit + poll의
Processing... (3))도stderr에 출력됩니다. 음소거하려면2>/dev/null을 파이프하세요. 단일 페이지 동기 호출(--sync)은 진행 상황을 출력하지 않습니다.
문제 해결
Error: API key is required. THUNDERBIT_API_KEY를 export하거나 --api-key를 전달하세요.
기업 프록시 뒤의 네트워크 오류. HTTPS_PROXY와 HTTP_PROXY를 설정하세요 — Node와 Python 클라이언트 모두 이를 따릅니다.
배치 폴링이 느립니다. 페이지 단위 예산을 위해 --timeout을 늘리세요. 폴링 자체의 주기는 몇 초로 고정되어 있으며 현재 CLI에서 설정할 수 없습니다.
오픈소스
Thunderbit CLI는 MIT 라이선스의 오픈소스로 GitHub에 공개되어 있습니다: thunderbit-open/thunderbit-mcp-server (같은 저장소에 MCP 서버와 Claude Code 플러그인도 포함). npm 배포: @thunderbit/thunderbit-cli.
관련 링크
- MCP Server — 동일한 작업을 MCP 도구로 노출
- SDKs — 자체 코드에서 호출
- API Reference — raw HTTP