ai-blogger
v0.9.0
Published
Auto-generate blog posts from Claude Code sessions to Notion
Readme
ai-blogger
Claude Code 세션에서 블로그 포스트를 자동 생성하여 Notion에 게시하는 CLI 도구입니다.
Claude Code의 Stop 훅을 활용하여 세션 종료 시 트랜스크립트를 분석하고, 블로그로 작성할 만한 내용이 있으면 자동으로 포스트를 생성합니다.
동작 방식
Claude Code 세션 종료
→ Stop 훅 트리거
→ 트랜스크립트 분석 (점수 1-10)
→ 기준 점수 이상이면 블로그 포스트 생성
→ Notion 데이터베이스에 게시설치
npm install -g ai-blogger설정
1. API 키 설정
ai-blogger config인터랙티브 모드로 각 항목을 순서대로 입력할 수 있습니다:
AI Blogger Configuration
Enter values for each setting. Press Enter to keep the current value.
Anthropic API Key [(not set)]: sk-ant-...
Notion Token [(not set)]: ntn_...
Notion Database ID [(not set)]: abc123...
Threshold (1-10) [7]:
Config saved.개별 설정도 가능합니다:
ai-blogger config --set anthropicApiKey sk-ant-...2. Claude Code 훅 등록
ai-blogger install~/.claude/settings.json에 Stop 훅이 등록됩니다. 이후 Claude Code 세션이 종료될 때마다 백그라운드에서 자동 실행됩니다.
3. 설정 확인
ai-blogger config --showCLI 명령어
| 명령어 | 설명 |
|--------|------|
| ai-blogger install | Claude Code Stop 훅 등록 |
| ai-blogger uninstall | 훅 제거 |
| ai-blogger config | 인터랙티브 설정 |
| ai-blogger config --show | 현재 설정 표시 |
| ai-blogger config --set <key> <value> | 개별 설정 변경 |
| ai-blogger test | 최근 트랜스크립트로 테스트 실행 |
| ai-blogger test --dry-run | Notion 게시 없이 테스트 |
| ai-blogger test --file <path> | 특정 트랜스크립트 파일로 테스트 |
| ai-blogger process | stdin으로 트랜스크립트 처리 (훅에서 호출) |
설정 옵션
설정 파일 경로: ~/.ai-blogger/config.json
| 키 | 설명 | 기본값 |
|----|------|--------|
| anthropicApiKey | Claude API 키 | - |
| notionToken | Notion Integration 토큰 | - |
| notionDatabaseId | 게시할 Notion 데이터베이스 ID | - |
| threshold | 블로그 작성 기준 점수 (1-10) | 7 |
| author | 작성자 이름 (선택) | - |
Notion 데이터베이스 설정
Notion 데이터베이스에 다음 속성을 추가해주세요. 없는 속성은 자동 생성을 시도하며, 자동 생성이 안 될 경우 해당 속성은 건너뜁니다.
| 속성명 | 타입 | 설명 | 필수 |
|--------|------|------|------|
| Name | title | 포스트 제목 (기본 제공) | O |
| Tags | multi_select | 태그 | O |
| Category | select | 카테고리 (debugging, tech-pattern, insight) | O |
| Score | number | 분석 점수 (1-10) | O |
| Author | rich_text | 작성자 (config의 author 설정 시 사용) | X |
파일 경로
| 용도 | 경로 |
|------|------|
| 설정 파일 | ~/.ai-blogger/config.json |
| 로그 파일 | ~/.ai-blogger/ai-blogger.log |
| 처리 이력 | ~/.ai-blogger/history.json |
| 큐 | ~/.ai-blogger/queue.json |
개발
git clone https://github.com/user/ai-blogger.git
cd ai-blogger
npm install
npm run build
npm test요구사항
- Node.js >= 18
- Claude Code
- Anthropic API 키
- Notion Integration 토큰 및 데이터베이스
License
MIT
