hackernews-TUI
hackernews_tui
is a Terminal UI to browse Hacker News with vim-like key bindings.
hackernews_tui
is written in Rust with the help of Cursive TUI library. It uses HN Algolia search APIs to get Hacker News data.
The application mainly consists of the following views:
Story View
displaying a list of stories. There are different kinds ofStory View
depending on thetag
it uses to filter stories:Front Page
: stories on the front-pageAll Stories
: all storiesAsk HN
: ask HN stories onlyShow HN
: show HN stories onlyJobs
: jobs stories only
Comment View
displaying a list of comments in a story.Search View
displaying a search bar and a list of stories matching the search query.
Why hackernews-TUI?
If you are either
- a Hacker News reader
- a computer nerd who likes doing things on terminal
- a vim key-bindings fanboy
- a person who prefers navigating using the keyboard over a mouse
This application is the right tool for you
Table of Contents
Install
Using cargo
crates.io
Install the latest version fromRun cargo install hackernews_tui
to install the application as a binary.
master
branch
Build from the 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
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
A quick demo video made from hackernews_tui
version v0.5.0
can be found here
Story View
Search View
Comment View
Shortcuts
In each View
, press ?/
to see a list of supported keyboard shortcuts and their functionalities:
Global key shortcuts
?/
: Open the help dialog/
: Quit the application/
: Go to the previous view/
: Go to front page view/
: Go to search view/
: Go to all stories view/
: Go to ask HN view/
: Go to show HN view/
: Go to jobs view/
View
Key shortcuts for each Story View shortcuts
j
: Focus the next storyk
: Focus the previous storyt
: Focus the story at the topb
: Focus the story at the bottom{story_id} g
: Focus the {story_id}-th story
: Go the comment view associated with the focused storyO
: Open in browser the link associated with the focused storyS
: Open in browser the focused storyn
: Go to the next pagep
: Go the previous paged
: Toggle sort by date/popularityq
: Filter stories past 24 hoursw
: Filter stories past weeke
: Filter stories past monthr
: Filter stories past year
Comment View shortcuts
j
: Focus the next commentk
: Focus the previous commentn
: Focus the next top level commentp
: Focus the previous top level commentl
: Focus the next comment with smaller or equal levelh
: Focus the previous comment with smaller or equal levelt
: Focus the comment at the topb
: Focus the comment at the bottomr
: Reload the comment view.O
: Open in browser the link associated with the discussed storyS
: Open in browser the discussed storyC
: Open in browser the focused comment{link_id} f
: Open in browser the {link_id}-th link in the focused comment
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 the query string.
Navigation
mode allows the SearchView
to behave like a StoryView
with all StoryView
shortcuts enabled.
Key shortcuts:
i
: EnterSearch
mode fromNavigation
mode
: EnterNavigation
mode fromSearch
mode
Navigation
mode also supports all StoryView
's key shortcuts beside q
,w
,e
,r
.
Configuration
By default, the application will look for ~/.config/hn-tui.toml
as its configuration file.
You can specify the path by specifying the -c
or --config
argument when running the application:
hackernews_tui -c ~/.config/hn-tui.toml
For further information about the config options, please refer to the example config file by running hackernews_tui --example-config
.
Note: all config options (as included in the example config file) are required. You can run
hackernews_tui --example-config > ~/.config/hn-tui.toml
then modify the config options in ~/.config/hn-tui.toml
based on your preferences.