Hacker News in your terminal. An interactive full-screen browser, a scriptable CLI, and a first-class JSON interface for agents — for news.ycombinator.com. Website · Agent guide · llms.txt hn is a single static binary on Linux and a universal binary on macOS. Native packages install hn, its man page, license, and README. The only runtime dependency is ca-certificates. Debian / Ubuntu VERSION=0.4.2 curl -LO "https://github.com/kaushalvivek/hn-cli/releases/download/v${VERSION}/hn_${VERSION}_amd64.deb" sudo apt install "./hn_${VERSION}_amd64.deb" Use arm64 instead of amd64 on ARM servers. Fedora / RHEL / openSUSE VERSION=0.4.2 curl -LO "https://github.com/kaushalvivek/hn-cli/releases/download/v${VERSION}/hn-${VERSION}-1.x86_64.rpm" sudo dnf install "./hn-${VERSION}-1.x86_64.rpm" # openSUSE: sudo zypper install "./hn-${VERSION}-1.x86_64.rpm" Use aarch64 instead of x86_64 on ARM servers. Arch Linux VERSION=0.4.2 curl -LO "https://github.com/kaushalvivek/hn-cli/releases/download/v${VERSION}/hn-${VERSION}-1-x86_64.pkg.tar.zst" sudo pacman -U "./hn-${VERSION}-1-x86_64.pkg.tar.zst" Use aarch64 instead of x86_64 on ARM servers. Alpine Linux VERSION=0.4.2 curl -LO "https://github.com/kaushalvivek/hn-cli/releases/download/v${VERSION}/hn_${VERSION}_x86_64.apk" sudo apk add --allow-untrusted "./hn_${VERSION}_x86_64.apk" Use aarch64 instead of x86_64 on ARM servers. Any Linux distribution, no root curl -fsSL https://raw.githubusercontent.com/kaushalvivek/hn-cli/main/install.sh | sh Detects x86_64 or aarch64 and installs to ~/.local/bin. Override with HN_INSTALL_DIR and pin a release with HN_VERSION: HN_VERSION=0.4.2 HN_INSTALL_DIR="$HOME/bin" sh install.sh All Linux release binaries are statically linked against musl and run across distributions. They need CA certificates for HTTPS; install ca-certificates on minimal systems. Homebrew is the simplest option: brew install kaushalvivek/tap/hn Homebrew 7 may ask you to trust a third-party tap on first use. If prompted, run brew trust kaushalvivek/tap. Or use the same install script as Linux: curl -fsSL https://raw.githubusercontent.com/kaushalvivek/hn-cli/main/install.sh | sh Direct download VERSION=0.4.2 ASSET=hn-linux-x86_64.tar.gz # or hn-macos-universal.tar.gz curl -LO "https://github.com/kaushalvivek/hn-cli/releases/download/v${VERSION}/${ASSET}" curl -LO "https://github.com/kaushalvivek/hn-cli/releases/download/v${VERSION}/checksums.txt" # Linux: sha256sum -c checksums.txt --ignore-missing # macOS: # grep " ${ASSET}$" checksums.txt | shasum -a 256 -c - tar -xzf "$ASSET" mkdir -p ~/.local/bin install -m 755 hn ~/.local/bin/hn cargo install --locked --git https://github.com/kaushalvivek/hn-cli Requires Rust 1.88+. From source git clone https://github.com/kaushalvivek/hn-cli.git cd hn-cli make install make install builds with Cargo and installs to /usr/local/bin by default. Use PREFIX=~/.local make install for a user-local install. Updating Linux packages: download and install the new package with the same command. Install script: re-run it. Homebrew: brew upgrade hn. Uninstalling sudo apt remove hn # Debian / Ubuntu sudo dnf remove hn # Fedora / RHEL sudo pacman -Rns hn # Arch sudo apk del hn # Alpine rm -f ~/.local/bin/hn # install-script installs brew uninstall hn # Homebrew rm -rf ~/.config/hn # optional: remove session and drafts Quick start hn # open the interactive browser hn browse --feed new # start on a specific feed hn front --limit 10 # line-oriented output hn thread 8863 # story + comment tree hn search "rust async" --sort date hn login # authenticated actions hn whoami Run hn --help or hn --help for the full surface. Every read command supports --json (or HN_JSON=1). The CLI is designed to be discovered without reading the source: hn capabilities # machine-readable command map, schemas, env vars hn front --limit 5 --json # structured feed hn item 8863 --json hn thread 8863 --json hn search "sqlite" --type story --limit 10 --json hn user pg --json hn front --limit 10 --json \ | jq -r '.entries[] | "\(.score)\t\(.title)\t\(.id)"' Errors are JSON on stderr with --json: {"ok": false, "error": {"code": "rate_limited", "message": "Hacker News rate-limited the request"}} Exit code is 0 on success and 1 on error. Read commands make no writes and need no account. Authenticated writes are never implicit. Agent guides: AGENTS.md and llms.txt. The interactive browser hn opens a full-screen terminal app with a feed sidebar, story list, detail pane, and threaded comments. Keyboard-first, with mouse scrolling Threaded comments with collapse/expand Search, command palette, help overlay, login modal, and toasts Inline composer with context, drafts, retry-safe errors, and immediate in-thread replies Vote, favorite, hide, flag, comment, edit, delete, and submit without leaving the terminal Feed loading from HN's HTML, with Firebase and Algolia adapters underneath Drafts are saved to ~/.config/hn/drafts.json on Esc, on Ctrl-C, and on failed posts. Reopening the same composer restores them. Scriptable CLI The line-oriented commands are designed for pipes, scripts, and quick one-off reads. Pagination is --limit N --page N on feed and activity commands. Authenticated actions hn login hn vote 8863 hn submit hn submit --title "..." --url https://example.com hn submit --title "..." --text "A text post" hn comment 8863 --text "..." hn comment 8863 # context + $EDITOR, saved as a draft on failure hn comment 8863 --use-draft # resume a saved draft hn edit 8863 --text "..." hn delete 8863 --yes hn favorite 8863 hn hide 8863 hn flag 8863 --reason spam hn unflag 8863 hn logout Submitting a story In the browser, press s to open a real submission form: Title is required (80 characters max). Link is optional. Fill it for a link post. A bare domain like example.com/post is normalized to https://example.com/post. Text is optional. Leave Link empty and write text for a text post. Tab / Shift-Tab move between fields, Ctrl-S submits, and Esc saves the whole form as a draft. Failed submissions are kept as drafts too. From the CLI, hn submit walks you through the same fields: it prompts for a title and link, and opens $VISUAL/$EDITOR when you leave the link empty. Non-interactive use is explicit: hn submit --title "..." --url https://example.com hn submit --title "..." --text "A text post" hn submit --use-draft # resume a saved submission When hn comment runs in a terminal without --text, it fetches the parent, prints the author and a quoted excerpt, opens $VISUAL/$EDITOR, and saves the text as a draft if posting fails. hn drafts lists drafts; hn drafts --clear removes them. Hacker News has no official write API. Authenticated actions use the site's HTML forms, session cookie, and per-page tokens. The session file is stored at ~/.config/hn/session.json with 0600 permissions; passwords are never persisted. Because these interfaces are unofficial, write actions can break if HN changes its markup. Configuration Architecture hn is a Rust crate with a pure domain model and narrow transport adapters: The domain model is documented in docs/DomainModel.md. Release instructions live in docs/RELEASING.md. Development cargo test cargo run -- --limit 5 cargo run -- browse cargo build --release The test suite covers the domain model, Firebase and Algolia decoding, HN HTML parsing, session handling, drafts, and CLI behaviour. Tests never use a real account: authenticated flows are exercised against a local fake HN server. Contributing Contributions are welcome. Start with CONTRIBUTING.md. For security issues, use SECURITY.md. Questions, ideas, or feedback: vivekkaushal.com/talk MIT © 2026 Vivek Kaushal hn is not affiliated with Y Combinator or Hacker News. Thanks to Hacker News for the site and APIs, Algolia for search, and the Rust open-source ecosystem.
AI NEWS JOURNAL
Hacker News Show HNAI NEWS / JOURNAL
Show HN: A Terminal UI for Hacker News, and CLI for Agents
hn-cli is a Hacker News client for the terminal. You can use it to browse feeds, stories and comment threads in an elegant full-screen terminal UI. hn-cli also supports search and signed-in actions like voting, favoriting, commenting and submitting. Share feedback! Comments URL: https://news.ycombinator.com/item?id=50432121 Points: 1 # Comments: 0
번역 서비스가 일시 중지되어 원문을 표시합니다.