Repository navigation
hn v0.1.0
hn v0.1.0
hn is a terminal reader for Hacker News, written in Rust. It is for people who want to browse stories and read full comment threads without leaving the terminal.
Highlights
- Browse Top, New, and Best stories with paging, and read full comment threads with expand/collapse, sibling and parent navigation, and a reading position that is restored when you reopen a discussion in the same run.
- Save stories for later with
sand revisit them in the Saved view (4). Saved stories persist across restarts and need no account. - Optional AI summaries of the article and discussion through OpenRouter or Anthropic, with Fast and Thorough profiles, automatic summaries when you open a story, and numbered citations that jump to the cited comment.
- On macOS with Ghostty, open the original article in a companion browser pane beside the discussion. Other setups open it in the default browser.
- Automatic light/dark colour detection with
HN_THEMEoverride,NO_COLORsupport, andHN_REDUCED_MOTION=1to disable animations.
Install
git clone https://github.com/Shaance/hackernews-cli.git
cd hackernews-cli
cargo install --path . --locked
hncargo install places the hn binary in $CARGO_HOME/bin, normally ~/.cargo/bin. Keep that directory on your shell's PATH.
Requirements and optional setup
- Rust and Cargo, version 1.88 or newer.
- Browsing and saving stories work without an API key.
- Summaries need an OpenRouter or Anthropic API key, entered once in the
Msettings form or supplied asOPENROUTER_API_KEYorANTHROPIC_API_KEY. - The Ghostty article pane is macOS-only and needs Ghostty plus terminal-browser v0.13.4. See
scripts/ghostty/README.mdfor setup.
Known limitations
- Summaries send extracted article text and sampled comment excerpts to the selected provider using your API credits. Article extraction can be partial, and discussion summaries use a sample of comments.
- The Ghostty companion pane requires macOS, Ghostty, and a terminal at least 110 columns wide. Otherwise the article opens in the default browser.
- Summaries, captured sources, and reading positions are kept in memory for the current run only. Restarting
hnstarts a new reading session, while saved stories and summary settings persist.