Show HN: Hntui – A TUI for Hacker News

Hacker News by 5 min read 508x views
Show HN: Hntui – A TUI for Hacker News

Share Post

A sleek and elegant tui for browsing among the finest tech news sources.

hntui — Hacker News in your terminal

curl -fsSL https://raw.githubusercontent.com/ahmd-sh/hntui/main/install.sh | sh hntui 
  • Browse all six HN feeds: Top, New, Best, Ask, Show, and Jobs.
  • Navigate through a post's comments.
  • Save posts for later.
  • Vim + mouse support.
  • Themes.
  • ... and a really chill Knight Rider scanner animation for loaders (⁠◕⁠ᴗ⁠◕⁠ )

Any contemporary terminal alongside truecolor, mouse support, and UTF-8 volition work. I've tested it in Ghostty on MacOS. Linux/Windows is supported by OpenTUI but I haven't tried it (yet).

The prebuilt binaries have no dependencies. Installing through npm (or hacking on the code) needs Bun 1.2 or newer.

curl -fsSL https://raw.githubusercontent.com/ahmd-sh/hntui/main/install.sh | sh

Installs a self-contained binary to ~/.local/bin. You can additionally catch a binary for your phase immediately from the releases page. Binaries shield macOS (Apple Silicon) and Linux (x64, arm64) — on an Intel Mac, use the Bun instal below.

bun add -g @ahmd-sh/hntui

Or run it formerly without installing:

Press q (or Ctrl-C) to quit.

Checks the latest publish and, for binary installs, replaces itself in place. Bun installs update alongside bun add -g @ahmd-sh/hntui alternatively (hntui update volition inform you so). When a newer publish exists, the position bar shows a quiescent hint. hntui --version prints the installed version.

Key Action
j / ↓, k / ↑ Move cursor
gg, G Jump to archetypal or last
Ctrl-D, Ctrl-U, PgDown, PgUp Scroll a fractional page
c, Enter Open the narrative and peruse its comments
h / ←, l / → Previous or next tab
Tab, Shift-Tab Cycle through tabs
1 through 6 Jump to a particular category
S Jump to the Saved list
s Save or unsave the highlighted post
o Open the story's URL in your browser
r Refresh the current feed
t Toggle theme
q, Ctrl-C Quit
Key Action
j / ↓, k / ↑ Move the comment cursor
gg, G Jump to archetypal or final comment
Ctrl-D, Ctrl-U, PgDown, PgUp Scroll a fractional page
Space Collapse or develop the current subtree
Enter Open the links popup for the current comment
s Save or unsave this story
o Open the story's URL
Esc, Backspace, h / ← Back to the list
t Toggle theme
q Quit
Key Action
j, k, ↑, ↓ Move
gg, G First or final link
o, Enter Open the highlighted link
Esc, Backspace Close the popup

Context list (right-click)

Key Action
j / ↓, k / ↑ Move
Enter Activate
Esc, Backspace Close

Most things you can do alongside the keyboard, you can do alongside a mouse too.

  • Click a tab to toggle feeds.
  • Click the Y tile to refresh the current nourish (or to exit a narrative rear to its list).
  • Click any narrative row to choose it. Click it again to open the comments.
  • Right-click a narrative to open a environment list alongside Save, Open URL, and Open Comments.
  • Click a comment's header row to downfall or develop its subtree.
  • Double-click a comment's build to open its links popup.
  • Click the narrative URL in the item header to open it in your browser.
  • Click exterior a popup or environment list to disregard it.
  • Use your scroll rotor to scroll lists and comment trees.

Selecting and copying text

Because the app captures mouse events, your terminal's normal click-and-drag choice is intercepted. To choose content the regular way:

  • On macOS (Terminal.app, iTerm2, WezTerm, Ghostty), clasp Option during you drag, afterward Cmd-C.
  • On Linux (Kitty, Alacritty, WezTerm, GNOME Terminal), clasp Shift during you drag, afterward Ctrl-Shift-C.

Press t to toggle. The dreary theme is mostly dreary alongside orange accents. The ray theme is loyal to news.ycombinator.com: pale background, orange topbar, the acquainted beige row highlight, and HN's traditional gray byline text.

Press s on any narrative to preserve it. Saved posts get a small celebrity next to the heading and display up in the Saved tab on the correct flank of the tab strip. The catalog persists throughout sessions in ~/.config/hntui/saved.json as a small JSON file. (Config from the app's hackernuis days is migrated automatically on archetypal run.) Press s again to eliminate a article from the list.

S jumps direct to the Saved catalog from anywhere.

git copy https://github.com/ahmd-sh/hntui.git cd hntui bun install bun dev # hot reload

Data comes from the community Hacker News Firebase API.

Pushing a v* tag triggers two workflows:

  • .github/workflows/release.yml cross-compiles standalone binaries (bun build --compile) for macOS and Linux (arm64 and x64), smoke-tests the Linux build against the live API, and attaches the tarballs to a GitHub release. This is what install.sh downloads.
  • .github/workflows/publish.yml publishes @ahmd-sh/hntui to npm via OIDC trusted publishing, alongside a SLSA provenance attestation linking the tarball rear to the exact commit and workflow run that produced it. It skips gracefully if the type is already on npm.

To publish a new version:

npm type place # or insignificant / major git shove --follow-tags
  • OpenTUI by Anomaly. The native TUI center that makes all of this possible.
  • opentui-spinner by Matt Simpson. The Knight Rider loading scanner is adapted from examples/knight-rider/utils.ts (MIT).
  • Effect for empowering the data tier under the hood.
  • Hacker News for the satisfied and the open API.

MIT, Copyright (c) 2026 Ahmed Shaikh.

Other Article Hacker News
↑
Close Right Ads
Close Left Ads