aome510
hackernews-TUI
Rust

A Terminal UI to browse Hacker News

Last updated Jul 5, 2026
714
Stars
30
Forks
9
Issues
+1
Stars/day
Attention Score
63
Language breakdown
No language data available.
โ–ธ Files click to expand
README

hackernews-TUI

hackernewstui is a fast and customizable application for browsing Hacker News on the terminal.

hackernewstui is written in Rust with the help of Cursive TUI library. It uses HN Algolia APIs and HN Official APIs to get Hacker News data.

Table of Contents

- Binaries - Using Cargo - Docker Image - Building from source - macOS - Arch Linux - NetBSD - Demo - Global key shortcuts - Edit key shortcuts - Key shortcuts for each View - Story View - Article View - Comment View - Search View

Install

Binaries

Application's prebuilt binaries can be found in the Releases Page.

Using cargo

Install the latest version from crates.io by running cargo install hackernews_tui --locked.

Docker image

You can download the binary image of the latest build from the master branch by running

docker pull aome510/hackernews_tui:latest

then run

docker run -it aome510/hackernews_tui:latest

to run the application. You can also use your local configuration file when running the image by running

docker run --rm -v ${CONFIGFILEPATH}:/app/hn-tui.toml -it aome510/hackernews_tui:latest

with ${CONFIGFILEPATH} is the path to the local configuration file.

Building from source

Run

git clone https://github.com/aome510/hackernews-TUI.git
cd hackernews-TUI
cargo build --release

to build the application, then run

./target/release/hackernews_tui

to run the application, or

ln -sf $PWD/target/release/hackernews_tui /usr/local/bin

to link the executable binary to /usr/local/bin folder.

Windows

Via Scoop

Run scoop install hackernews-tui to install the application.

macOS

Via MacPorts

Run sudo port install hackernews-tui to install the application.

Arch Linux

Run yay -S hackernews_tui to install the application as an AUR package.

NetBSD

Using the package manager

pkgin install hackernews-tui

Building from source

cd /usr/pkgsrc/www/hackernews-tui
make install

Examples

Demo

Demo videos of hackernewstui v0.9.0 are available on youtube and asciinema

asciicast

Story View

Example of a Story View

Article View

Example of an Article View

Search View

Example of a Search View

Comment View

Example of a Comment View

Default Shortcuts

In each View, press ? to see a list of supported keyboard shortcuts and their functionalities.

Example of a Help View

The below sections will list the application's default shortcuts, which can be customized by changing the key mappings in the user's config file.

For more information about configuring the application's key mappings or defining custom shortcuts, please refer to the config documentation.

Global shortcuts

| Command | Description | Default Shortcut | | ----------------------- | ----------------------- | ------------------ | | openhelpdialog | Open the help dialog | ? | | close_dialog | Close a dialog | esc | | quit | Quit the application | [q, C-c] | | gotopreviousview | Go to the previous view | [backspace, C-p] | | gotosearchview | Go to search view | [/, C-s] | | gotofrontpage_view | Go to front page view | F1 | | gotoallstories_view | Go to all stories view | F2 | | gotoaskhn_view | Go to ask HN view | F3 | | gotoshowhn_view | Go to show HN view | F4 | | gotojobsview | Go to jobs view | F5 |

Edit shortcuts

| Command | Description | Default Shortcut | | ---------------------- | -------------------------------- | ---------------- | | movecursorleft | Move cursor to left | [left, C-b] | | movecursorright | Move cursor to right | [right, C-f] | | movecursorto_begin | Move cursor to the begin of line | [home, C-a] | | movecursorto_end | Move cursor to the end of line | [end, C-e] | | backwarddeletechar | Delete backward a character | backspace |

Scrolling shortcuts

| Command | Description | Default Shortcut | | ----------- | ----------------------- | ---------------- | | up | Scroll up | [k, up] | | down | Scroll down | [j, down] | | pagedown | Scroll up half a page | [d, pagedown] | | pageup | Scroll down half a page | [u, pageup] | | top | Scroll to top | [g, home] | | bottom | Scroll to bottom | [G, end] |

Shortcuts for each View

Story View shortcuts

| Command | Description | Default Shortcut | | ------------------------------ | ----------------------------------------------------- | ---------------- | | next_story | Focus the next story | j | | prev_story | Focus the previous story | k | | nextstorytag | Go to the next story tag | l | | previousstorytag | Go to the previous story tag | h | | gotostory | Focus the {storyid}-th story | {story_id} g | | gotostorycomment_view | Go the comment view associated with the focused story | enter | | openarticlein_browser | Open in browser the focused story's article | o | | openarticleinarticleview | Open in article view the focused story's article | O | | openstoryin_browser | Open in browser the focused story | s | | next_page | Go to the next page | n | | prev_page | Go the previous page | p | | cyclesortmode | Cycle story sort mode | d |

