






















A fast terminal Hacker News reader with threaded comment folding, score-coloured story lists, three themes, and AI-powered thread summarization via DeepSeek V4 Flash.
Built in Go on Bubbletea v2. Left panel browses stories across all six HN feeds (Top / New / Best / Ask / Show / Jobs) with pagination. Right panel renders nested comments with collapsible threads, coloured depth indent, and summary panel streaming live from DeepSeek.
6 feeds
Top · New · Best
Ask · Show · Jobs
3 themes
HN dark · HN classic
Zinc cyan
AI
DeepSeek V4 Flash
streaming thread summary
cwnews is a full-screen Bubbletea TUI for reading Hacker News on the terminal. It fetches stories and comments from the official HN Firebase API, caches everything in SQLite for instant re-opening, and provides real-time AI summaries of comment threads with word-by-word streaming.
The left panel is a dense story browser: six feed tabs, pagination with
n/p, and score- and comment-count coloured
metadata. Titles truncate cleanly to fit. The right panel shows a
threaded comment view with collapsible nesting, coloured depth bars,
and a cursor that highlights the active comment in accent orange.
Press s on any thread and DeepSeek V4 Flash streams a
detailed summary — sentiment, key points, standout quotes, consensus
& debate — formatted with markdown headings, bullet points, and
italicized blockquotes. Summaries are cached in SQLite, so switching
back to a thread is instant. Language is configurable (Chinese or
English).
The three themes cycle with t: a dark HN-inspired palette
with orange accents, a classic cream-background HN look matching the
real website, and a cyan-accented zinc theme from cwmail's design
system.
Threaded comment folding
Comments display as an indented tree with depth-coloured vertical
bars. Press Enter or ← to collapse
any thread, → to expand, [/]
to fold by depth level, n/N to jump
between top-level comments. Vim-style j/k
navigation moves a highlighted cursor through the visible list.
Streaming AI summaries
Press s and the right panel switches to an AI summary
view. DeepSeek V4 Flash streams text word-by-word with a braille
spinner in the status bar. Summaries cover overall sentiment, key
points, standout comment quotes, consensus & debate breakdowns,
and meta-observations. All cached in SQLite — reopen any thread
and the summary appears instantly without another API call.
Score-colored rankings
Story scores color-code by heat: orange for 500+ points, warm amber for 200+, gold for 50+, dim gray for under 10. Comment counts follow the same scheme so hot discussions pop visually. Story headlines render in a single clean row with right-aligned ▲score and comment count columns that align across the entire page.
Six feeds with pagination
Tab bar at the top switches between Top, New, Best, Ask, Show, and
Jobs feeds with h/l or direct
1-6 keys. Each feed loads 50 stories per
page from the 500-item HN ID pool. n/p
paginates; the page indicator shows 1/17 in the tab
bar. Switching feeds resets to page one.
HTML entity decoding
HN comments arrive as raw HTML with encoded entities
(', <p>).
cwnews decodes all HTML entities and strips tags before rendering,
so you never see ' or raw <p>
markers in comment text.
SQLite cache — always fast
Stories, comments, story-ID lists, and AI summaries all live in
a single SQLite file at ~/.local/share/cwnews/cwnews.db.
Re-opening a previously viewed thread shows comments immediately
while a background refresh fetches any new replies. Cached summaries
mean the AI panel is instant on the second press of s.
Download a pre-built binary from the
Google Drive release folder
(current build: v0.1; macOS arm64 / amd64 and Windows amd64). Drop it
somewhere on your PATH and make it executable:
# macOS curl -L <download-url> -o ~/.local/bin/cwnews chmod +x ~/.local/bin/cwnews # Windows (PowerShell) Invoke-WebRequest <download-url> -OutFile cwnews.exe
Create a config file at ./config.json or
~/.config/cwnews/config.json:
{
"theme": "hn",
"ai": {
"api_key": "sk-...",
"model": "deepseek-v4-flash",
"summary_language": "zh"
},
"ui": {
"sidebar_width_ratio": 0.40
},
"cache_ttl_minutes": 5
}
Set "summary_language" to "en" for
English summaries or "zh" for Chinese. The AI API key
is the same DeepSeek key used by cwcode and cwmail.
Run it.
cwnews
Do I need a Hacker News account?
No. cwnews is read-only. It uses the free HN Firebase API. No login, no voting, no posting — just reading and AI summarization.
How much does the AI summary cost?
DeepSeek V4 Flash costs ~$0.14 per million input tokens and ~$0.28 per million output tokens. A typical thread summary uses about 15K input tokens (the comments) and produces 1-2K output tokens, so roughly $0.003 per summary. Cached summaries are free.
Does it work without an API key?
Yes. Everything except AI summarization works without
a key. Browse stories, fold comments, change themes — the API key
is only needed when you press s for a summary.
Can I change the theme?
Press t to cycle through three themes:
hn (dark, orange accents), hn-classic
(cream background, matches real HN), and zinc
(cyan-accented dark). The active theme shows in the footer.
What keybindings does it use?
Vim-style throughout: j/k to
navigate, g/G for top/bottom,
d/u for half-page scroll,
h/l to switch feeds,
Enter to open a story and focus comments,
Tab to switch between panels, q to quit.
The footer bar in each view shows the context-relevant keys.
Does it work with cwcode?
Yes. cwcode can check HN headlines via cwnews, and the two share the same DeepSeek API key. Run them side-by-side in split tmux panes for a full terminal workstation.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。