{"id":50960731,"url":"https://github.com/danfry1/hacker-news-tui","last_synced_at":"2026-06-21T16:01:07.821Z","repository":{"id":364860069,"uuid":"1269497047","full_name":"danfry1/hacker-news-tui","owner":"danfry1","description":"A terminal UI for browsing Hacker News - feeds, threaded comments, bookmarks. Built with Rust and Ratatui.","archived":false,"fork":false,"pushed_at":"2026-06-15T21:04:10.000Z","size":3612,"stargazers_count":37,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T15:29:01.150Z","etag":null,"topics":["cli","crossterm","hacker-news","hackernews","news-reader","ratatui","rust","terminal","terminal-ui","tui"],"latest_commit_sha":null,"homepage":null,"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/danfry1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-14T19:36:35.000Z","updated_at":"2026-06-20T01:42:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/danfry1/hacker-news-tui","commit_stats":null,"previous_names":["danfry1/hacker-news-tui"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/danfry1/hacker-news-tui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfry1%2Fhacker-news-tui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfry1%2Fhacker-news-tui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfry1%2Fhacker-news-tui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfry1%2Fhacker-news-tui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danfry1","download_url":"https://codeload.github.com/danfry1/hacker-news-tui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfry1%2Fhacker-news-tui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34616512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","crossterm","hacker-news","hackernews","news-reader","ratatui","rust","terminal","terminal-ui","tui"],"created_at":"2026-06-18T13:33:11.960Z","updated_at":"2026-06-21T16:01:07.724Z","avatar_url":"https://github.com/danfry1.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hacker News TUI\n\nA fast, delightful terminal UI for browsing [Hacker News](https://news.ycombinator.com),\nbuilt with [Ratatui](https://ratatui.rs).\n\n![hacker-news-tui demo](https://raw.githubusercontent.com/danfry1/hacker-news-tui/main/demo/hacker-news-tui.gif)\n\n## Features\n\n- **Six feeds** — Top, New, Best, Ask, Show, and Jobs, switchable instantly.\n- **Infinite scroll** — the next batch of stories loads and appends automatically\n  as you scroll toward the bottom, so you can keep reading without paging.\n- **Bookmarks** — save stories with `s` and revisit them in the `★ Saved` view\n  (`b`); saved stories are marked with a star in every list.\n- **In-app settings pane** (`,`) — opt in to remembering read-state and\n  bookmarks across runs. Both are **off by default**: nothing is written to disk\n  unless you turn it on.\n- **Threaded comments** with colored depth guides, collapsible subtrees, and an\n  `OP` badge so you can follow the original poster.\n- **Async, non-blocking UI** — stories and whole comment trees are fetched\n  concurrently in the background while the interface stays responsive, with a\n  live loading spinner.\n- **Read-state tracking** — visited stories dim so you can see where you've been.\n- **Open in browser** — jump to the article or the HN discussion with one key.\n- **Smart HTML rendering** — HN's markup and entities are cleaned into readable,\n  word-wrapped text.\n\n## Running\n\n```sh\ncargo run --release\n```\n\nThe first build compiles dependencies; subsequent runs are instant.\n\n## Installing\n\n**Homebrew** (macOS / Linux):\n\n```sh\nbrew install danfry1/tap/hacker-news-tui\n```\n\n**Scoop** (Windows):\n\n```powershell\nscoop bucket add danfry1 https://github.com/danfry1/scoop-bucket\nscoop install hacker-news-tui\n```\n\n**Nix** (flakes):\n\n```sh\nnix run github:danfry1/hacker-news-tui          # run without installing\nnix profile install github:danfry1/hacker-news-tui\n```\n\n**Cargo** — from [crates.io](https://crates.io/crates/hacker-news-tui):\n\n```sh\ncargo install hacker-news-tui\n```\n\nOr grab a prebuilt binary from the [Releases](../../releases) page — each tagged\nrelease ships archives (with SHA-256 checksums) for:\n\n- Linux: `x86_64` and `aarch64`\n- macOS: `aarch64` (Apple Silicon)\n- Windows: `x86_64`\n\nIntel Macs aren't shipped as a prebuilt binary; install with\n`cargo install hacker-news-tui` instead.\n\nThe installed command is `hacker-news-tui`. For something shorter, add an alias\nto your shell config (`~/.zshrc`, `~/.bashrc`, …):\n\n```sh\nalias hnt='hacker-news-tui'\n```\n\nMaintainers cut a release by pushing a version tag:\n\n```sh\ngit tag v0.1.0\ngit push origin v0.1.0\n```\n\nThis triggers `.github/workflows/release.yml`, which builds every target and\nattaches the archives to a GitHub Release for the tag.\n\n## Keyboard shortcuts\n\n### Stories\n| Key | Action |\n| --- | --- |\n| `j` / `k`, `↑` / `↓` | Move selection |\n| `g` / `G` | Jump to top / bottom |\n| `enter` | Open comments |\n| `o` | Open the article in your browser |\n| `s` | Bookmark / unbookmark the story |\n| `b` | View bookmarks (`★ Saved`) |\n| `1`–`6`, `tab` / `shift+tab` | Switch feed |\n| `r` | Refresh |\n| `,` | Settings |\n| `?` | Help |\n| `q` | Quit |\n\n### Comments\n| Key | Action |\n| --- | --- |\n| `j` / `k`, `↑` / `↓` | Move selection |\n| `space` / `enter` | Collapse / expand a thread |\n| `o` | Open the article |\n| `s` | Bookmark / unbookmark |\n| `esc` / `h` / `←` | Back |\n\n### Settings (`,`) \u0026 Bookmarks (`b`)\nIn the settings pane, `j`/`k` move, `space`/`enter` toggle, `,`/`esc` close.\nIn the bookmarks view, `enter` opens comments, `o` opens the article, `s`\nremoves a bookmark, and `b`/`esc` returns to the feed.\n\n## Persistence \u0026 privacy\n\nRead-state and bookmarks can be remembered across runs, but **only when you\nenable them** in the settings pane (`,`). Both are **off by default**, so a fresh\ninstall writes nothing to disk; disabling them again removes the file entirely.\nWhen enabled, state lives in a single JSON file:\n\n| Platform | Location |\n| --- | --- |\n| macOS | `~/Library/Application Support/hacker-news-tui/state.json` |\n| Linux | `$XDG_DATA_HOME/hacker-news-tui/state.json` (or `~/.local/share/…`) |\n| Windows | `%APPDATA%\\hacker-news-tui\\state.json` |\n\nDelete that file to clear everything. All file operations are best-effort and\nfail silently — losing local UI state never interrupts browsing.\n\n## Supply-chain security\n\nThis project is built with a deliberately small, auditable dependency surface:\n\n- **`Cargo.lock` is committed**, pinning every transitive crate to an exact\n  version and checksum for reproducible builds.\n- **Pure-Rust TLS** via `rustls` — no linkage to a system OpenSSL. Root\n  certificates come from the OS trust store, so the app works behind corporate\n  proxies that present a privately-issued root CA.\n- **No avoidable dependencies** — browser opening and HTML decoding are a few\n  lines of `std` in `src/util.rs` rather than extra crates.\n\nTo audit the locked dependency tree for known advisories:\n\n```sh\ncargo install cargo-audit   # one-time\ncargo audit\n```\n\n## Architecture\n\n| File | Responsibility |\n| --- | --- |\n| `src/main.rs` | Terminal setup and the async event loop (input · fetch results · tick) |\n| `src/api.rs` | Hacker News Firebase API client and data types |\n| `src/app.rs` | Application state, input handling, async orchestration |\n| `src/ui.rs` | All rendering — pure functions of the app state |\n| `src/store.rs` | Best-effort persistence of settings, read-state, bookmarks |\n| `src/util.rs` | Time/URL/HTML/wrapping helpers (unit-tested) |\n\n## Development\n\nA [`justfile`](https://github.com/casey/just) wraps the common tasks (or run the\nunderlying `cargo` commands directly):\n\n```sh\njust            # full gate: fmt-check + clippy + test (what CI runs)\njust fmt        # apply formatting\njust test       # run the test suite\njust audit      # security-audit the locked dependencies (needs cargo-audit)\njust run        # run the app\n```\n\nGitHub Actions (`.github/workflows/ci.yml`) runs formatting, Clippy (warnings as\nerrors), the test suite, and `cargo audit` on every push and pull request.\n\n## Data source\n\nUses the official [Hacker News API](https://github.com/HackerNews/API). No API\nkey required.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanfry1%2Fhacker-news-tui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanfry1%2Fhacker-news-tui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanfry1%2Fhacker-news-tui/lists"}