Article View shortcuts

| Command | Description | Default Shortcut | | --------------------------- | -------------------------------------- | ---------------- | | openarticlein_browser | Open article in browser | a | | openlinkinbrowser | Open in browser {linkid}-th link | {link_id} o | | openlinkinarticleview | Open in article view {linkid}-th link | {linkid} O | | openlinkdialog | Open link dialog | l |

Link dialog shortcuts

| Command | Description | Default Shortcut | | --------------------------- | ------------------------------------- | ---------------- | | next | Focus next link | [j, down] | | prev | Focus previous link | [k, up] | | openlinkin_browser | Open in browser the focused link | [o, enter] | | openlinkinarticleview | Open in article view the focused link | O |

Comment View shortcuts

| Command | Description | Default Shortcut | | ------------------------------ | ------------------------------------------------------------------------------- | ---------------- | | next_comment | Focus the next comment | j | | prev_comment | Focus the previous comment | k | | nextleqlevel_comment | Focus the next comment with smaller or equal level | l | | prevleqlevel_comment | Focus the previous comment with smaller or equal level | h | | nexttoplevel_comment | Focus the next top level comment | n | | prevtoplevel_comment | Focus the previous top level comment | p | | parent_comment | Focus the parent comment (if exists) | u | | togglecollapsecomment | Toggle collapsing the focused item | tab | | vote | Toggle voting the focused item (requires authentication) | v | | openarticlein_browser | Open in browser the discussed article | a | | openarticleinarticleview | Open in article view the discussed article | A | | openstoryin_browser | Open in browser the discussed story | s | | opencommentin_browser | Open in browser the focused comment | c | | openlinkinbrowser | Open in browser the {linkid}-th link in the focused comment | {link_id} o | | openlinkinarticleview | Open in article view the {linkid}-th link in the focused comment | {linkid} O |

Search View shortcuts

In SearchView, there are two modes: Navigation and Search. The default mode is Search.

Search mode is similar to Vim's insert mode, in which users can input a query string.

Navigation mode allows the SearchView to behave like a StoryView of matched stories.

SearchView-specific key shortcuts:

| Command | Description | Default Shortcut | | -------------------- | ------------------------------------------ | ---------------- | | tosearchmode | Enter Search mode from Navigation mode | i | | tonavigationmode | Enter Navigation mode from Search mode | <esc> |

Configuration

By default, hackernews-tui will look for the hn-tui.toml user-defined config file inside

If not found such file, the application will fall back to use a set of default configurations.

User can also specify the path to config file when running the application with -c or --config option.

hackernews_tui -c ~/.config/hn-tui.toml

For further information about the application's configurations, please refer to the example config file and the config documentation.

Authentication

Users can authenticate their account by specifying username and password inside the hn-auth.toml file:

username=""
password=""

By default, the authentication file should be inside the same folder as the the general configuration file (hn-tui.toml), which can be configured by specifying the -a or --auth option.

Logging

hackernews-tui uses RUSTLOG environment variable to define the application's logging level (default to be INFO).

By default, the application creates the hn-tui.log log file inside the user's cache directory, which can be configured by specifying the -l or --log option.

Roadmap

  • [x] make all commands customizable
  • [x] add a View to read the linked story in reader mode on the terminal. A list of possible suggestion can be found here
  • [x] add commands to navigate parent comments and collapse a comment
  • [x] make all the configuration options optional
  • integrate HackerNews Official APIs for real-time updating, lazy-loading comments, and sorting stories
- [x] lazy-loading comments - [x] front-page stories like the official site - [ ] real-time updating
  • [x] implement smarter lazy-loading comment functionality
  • add crediential support to allow
- [x] authentication - [x] upvote/downvote - [ ] add comment - [ ] post
  • improve application's UI
- [x] improve the application's overall look - [x] include useful font-highliting - [x] rewrite the theme parser to support more themes and allow to parse themes from known colorschemes - [ ] add some extra transition effects
  • improve the keybinding handler
- [x] allow to bind multiple keys to a single command - [ ] add prefix key support (emacs-like key chaining - C-x C-c ...)
๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท aome510/hackernews-TUI ยท Updated daily from GitHub