HeadlinesBriefing favicon HeadlinesBriefing.com

Command-line tool brings Hacker News to the terminal

Hacker News •
×

Developers can now interact with Hacker News without opening a browser, thanks to the newly documented hn command‑line interface. Invoking `hn --help` lists four subcommands—`stories`, `go`, `comments`, and `comment`—each mapped to a specific API endpoint. The tool reports its version and offers a terse help flag, keeping the footprint lightweight. It supports both macOS and Linux environments, easing cross‑platform adoption.

`hn stories` pulls the list, accepting --sort_by to choose newest or best and `--limit` to cap results. `hn go <ID>` launches default browser at the story’s URL, while `hn comments <ID>` streams discussion thread to the terminal. Posting a reply uses `hn comment <ID>` with the same ID argument. The flags accept short aliases, e.g., `-s` for sort and `-l` for limit, mirroring Unix conventions.

By wrapping Hacker News’s public API in familiar shell verbs, the HackerNews CLI lets power users script feed aggregations, automate comment mining, or embed story links into dev‑ops dashboards. Because it runs on any system with Python, integration requires only a single `pip install`. The concise option set keeps the learning curve shallow, making it a practical addition to any terminal toolkit.