展示HN:bbcli – 一个TUI和CLI,像黑客一样浏览BBC新闻
Show HN: bbcli – A TUI and CLI to browse BBC News like a hacker

原始链接: https://github.com/hako/bbcli

## bbcli:一个基于Rust的BBC新闻终端阅读器 bbcli是一个使用Rust和ratatui库构建的BBC新闻命令行界面。它在你的终端内提供了一种紧凑的、类似Vim的导航体验。适用于Linux、macOS和Windows,可以通过预构建的二进制文件(GitHub Releases)或像`cargo-binstall`和`cargo install`这样的包管理器进行安装。 该应用显示一个编号的新闻标题列表,可以通过`j/k`(或方向键)进行导航。用户可以在浏览器中打开文章(`o`),以无干扰阅读模式查看文章(`a`/Enter),或刷新新闻源(`r`)。一个预览窗格(使用Tab键切换)显示文章图片和描述。 bbcli支持各种图像协议(自动、半块、Sixel、Kitty),并提供可定制的主题(亮色/暗色)和排序方式。它还具有一个CLI模式,用于快速访问新闻标题,无需TUI。新闻每5分钟自动刷新一次,并缓存以供离线阅读,并提供可配置的缓存清除选项。自定义键绑定也通过TOML配置文件支持。

一位开发者在Hacker News分享了“bbcli”,一个基于终端的新工具(TUI & CLI),用于通过RSS订阅浏览BBC新闻。用户可以直接在终端阅读标题、预览和全文。 这个帖子引发了关于TUI优势的讨论——速度、一致性和键盘控制——与通用文本浏览器(如Lynx)相比,后者在处理现代网站时存在困难。一位评论员提到了模拟Ceefax等旧文本服务的怀旧吸引力。 对话还涉及了关于网站探测的法律问题,引用了过去有人因“计算机滥用”罪被起诉的案例,当时他正在测试一个网站。尽管如此,许多评论员赞扬了这个工具,强调了日常使用的TUI的实用性,并链接到构建类似应用程序的资源,例如Ratatui。最后,一个不同的声音表达了对从BBC获取新闻的怀疑。
相关文章

原文

Browse BBC News like a hacker.

A terminal-based BBC News reader built with Rust and ratatui, featuring a compact, numbered list interface with vim-like navigation.

Note: This is a complete rewrite of bbcli in Rust.

Download pre-built binaries:

Download pre-built binaries for your platform from GitHub Releases:

Available for:

  • Linux: x86_64 (gnu/musl), aarch64 (gnu/musl)
  • macOS: x86_64 (Intel), aarch64 (Apple Silicon)
  • Windows: x86_64
  • BSD: FreeBSD, NetBSD

Using cargo-binstall (Also Recommended)

Fast binary installation without compiling:

# Install cargo-binstall first if needed
# See: https://github.com/cargo-bins/cargo-binstall

cargo binstall bbc-news-cli
# Install from crates.io
cargo install bbc-news-cli
git clone https://github.com/hako/bbcli
cd bbcli
cargo build --release
cargo install --path .

bbcli works best in modern terminals with full Unicode and image protocol support:

Recommended terminals:

  • WezTerm - Excellent image support (Sixel, Kitty, iTerm2)
  • Ghostty - Fast, GPU-accelerated with Kitty protocol
  • Rio - Modern, hardware-accelerated
  • Alacritty - Fast, minimal (Halfblocks mode for images)
  • Kitty - Full Kitty graphics protocol support
  • iTerm2 (macOS) - Inline images protocol

Image protocols:

  • Press p to cycle through: Auto / Halfblocks / Sixel / Kitty
  • Auto mode detects your terminal's capabilities
  • Halfblocks works in all terminals (Unicode-based)
# Launch interactive TUI
bbcli

# Or use CLI mode (see below)
bbcli list

bbcli includes a powerful CLI mode for quick access to headlines and articles without launching the full TUI.

# List top stories
bbcli list

# List from specific feed
bbcli --feed world list
bbcli --feed technology list
bbcli --feed business list
# Open article #3 in browser
bbcli open 3

# Open from specific feed
bbcli --feed technology open 1
# Read article #2 in terminal (reader mode)
bbcli show 2

# Show article from specific feed
bbcli --feed world show 5

Use -f or --feed with any of these feeds:

  • top (default) - Top Stories
  • world - World News
  • uk - UK News
  • business / biz - Business
  • politics / pol - Politics
  • health - Health
  • education / edu - Education & Family
  • science / sci - Science & Environment
  • technology / tech - Technology
  • entertainment / ent - Entertainment & Arts
  • Regional: england, scotland, wales, northern ireland
  • International: africa, asia, europe, latin america, middle east, us & canada
Key Action
j / Scroll down
k / Scroll up
G Scroll to bottom
l Go to latest (top)
Key Action
o Open article in browser
O Open article in new tab
Space Jump to current ticker article
r Refresh news
Key Action
Tab Toggle preview pane
a / Enter Open full article view
f Open feed selector
? Toggle help menu
Key Action
s Cycle sort order (Default / Newest First / Oldest First)
t Toggle date format (humanized / absolute)
T Cycle theme (light / dark)
p Cycle image protocol (Auto / Halfblocks / Sixel / Kitty)

Press f to open the feed menu and switch between different BBC News feeds:

  • Top Stories (default)
  • World
  • UK
  • Business
  • Politics
  • Health
  • Education & Family
  • Science & Environment
  • Technology
  • Entertainment & Arts
  • Regional feeds (England, Northern Ireland, Scotland, Wales)
  • International regions (Africa, Asia, Europe, Latin America, Middle East, US & Canada)

Navigate with j/k or arrow keys, press Enter to select, f or Esc to close.

Press Tab to toggle the preview pane, which displays a 80/20 split showing:

  • Article image (with configurable image protocol support)
  • Title and description
  • Publication date and feed name

Press Enter or a to open the full article view with reader mode:

  • Clean, distraction-free article text
  • Scrollable with j/k or arrow keys
  • Press Tab, Enter, or Esc to return to list view

Press s to cycle through sort orders:

  • Default: RSS feed order (as received)
  • Newest First: Sort by publication date, newest at top
  • Oldest First: Sort by publication date, oldest at top

Sort order persists across manual and automatic refreshes.

The footer displays breaking news headlines from Top Stories feed, rotating every ~10 seconds. Press Space to instantly jump to the current ticker article in the feed.

The app automatically refreshes news every 5 minutes, keeping stories visible during refresh (no loading placeholder).

Press T to cycle between light and dark themes. The default theme can be set in your config file.

bbcli automatically caches feeds and articles to disk for offline reading:

To clear the cache:

Custom keybindings can be defined in either:

$HOME/.bbcli

Or:

$HOME/.config/bbcli

See example-config.toml for all available options:

# Theme: "light" or "dark" (default: "dark")
theme = "dark"

[keybindings]
quit = 'q'
open = 'o'
open_new_tab = 'O'
refresh = 'r'
latest = 'l'
scroll_up = 'k'
scroll_down = 'j'
scroll_bottom = 'G'

Copy the example config:

cp example-config.toml ~/.bbcli

Or create your own custom configuration with preferred keybindings and theme.

Inspired and extended by the original bbcli python version.

MIT

联系我们 contact @ memedata.com