AI-powered daily summaries of Hacker News stories and discussions.
Too busy to scroll through Hacker News every day? HN-Brief automatically fetches the top 20 stories, summarizes each article and its discussion using AI, and generates a cohesive daily digest all hosted as a simple static site.
🔗 Live site: hn-brief.com
- Fetch — A Cloudflare Worker runs every 2 hours, pulling the top stories from theHN Algolia API .
- Summarize — Each story + its comments are sent to an LLM (viaOpenRouter by default, with Cebras/Nvidia/Xiaomi as fallbacks).
- Digest — All summaries are combined into a single, flowing narrative for quick reading.
- Publish — The Worker commits the markdown files directly to GitHub, triggering a Cloudflare Pages redeploy.
- Article Mode : Per-story summaries with article + discussion breakdown
- Digest Mode : All stories summarized into one cohesive narrative
- Daily Archive : Browse summaries from previous days via calendar picker
- HN Aesthetic : Classic Hacker News styling with Verdana font
- Zero Framework : Pure HTML/CSS/JS frontend
- Bun (v1.0+)
- API key for summarization (Cebras, Nvidia NIM, Xiaomi MiMo, OpenRouter, or OpenAI-compatible)
# Clone the repository
git clone https://github.com/jnd0/hn-brief.git
cd hn-brief
# Install dependencies
bun install
# Copy environment variables
cp .env.example .env
# Edit .env with your API keys
# Serve the static site
bunx serve .
Visit http://localhost:3000
# Generate today's summaries (Article + Digest modes)
bun run summarize
# Show all CLI options
bun run summarize -- --help
| Option | Short | Description | |---|---|---| | --date <YYYY-MM-DD> | -d | Run for a specific date (default: today) | | --articles | -a | Generate only article summaries | | --digest | -g | Generate only digest summary | | --repair | -r | Repair low-quality stories in an existing article file | | --id <HN_ID> | - | Repair a specific story ID (repeatable, with --repair ) | | --help | -h | Show help message |
# Generate both modes for today
bun run summarize
# Generate for a specific date
bun run summarize -- --date 2025-12-25
# Generate only articles
bun run summarize -- --articles
# Generate only digest for a specific date
bun run summarize -- -d 2025-12-25 -g
# Auto-repair broken stories for a date
bun run summarize -- -r -d 2026-02-06
# Repair a specific story by HN ID
bun run summarize -- -r -d 2026-02-06 --id 46911869
A separate, private pipeline runs once a day in Podman and writes retained JSON, Markdown, and LLM traces to a host directory. Agents read latest.json in that directory to find the newest briefing. See docs/local-data-pipeline.md for setup, scheduling, failure inspection, and pruning. The upstream Cloudflare Worker documentation below still applies.
| Variable | Description | Required | |---|---|---| | OPENROUTER_API_KEY | OpenRouter API key (preferred) | Yes (or one of below) | | OPENROUTER_MODEL | OpenRouter model override | No | | CEBRAS_API_KEY | Cebras API key (fallback) | Yes (or one of below) | | CEBRAS_API_URL | Cebras API URL override | No | | CEBRAS_API_MODEL | Cebras model (default: qwen-3-235b-a22b-instruct-2507 ) | No | | NVIDIA_API_KEY | Nvidia NIM API key (fallback) | Yes (or one of below) | | NVIDIA_MODEL | Nvidia model override (default: moonshotai/kimi-k2.5 ) | No | | XIAOMI_API_KEY | Xiaomi MiMo API key (fallback) | Yes (or one of below) | | XIAOMI_API_URL | Xiaomi API URL override | No | | XIAOMI_MODEL | Xiaomi model override (default: mimo-v2-flash ) | No | | OPENAI_API_KEY | OpenAI-compatible API key | Yes (or another key) | | LLM_MODEL | Legacy model override for OpenRouter/Nvidia/OpenAI-compatible | No | | LLM_API_URL | Override LLM API URL (OpenRouter/Nvidia/OpenAI-compatible) | No | | LLM_THINKING_FORCE | Force thinking mode for providers that support it ( true /false ) | No | | LLM_THINKING | Alias for LLM_THINKING_FORCE | No | | GITHUB_TOKEN | GitHub PAT for automated commits | For Worker only | | REPO_OWNER | GitHub username | For Worker only | | REPO_NAME | Repository name | For Worker only | | MAX_COMMENT_CHARS | Character budget for comments (default: 15000) | No | | MAX_COMMENTS_PER_ROOT | Max comments per top-level thread (default: 3) | No |
When using Nvidia NIM, article summaries run in Instant mode (temp 0.6) and digest runs in Thinking mode (temp 1.0). Set LLM_THINKING_FORCE to force both.
hn-brief/
├── index.html # Frontend (Article/Digest toggle)
├── assets/
│ ├── style.css # HN-style CSS
│ ├── app.js # Frontend JavaScript
│ └── favicon.png # Site favicon
├── pages/
│ ├── faq.html # FAQ page
│ └── about.html # About page
├── scripts/
│ └── summarizer.ts # Bun script for local generation
├── worker/
│ ├── index.ts # Cloudflare Worker
│ └── wrangler.jsonc # Worker config
└── summaries/ # Generated summaries (organized by year/month)
├── archive.json # Index of available dates (see below)
└── YYYY/
└── MM/
├── DD.md
└── DD-digest.md
See CONTRIBUTING.md for guidelines.
MIT
原文来源:github.com