Skip to content

Latest commit

 

History

History
108 lines (74 loc) · 2.28 KB

File metadata and controls

108 lines (74 loc) · 2.28 KB

HashScraper

@hashscraper/cli

URL을 깔끔한 Markdown으로 변환하는 CLI 도구입니다.

HashScraper 웹 크롤링 및 콘텐츠 추출 서비스 기반.

설치

npm install -g @hashscraper/cli

Node.js 18 이상 필요.

설정

hashscraper.com에서 API 키를 발급받은 후 설정합니다:

hashscraper config set api_key YOUR_API_KEY

또는 환경변수로 설정:

export HASHSCRAPER_API_KEY=YOUR_API_KEY

사용법

URL을 Markdown으로 변환

hashscraper https://example.com

파일로 저장

hashscraper https://example.com -o output.md

여러 URL 동시 처리

hashscraper https://a.com https://b.com --output-dir ./results

파일에서 URL 목록 읽기

hashscraper --input urls.txt --output-dir ./results

JSON 형식으로 출력 (메타데이터 포함)

hashscraper https://example.com --json

텍스트 형식으로 출력

hashscraper https://example.com --format text

명령어

명령어 설명
hashscraper <urls...> URL을 Markdown으로 변환 (기본)
hashscraper credits 잔여 크레딧 조회
hashscraper config set <key> <value> 설정값 저장 (api_key, base_url)
hashscraper config get <key> 설정값 조회

옵션

옵션 설명 기본값
--api-key <key> API 키 (설정 파일보다 우선)
-o, --output <path> 파일로 저장 (단일 URL만 가능) stdout
--output-dir <dir> 각 결과를 디렉토리에 저장
--format <format> markdown 또는 text markdown
--json 메타데이터 포함 JSON 출력
--timeout <ms> 요청 타임아웃 30000
--input <file> 텍스트 파일에서 URL 읽기

API 키 우선순위

  1. --api-key 플래그
  2. HASHSCRAPER_API_KEY 환경변수
  3. ~/.hashscraper/config.json 설정 파일

종료 코드

코드 의미
0 모든 URL 처리 성공
1 전체 실패
2 부분 실패 (일부 성공, 일부 실패)

라이선스

MIT