{"id":13594553,"url":"https://github.com/aome510/hackernews-TUI","last_synced_at":"2025-04-09T07:32:54.252Z","repository":{"id":39668720,"uuid":"338988090","full_name":"aome510/hackernews-TUI","owner":"aome510","description":"A Terminal UI to browse Hacker News","archived":false,"fork":false,"pushed_at":"2024-10-22T00:11:33.000Z","size":43651,"stargazers_count":573,"open_issues_count":5,"forks_count":21,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-04T22:51:36.683Z","etag":null,"topics":["article","customizable","hacker-news","newsreader","rust","terminal","tui","vim"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aome510.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-15T06:36:41.000Z","updated_at":"2024-11-02T04:42:39.000Z","dependencies_parsed_at":"2024-01-07T06:22:53.143Z","dependency_job_id":"0cd3c1cc-cca2-46e0-b4f8-0db56485e3f5","html_url":"https://github.com/aome510/hackernews-TUI","commit_stats":{"total_commits":456,"total_committers":6,"mean_commits":76.0,"dds":"0.013157894736842146","last_synced_commit":"eb0fcb0c953ab26382a04520b891a1cfd130e662"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aome510%2Fhackernews-TUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aome510%2Fhackernews-TUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aome510%2Fhackernews-TUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aome510%2Fhackernews-TUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aome510","download_url":"https://codeload.github.com/aome510/hackernews-TUI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223084636,"owners_count":17084909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["article","customizable","hacker-news","newsreader","rust","terminal","tui","vim"],"created_at":"2024-08-01T16:01:35.550Z","updated_at":"2024-11-06T16:31:31.491Z","avatar_url":"https://github.com/aome510.png","language":"Rust","funding_links":[],"categories":["Rust","Clients","\u003ca name=\"viewers\"\u003e\u003c/a\u003eViewers","Table of Contents"],"sub_categories":["CLI \u0026 TUI"],"readme":"# hackernews-TUI\n\n`hackernews_tui` is a fast and [customizable](https://github.com/aome510/hackernews-TUI/blob/main/docs/config.md) application for browsing Hacker News on the terminal.\n\n`hackernews_tui` is written in Rust with the help of [Cursive TUI library](https://github.com/gyscos/cursive/). It uses [HN Algolia APIs](https://hn.algolia.com/api/) and [HN Official APIs](https://github.com/HackerNews/API) to get Hacker News data.\n\n## Table of Contents\n\n- [Install](#install)\n  - [Binaries](#binaries)\n  - [Using Cargo](#using-cargo)\n  - [Docker Image](#docker-image)\n  - [Building from source](#building-from-source)\n  - [macOS](#macos)\n  - [Arch Linux](#arch-linux)\n  - [NetBSD](#netbsd)\n- [Examples](#examples)\n  - [Demo](#demo)\n- [Default Shortcuts](#default-shortcuts)\n  - [Global key shortcuts](#global-key-shortcuts)\n  - [Edit key shortcuts](#edit-key-shortcuts)\n  - [Key shortcuts for each View](#key-shortcuts-for-each-view)\n    - [Story View](#story-view-shortcuts)\n    - [Article View](#article-view-shortcuts)\n    - [Comment View](#comment-view-shortcuts)\n    - [Search View](#search-view-shortcuts)\n- [Configuration](#configuration)\n- [Authentication](#authentication)\n- [Logging](#logging)\n- [Roadmap](#roadmap)\n\n## Install\n\n### Binaries\n\nApplication's prebuilt binaries can be found in the [Releases Page](https://github.com/aome510/hackernews-TUI/releases).\n\n### Using cargo\n\nInstall the latest version from [crates.io](https://crates.io/crates/hackernews_tui) by running `cargo install hackernews_tui --locked`.\n\n### Docker image\n\nYou can download the binary image of the latest build from the `master` branch by running\n\n```shell\ndocker pull aome510/hackernews_tui:latest\n```\n\nthen run\n\n```shell\ndocker run -it aome510/hackernews_tui:latest\n```\n\nto run the application. You can also use your local configuration file when running the image by running\n\n```shell\ndocker run --rm -v ${CONFIG_FILE_PATH}:/app/hn-tui.toml -it aome510/hackernews_tui:latest\n```\n\nwith `${CONFIG_FILE_PATH}` is the path to the local configuration file.\n\n#### Building from source\n\nRun\n\n```shell\ngit clone https://github.com/aome510/hackernews-TUI.git\ncd hackernews-TUI\ncargo build --release\n```\n\nto build the application, then run\n\n```shell\n./target/release/hackernews_tui\n```\n\nto run the application, or\n\n```shell\nln -sf $PWD/target/release/hackernews_tui /usr/local/bin\n```\n\nto link the executable binary to `/usr/local/bin` folder.\n\n### Windows\n\n#### Via Scoop\n\nRun `scoop install hackernews-tui` to install the application.\n\n### macOS\n\n#### Via MacPorts\n\nRun `sudo port install hackernews-tui` to install the application.\n\n### Arch Linux\n\nRun `yay -S hackernews_tui` to install the application as an AUR package.\n\n### NetBSD\n\n#### Using the package manager\n\n```shell\npkgin install hackernews-tui\n```\n\n#### Building from source\n\n```shell\ncd /usr/pkgsrc/www/hackernews-tui\nmake install\n```\n\n## Examples\n\n### Demo\n\nDemo videos of `hackernews_tui` `v0.9.0` are available on [youtube](https://www.youtube.com/watch?v=m5O5QIlRFpc) and [asciinema](https://asciinema.org/a/459196)\n\n[![asciicast](https://asciinema.org/a/459196.svg)](https://asciinema.org/a/459196)\n\n### Story View\n\n![Example of a Story View](https://user-images.githubusercontent.com/40011582/147393397-71991e48-cba6-4f89-9d28-cafbc0143c42.png)\n\n### Article View\n\n![Example of an Article View](https://user-images.githubusercontent.com/40011582/147393483-06b57c07-3fa3-49ec-b238-a2d67905610d.png)\n\n### Search View\n\n![Example of a Search View](https://user-images.githubusercontent.com/40011582/147393493-41d52d9f-65cd-4f63-bf76-c11d9bea1f49.png)\n\n### Comment View\n\n![Example of a Comment View](https://user-images.githubusercontent.com/40011582/147393459-641dd6c3-3564-472c-83cd-e1865339c861.png)\n\n## Default Shortcuts\n\nIn each `View`, press `?` to see a list of supported keyboard shortcuts and their functionalities.\n\n![Example of a Help View](https://user-images.githubusercontent.com/40011582/147393555-5ca346ca-b59a-4a7f-ab53-b1ec7025eca4.png)\n\nThe below sections will list the application's default shortcuts, which can be customized by changing the [key mappings](https://github.com/aome510/hackernews-TUI/blob/main/docs/config.md#keymap) in the user's config file.\n\nFor more information about configuring the application's key mappings or defining custom shortcuts, please refer to the [config documentation](https://github.com/aome510/hackernews-TUI/blob/main/doc/config.md#keymap).\n\n### Global shortcuts\n\n| Command                 | Description             | Default Shortcut   |\n| ----------------------- | ----------------------- | ------------------ |\n| `open_help_dialog`      | Open the help dialog    | `?`                |\n| `close_dialog`          | Close a dialog          | `esc`              |\n| `quit`                  | Quit the application    | `[q, C-c]`         |\n| `goto_previous_view`    | Go to the previous view | `[backspace, C-p]` |\n| `goto_search_view`      | Go to search view       | `[/, C-s]`         |\n| `goto_front_page_view`  | Go to front page view   | `F1`               |\n| `goto_all_stories_view` | Go to all stories view  | `F2`               |\n| `goto_ask_hn_view`      | Go to ask HN view       | `F3`               |\n| `goto_show_hn_view`     | Go to show HN view      | `F4`               |\n| `goto_jobs_view`        | Go to jobs view         | `F5`               |\n\n### Edit shortcuts\n\n| Command                | Description                      | Default Shortcut |\n| ---------------------- | -------------------------------- | ---------------- |\n| `move_cursor_left`     | Move cursor to left              | `[left, C-b]`    |\n| `move_cursor_right`    | Move cursor to right             | `[right, C-f]`   |\n| `move_cursor_to_begin` | Move cursor to the begin of line | `[home, C-a]`    |\n| `move_cursor_to_end`   | Move cursor to the end of line   | `[end, C-e]`     |\n| `backward_delete_char` | Delete backward a character      | `backspace`      |\n\n## Scrolling shortcuts\n\n| Command     | Description             | Default Shortcut |\n| ----------- | ----------------------- | ---------------- |\n| `up`        | Scroll up               | `[k, up]`        |\n| `down`      | Scroll down             | `[j, down]`      |\n| `page_down` | Scroll up half a page   | `[d, page_down]` |\n| `page_up`   | Scroll down half a page | `[u, page_up]`   |\n| `top`       | Scroll to top           | `[g, home]`      |\n| `bottom`    | Scroll to bottom        | `[G, end]`       |\n\n### Shortcuts for each `View`\n\n#### Story View shortcuts\n\n| Command                        | Description                                           | Default Shortcut |\n| ------------------------------ | ----------------------------------------------------- | ---------------- |\n| `next_story`                   | Focus the next story                                  | `j`              |\n| `prev_story`                   | Focus the previous story                              | `k`              |\n| `next_story_tag`               | Go to the next story tag                              | `l`              |\n| `previous_story_tag`           | Go to the previous story tag                          | `h`              |\n| `goto_story`                   | Focus the {story_id}-th story                         | `{story_id} g`   |\n| `goto_story_comment_view`      | Go the comment view associated with the focused story | `enter`          |\n| `open_article_in_browser`      | Open in browser the focused story's article           | `o`              |\n| `open_article_in_article_view` | Open in article view the focused story's article      | `O`              |\n| `open_story_in_browser`        | Open in browser the focused story                     | `s`              |\n| `next_page`                    | Go to the next page                                   | `n`              |\n| `prev_page`                    | Go the previous page                                  | `p`              |\n| `cycle_sort_mode`              | Cycle story sort mode                                 | `d`              |\n\n#### Article View shortcuts\n\n| Command                     | Description                            | Default Shortcut |\n| --------------------------- | -------------------------------------- | ---------------- |\n| `open_article_in_browser`   | Open article in browser                | `a`              |\n| `open_link_in_browser`      | Open in browser {link_id}-th link      | `{link_id} o`    |\n| `open_link_in_article_view` | Open in article view {link_id}-th link | `{link_id} O`    |\n| `open_link_dialog`          | Open link dialog                       | `l`              |\n\n##### Link dialog shortcuts\n\n| Command                     | Description                           | Default Shortcut |\n| --------------------------- | ------------------------------------- | ---------------- |\n| `next`                      | Focus next link                       | `[j, down]`      |\n| `prev`                      | Focus previous link                   | `[k, up]`        |\n| `open_link_in_browser`      | Open in browser the focused link      | `[o, enter]`     |\n| `open_link_in_article_view` | Open in article view the focused link | `O`              |\n\n#### Comment View shortcuts\n\n| Command                        | Description                                                                     | Default Shortcut |\n| ------------------------------ | ------------------------------------------------------------------------------- | ---------------- |\n| `next_comment`                 | Focus the next comment                                                          | `j`              |\n| `prev_comment`                 | Focus the previous comment                                                      | `k`              |\n| `next_leq_level_comment`       | Focus the next comment with smaller or equal level                              | `l`              |\n| `prev_leq_level_comment`       | Focus the previous comment with smaller or equal level                          | `h`              |\n| `next_top_level_comment`       | Focus the next top level comment                                                | `n`              |\n| `prev_top_level_comment`       | Focus the previous top level comment                                            | `p`              |\n| `parent_comment`               | Focus the parent comment (if exists)                                            | `u`              |\n| `toggle_collapse_comment`      | Toggle collapsing the focused item                                              | `tab`            |\n| `vote`                         | Toggle voting the focused item (**requires [authentication](#authentication)**) | `v`              |\n| `open_article_in_browser`      | Open in browser the discussed article                                           | `a`              |\n| `open_article_in_article_view` | Open in article view the discussed article                                      | `A`              |\n| `open_story_in_browser`        | Open in browser the discussed story                                             | `s`              |\n| `open_comment_in_browser`      | Open in browser the focused comment                                             | `c`              |\n| `open_link_in_browser`         | Open in browser the {link_id}-th link in the focused comment                    | `{link_id} o`    |\n| `open_link_in_article_view`    | Open in article view the {link_id}-th link in the focused comment               | `{link_id} O`    |\n\n#### Search View shortcuts\n\nIn `SearchView`, there are two modes: `Navigation` and `Search`. The default mode is `Search`.\n\n`Search` mode is similar to Vim's insert mode, in which users can input a query string.\n\n`Navigation` mode allows the `SearchView` to behave like a `StoryView` of matched stories.\n\n`SearchView`-specific key shortcuts:\n\n| Command              | Description                                | Default Shortcut |\n| -------------------- | ------------------------------------------ | ---------------- |\n| `to_search_mode`     | Enter `Search` mode from `Navigation` mode | `i`              |\n| `to_navigation_mode` | Enter `Navigation` mode from `Search` mode | `\u003cesc\u003e`          |\n\n## Configuration\n\nBy default, `hackernews-tui` will look for the `hn-tui.toml` user-defined config file inside\n\n- the [user's config directory](https://docs.rs/dirs-next/latest/dirs_next/fn.config_dir.html)\n- `.config` directory inside the [user's home directory](https://docs.rs/dirs-next/latest/dirs_next/fn.home_dir.html)\n\nIf not found such file, the application will fall back to use a set of [default configurations](https://github.com/aome510/hackernews-TUI/blob/main/examples/hn-tui.toml).\n\nUser can also specify the path to config file when running the application with `-c` or `--config` option.\n\n```shell\nhackernews_tui -c ~/.config/hn-tui.toml\n```\n\nFor further information about the application's configurations, please refer to the [example config file](https://github.com/aome510/hackernews-TUI/blob/main/examples/hn-tui.toml) and the [config documentation](https://github.com/aome510/hackernews-TUI/blob/main/docs/config.md).\n\n## Authentication\n\nUsers can authenticate their account by specifying `username` and `password` inside the `hn-auth.toml` file:\n\n```toml\nusername=\"\"\npassword=\"\"\n```\n\nBy 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.\n\n## Logging\n\n`hackernews-tui` uses `RUST_LOG` environment variable to define the application's [logging level](https://docs.rs/log/0.4.14/log/enum.Level.html) (default to be `INFO`).\n\nBy default, the application creates the `hn-tui.log` log file inside the [user's cache directory](https://docs.rs/dirs-next/latest/dirs_next/fn.cache_dir.html), which can be configured by specifying the `-l` or `--log` option.\n\n## Roadmap\n\n- [x] make all commands customizable\n- [x] add a `View` to read the linked story in reader mode on the terminal. A list of possible suggestion can be found [here](https://news.ycombinator.com/item?id=26930466)\n- [x] add commands to navigate parent comments and collapse a comment\n- [x] make all the configuration options optional\n- integrate [HackerNews Official APIs](https://github.com/HackerNews/API) for real-time updating, lazy-loading comments, and sorting stories\n  - [x] lazy-loading comments\n  - [x] front-page stories like the official site\n  - [ ] real-time updating\n- [x] implement smarter lazy-loading comment functionality\n- add crediential support to allow\n  - [x] authentication\n  - [x] upvote/downvote\n  - [ ] add comment\n  - [ ] post\n- improve application's UI\n  - [x] improve the application's overall look\n  - [x] include useful font-highliting\n  - [x] rewrite the theme parser to support more themes and allow to parse themes from known colorschemes\n  - [ ] add some extra transition effects\n- improve the keybinding handler\n  - [x] allow to bind multiple keys to a single command\n  - [ ] add prefix key support (emacs-like key chaining - `C-x C-c ...`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faome510%2Fhackernews-TUI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faome510%2Fhackernews-TUI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faome510%2Fhackernews-TUI/lists"}