hntui README

README проекта с github.com/ahmd-sh/hntui. Одним файлом markdown: README.md.

hntui: Hacker News in your terminal!

A sleek and elegant tui for browsing one of the best tech news sources.

hntui — Hacker News in your terminal

curl -fsSL https://raw.githubusercontent.com/ahmd-sh/hntui/main/install.sh | sh
hntui

What it does

Requirements

Any modern terminal with truecolor, mouse support, and UTF-8 will work. I've tested it in Ghostty on MacOS. Linux/Windows is supported by OpenTUI but I haven't tried it (yet).

The prebuilt binaries have no dependencies. Installing through npm (or hacking on the code) needs Bun 1.2 or newer.

Install

curl -fsSL https://raw.githubusercontent.com/ahmd-sh/hntui/main/install.sh | sh

Installs a self-contained binary to ~/.local/bin. You can also grab a binary for your platform directly from the releases page. Binaries cover macOS (Apple Silicon) and Linux (x64, arm64) — on an Intel Mac, use the Bun install below.

With Bun

bun add -g @ahmd-sh/hntui

Or run it once without installing:

bunx @ahmd-sh/hntui

Run

hntui

Press q (or Ctrl-C) to quit.

Updating

hntui update

Checks the latest release and, for binary installs, replaces itself in place. Bun installs update with bun add -g @ahmd-sh/hntui instead (hntui update will tell you so). When a newer release exists, the status bar shows a quiet hint. hntui --version prints the installed version.

Keybindings

hntui speaks vim: j/k to move, gg/G to jump, Ctrl-D/Ctrl-U to scroll, J/K to hop between top-level comment threads, c to fold the thread you're reading, Esc/h to go back. Press ? in any view for the full list of shortcuts on that page.

Mouse

Most things you can do with the keyboard, you can do with a mouse too.

Selecting and copying text

Because the app captures mouse events, your terminal's normal click-and-drag selection is intercepted. To select text the regular way:

Themes

Press t to toggle. The dark theme is mostly black with orange accents. The light theme is faithful to news.ycombinator.com: white background, orange topbar, the familiar beige row highlight, and HN's classic grey byline text.

Saved posts

Press s on any story to save it. Saved posts get a small star next to the title and show up in the Saved tab on the right side of the tab strip. The list persists across sessions in ~/.config/hntui/saved.json as a small JSON file. (Config from the app's hackernuis days is migrated automatically on first run.) Press s again to remove a post from the list.

S jumps straight to the Saved list from anywhere.

Development

git clone https://github.com/ahmd-sh/hntui.git
cd hntui
bun install
bun dev    # hot reload

Data comes from the public Hacker News Firebase API.

Releases

Pushing a v* tag triggers two workflows:

To release a new version:

npm version patch   # or minor / major
git push --follow-tags

Acknowledgments

License

MIT, Copyright (c) 2026 Ahmed Shaikh.

hntui (ahmd-sh/hntui)

Ищем в базе…

Что это?hntui — терминальный интерфейс для чтения Hacker News: все шесть лент (Top, New, Best, Ask, Show, Jobs), навигация по комментариям, сохранённые посты, поддержка vim и мыши, темы и загрузочная анимация в духе Knight Rider.
Это отдельное приложение или библиотека, которую я подключу?Это отдельное терминальное приложение, которое запускается напрямую, построенное на нативном TUI-фреймворке OpenTUI, а не библиотека для других проектов.
Как его установить и запустить?Проще всего установщик автономного бинарника, кладущий самодостаточный бинарник в ~/.local/bin, либо можно скачать бинарник для своей платформы со страницы релизов. Альтернативно, при установленном Bun, его можно запустить один раз без установки или поставить как пакет.
Нужен ли установленный Bun, чтобы этим пользоваться?Готовые бинарники вообще не имеют зависимостей. Bun 1.2 или новее нужен, только если ставите через npm/Bun или хотите ковыряться в коде.
Работает ли он на Intel Mac или Windows?Готовые бинарники покрывают только macOS на Apple Silicon и Linux (x64, arm64); на Intel Mac придётся идти путём установки через Bun. Поддержку Windows даёт OpenTUI, но автор её ещё не проверял.
Какие терминалы и платформы он поддерживает?Подойдёт любой современный терминал с truecolor, поддержкой мыши и UTF-8; автор тестировал его в Ghostty на macOS, а поддержка Linux и Windows идёт от фреймворка OpenTUI.
Где хранятся мои сохранённые данные?Сохранённые посты лежат локально в небольшом JSON-файле ~/.config/hntui/saved.json; наружу ничего не отправляется, кроме запросов данных HN к его публичному API.
Как сохранить пост на потом?Нажмите s на любой новости, чтобы сохранить её (повторное нажатие убирает из сохранённых). У сохранённых постов появляется маленькая звёздочка, и они собраны на вкладке Saved, куда мгновенно переносит клавиша S.
Можно пользоваться мышью вместо клавиш vim?Да, почти всё работает мышью: клик по вкладкам переключает ленты, клик по строкам выделяет или открывает новости, правый клик вызывает контекстное меню, колесо прокручивает.
Как выделить и скопировать текст из терминала?hntui перехватывает события мыши, поэтому обычное выделение протяжкой не работает. На macOS удерживайте Option во время выделения, затем Cmd-C; на Linux удерживайте Shift, затем Ctrl-Shift-C.
Откуда берутся данные Hacker News?Данные приходят из публичного Firebase API Hacker News.
Какие есть похожие проекты?Horizon, opentui, Inquirer.js, tokscale, gh-dash, tincan-cli, wuzz, dsh-TUI
Автор
ahmd-sh
Размер
1.3 MB
Звёзды
154
Возраст
6 мес
Коммиты · 90 дней