편집자 노트

heartleo/hn-cli#hacker-news

Blazing fast, Hacker News CLI (TUI)⚡

이것은 DeepSeek Harness(DSH) 플러그인입니다. 이 사이트는 GitHub README, 설치 정보, 유지보수 상태, 공개 보안 시그널을 모아 보여줍니다.

업스트림에서 중국어 README를 제공하지 않아 저장소 원본 내용을 표시합니다.

hn

A terminal client for Hacker News.

Go version CI Release Downloads License

demo

Features

  • 📰 Story browser — Top, New, Best, Ask HN, Show HN with tab switching
  • 💬 Comment threads — navigate with j/k, fold/unfold, lazy-load reply trees
  • 🌐 Translation — translate a title with t, all visible titles with T, or a selected comment
  • 🔄 Soft refresh — refresh stories or comments without restarting
  • 🎨 Themes — hn, mocha, dracula, tokyo, nord, gruvbox
  • Progressive loading — visible range loads first, more fetched as you scroll

Install

Homebrew (macOS / Linux):

$ brew install heartleo/tap/hn

winget (Windows):

$ winget install heartleo.hn

curl (macOS / Linux):

$ curl -fsSL https://raw.githubusercontent.com/heartleo/hn-cli/main/install.sh | sh

No sudo needed — the binary is installed under your home directory. The install directory is picked from the first of these that is set:

SourceValue
HN_INSTALL_DIRused as-is
XDG_BIN_HOMEused as-is
XDG_DATA_HOME$XDG_DATA_HOME/../bin
(default)$HOME/.local/bin

To install somewhere else:

$ curl -fsSL https://raw.githubusercontent.com/heartleo/hn-cli/main/install.sh | HN_INSTALL_DIR=~/bin sh

The script warns if the install directory is not on your $PATH, and prints the export PATH=... line to add to your shell profile.

The script never calls sudo. To install system-wide, run it as root yourself:

$ curl -fsSL https://raw.githubusercontent.com/heartleo/hn-cli/main/install.sh -o install.sh
$ sudo env HN_INSTALL_DIR=/usr/local/bin sh install.sh

Prebuilt binaries — download from GitHub Releases

Go install (requires Go 1.25+):

$ go install github.com/heartleo/hn-cli/cmd/hn@latest

Build from source:

$ git clone https://github.com/heartleo/hn-cli
$ cd hn
$ go build -o hn ./cmd/hn

Claude Code Plugin

This repo also ships hn, a Claude Code plugin that brings Hacker News to Claude.

/plugin marketplace add heartleo/hn-cli
/plugin install hn@hn-cli
SkillWhat it does
hn-digestScan the front page — today's themes, hot discussions, industry mix

Then just ask: what's on HN today. Ask in any language and the digest comes back in that language. See the plugin README for details.

The digest is also published daily at hndigest.heartleo.dev.

DeepSeek Harness Plugin

For DeepSeek Harness there is hacker-news, a plain-ESM plugin that reads the public Hacker News APIs directly. It needs neither an HN API key nor a local terminal client.

Install from npm

The published package is dsh-hacker-news. It is also listed in the awesome-dsh-plugin community registry. DSH profiles are pnpm workspace roots, so keep the -w flag:

dsh plugin --profile <name> add -w dsh-hacker-news

If your npm mirror has not indexed the latest release, run the installation against the public registry:

$env:npm_config_registry = 'https://registry.npmjs.org/'
dsh plugin --profile <name> add -w dsh-hacker-news

Start or restart the same profile, then verify that the composed configuration includes dsh-hacker-news:

dsh --profile <name>
dsh --profile <name> --dump-config

Install from source

This form follows the repository's main branch and is intended for development or trying unreleased changes:

dsh plugin --profile <name> add -w github:heartleo/hn-cli#path:/plugins/hacker-news

After installation, ask naturally, for example: what's popular on HN?, search HN for sqlite, or read HN item 49322107 and summarize the discussion.

ToolWhat it does
hn_storiesRanked feeds — top / new / best / ask / show / job
hn_itemAn item plus its reply tree in reading order
hn_searchAlgolia search, by relevance or date
hn_userKarma, account age, bio, submission count

See the plugin README for configuration.

Quick Start

$ hn        # top stories
$ hn new    # new stories
$ hn best   # best stories

Commands

Browse

browse demo

Opens the interactive TUI. Defaults to Top stories; switch tabs with ←/→.

$ hn        # top stories (default)
$ hn top
$ hn new
$ hn best
$ hn ask
$ hn show

Comments

comments demo

Press Enter on any story to open its comment thread.

  • navigate with ↑/↓ or k/j
  • press Enter to expand or collapse a reply tree
  • press Space to fold or unfold the selected comment
  • press C / E to fold or unfold all
  • press r to jump to the root comment
  • press R to soft refresh
  • press Esc to go back

Translation

Translates via any OpenAI-compatible chat completions API. See Configuration to set up an API key.

t   translate selected story title (toggle cached translation)
T   translate all visible titles in one batch request
t   translate selected comment (in comment view)

theme

$ hn theme          # show current
$ hn theme nord     # set globally

Available: hn · mocha · dracula · tokyo · nord · gruvbox

Keys

Story List

KeyAction
EnterOpen comment thread
oOpen in browser
tTranslate selected title
TTranslate all visible titles
/ Switch tab
rRefresh
?Toggle help
q / Ctrl+CQuit

Comment Thread

KeyAction
j / Next comment
k / Previous comment
ggBack to top
rJump to root comment
EnterExpand / collapse replies
SpaceFold / unfold selected comment
C / EFold / unfold all
tTranslate selected comment
RSoft refresh
oOpen story in browser
EscBack to list
?Toggle help
Q / Ctrl+CQuit

Configuration

hn reads ~/.config/hn/config.json. A .env file in the working directory is also loaded automatically; environment variables take precedence over the config file.

Translation

VariableDefaultDescription
HN_TRANSLATE_API_URLhttps://api.openai.com/v1API base URL
HN_TRANSLATE_API_KEYAPI key
HN_TRANSLATE_MODELgpt-4o-miniModel name
HN_TRANSLATE_LANGChineseTarget language

Example .env:

HN_TRANSLATE_API_KEY=sk-...
HN_TRANSLATE_LANG=Chinese

Theme

VariableDescription
HN_THEMEOverride theme without editing config

Example ~/.config/hn/config.json:

{
  "theme": "mocha",
  "translate": {
    "api_url": "https://api.openai.com/v1",
    "api_key": "sk-...",
    "model": "gpt-4o-mini",
    "language": "Chinese"
  }
}

Contributing

Issues, bug reports, feature suggestions, and general feedback are very welcome:

注意

This project is maintained in my spare time, and I currently do not have enough capacity to properly review external pull requests. See CONTRIBUTING.md for details. Thank you for your understanding!

REPOSITORY SIGNALS

보안 및 설치 증거

이 점수는 공개 저장소 메타데이터와 이 사이트에 등록된 설치 증거에만 기반하며, 코드 보안 감사와 다릅니다.

출처 추적 가능

공개 플러그인 카탈로그에서 왔으며, 공개 GitHub 저장소로 연결됩니다.

라이선스

저장소가 MIT 라이선스를 선언했습니다.

유지보수 활동

최근 180일 내 코드 업데이트가 있습니다.

설치 증거

재현 가능한 정확한 설치 메타데이터가 아직 등록되지 않았습니다. 저장소 설명에 따라 직접 확인하세요.

설치 라이프사이클 스크립트

검사한 패키지 메타데이터에 설치 라이프사이클 스크립트가 선언되지 않았습니다.