Hntui: A Text-Based Interface for Browsing Hacker News Lists in Vim Style from the Terminal

If you need a tool to view Hacker News directly from your terminal, give Hntui a try. You can switch between the Latest, New, Best, Ask, Show, and Jobs lists like tabs and navigate quickly using Vim-style keybindings. Most actions are also supported via mouse, making it convenient and easy on the wrists. If you come across a post you like while reading, you can add it to your saved list with a single shortcut key and revisit it later. The saved list is stored in a local JSON file, so it persists even after sessions change. It offers both dark and light themes, allowing you to adjust the screen to your ambient lighting, and features a scanner effect during loading that catches the eye. In this article, we will guide you step-by-step through Hntui’s core features, installation, and update methods, complete with specific examples.



=

Hntui: A Text-Based Interface for Browsing Hacker News Lists in Vim Style from the Terminal

Hntui: A Text-Based Interface for Browsing Hacker News Lists in Vim Style from the Terminal

1. Basic Navigation

1. Basic Navigation
1. Basic Navigation

Hntui is designed to let you cycle through six Hacker News lists within the terminal window. You can instantly switch between Latest, New, Best, Ask, Show, and Jobs by clicking the tabs located in the top area or pressing the corresponding number keys on your keyboard. Within each list, you can move item by item using the up and down arrow keys or the Vim-style j and k keys. If you want to navigate quickly by page, you can scroll down half a page with the Spacebar and up half a page with Shift+Spacebar. To jump directly to the top or bottom of the list, use the g and G keys. If you want to refresh the current feed, press the y key to load the latest data along with a scanner effect. For mouse users, simply clicking on the list performs the same actions, allowing those unfamiliar with keyboard shortcuts to adapt easily. Thanks to this intuitive navigation method, even terminal beginners can quickly skim through Hacker News.

💡 Key Point
Easily navigate between lists and scroll through items using tabs and Vim-style key combinations.

2. Viewing Comments and Handling Links

When you select a desired title from the post list by pressing the Enter key, the comment tree for that post expands on the screen. In the comment list, you can move up and down using j and k to read individual comments. Nested replies within comments can be collapsed and expanded using the left and right arrow keys or the h and l keys, making it easy to grasp deep conversations at a glance. If you want to view a specific comment in the tree in more detail, double-clicking that line will expand the body text. Comments often contain external links; clicking one opens a small popup window where you can open or copy the link directly. Clicking outside the popup or pressing the Esc key closes the window and returns you to the previous screen. Users who prefer the mouse can click on comment headers to collapse or expand the tree and double-click the body text to bring up the link popup. With both keyboard and mouse controls for comment trees and link handling, your reading flow remains uninterrupted.


💡 Key Point
Intuitively manipulate comment tree collapsing/expanding and link popups with both keyboard and mouse.

3. Saved List and Theme Switching

If you encounter a post or comment you want to revisit later, press the s key to add the current item to your saved list. A small star icon appears next to saved items, allowing you to easily see which posts you have saved. To view your saved list, click the star tab located at the far right of the screen or press the S key to navigate there immediately. The saved list is recorded in the .config/hntui/saved.json file under your user home directory, so the content remains intact even if you close and restart the terminal. On first launch, if a configuration file from a previous version (hackernuis) exists, it is automatically migrated so you don’t lose your previous settings. You can switch between dark and light themes by pressing the t key. The dark theme uses a black background with orange accents, while the light theme follows the Hacker News website’s white background and beige row highlights. Theme changes are applied instantly, helping to reduce eye strain. Both saving and theme switching are handled with simple shortcuts, keeping your workflow uninterrupted.

💡 Key Point
Supports saving posts and switching themes with a single key input, enhancing user convenience.

4. Installation Methods and Runtime Environment

Hntui is distributed as a standalone binary that requires no external libraries. You can download the Apple Silicon binary for macOS and x64/arm64 binaries for Linux from the official release page; simply download the file matching your operating system to run it immediately. For Intel-based Macs, compiling the source using the bun package manager is also an option, requiring bun version 1.2 or higher. While direct testing on Linux and Windows was not conducted, it should work without issues on most systems as long as the terminal supports truecolor output, mouse input, and UTF-8 based encoding. Actual testing was performed on the latest terminal emulator on macOS, where both keyboard and mouse inputs were confirmed to function correctly. After downloading the binary, grant execute permissions to the executable file and simply type the hntui command in your terminal to start the program. Thanks to this simple installation process, you can start using it immediately without managing dependencies.

💡 Key Point
Run immediately on macOS and Linux terminals as a dependency-free standalone binary.

5. Updates and Release Workflow

If you installed it as a binary, entering the hntui update command will check for the latest version and replace the current file to update. If you installed from source using bun, running bun update, similar to a standard package manager update, will also refresh the hntui package. When a new version is released, a notification appears in the status bar, ensuring you can apply the latest features without missing them. The developers have configured the system so that pushing a git tag automatically triggers the binary build and npm publishing workflows. The binary workflow uses the bun build –compile command to create executables for each platform, runs a smoke test before release, and attaches the final archive to GitHub. The npm workflow uploads to the package registry using OIDC-based trusted publishing, skipping existing versions to prevent duplicates. Thanks to this systematic release process, users can always obtain a stable version.

💡 Key Point
Keep both the binary and package up to date with the latest version using simple commands.

6. Future Directions and Reader Action

In the future, plans are in place to allow customizable keyboard layouts so individuals can set their most comfortable key maps. Additionally, a tagging feature will be added to the saved list to categorize posts by topic of interest and filter them quickly. Reflecting community feedback, mouse gestures will be expanded to include more frequently used commands in the right-click menu. Currently, only dark and light themes are available, but a custom theme option allowing users to define their own colors will be added to support more flexible screen configurations. As these features are implemented one by one, Hntui will establish itself as a complete news reader within the terminal, going beyond a simple feed viewer. If you open your terminal and run hntui this evening, you will feel the difference immediately.

💡 Key Point
Preparing custom keymaps, tagged saving, and custom themes to provide a richer terminal news experience.

Frequently Asked Questions

What terminal is required to run Hntui?
It works on most modern terminals that support truecolor output, recognize mouse input, and handle UTF-8 based encoding. While tested on macOS, it is expected to work normally on Linux GNOME Terminal and Windows Terminal on Windows as well.
Where is the saved list stored, and how do I back it up?
It is stored in JSON format in the .config/hntui/saved.json file under your user home directory. You can restore the same list at any time by copying this file or including it in cloud storage.
Why doesn’t normal text selection work when using the mouse?
Because Hntui directly captures mouse events to handle scrolling and click commands, the default terminal text selection function is obscured. On macOS, you can copy the desired section by holding the Option key while dragging and pressing Cmd-C. On Linux, hold the Shift key while dragging and press Ctrl-Shift-C.
What if I want to use colors other than the dark and light themes?
In the current version, you can only switch between the two themes using the t key, but a feature to load custom color files is planned for the next update. Until then, you can easily change the atmosphere by adjusting the terminal’s background and foreground colors via environment variables.

=