voska/hn-cli · Archived

hn

>- Hacker News CLI for searching stories, reading posts with comments, browsing the front page, and looking up users. Use when you need HN context: tech discussions, Show HN projects, Ask HN threads, startup launches, developer opinions, or trending topics. Free API, no auth required.

Installation

$ npx skills add voska/hn-cli --skill hn

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 6
License LICENSE
Default branch master
Open issues 1
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,482 B
  • docs SUMMARY.md 292 B

History

  1. First recorded snapshot · 3 installs

SKILL.md

hn -- Hacker News CLI

CLI for searching and reading Hacker News via the Algolia API. Returns compact plaintext by default (token-efficient). No authentication required.

Quick Reference

hn search "query"                    # Search stories (default)
hn search "query" --comments         # Search comments instead
hn search "query" --sort date        # Sort by date (default: relevance)
hn search "query" -n 10              # Limit results
hn search "query" --after 2026-01-01 # Only results after date
hn search "query" --min-points 100   # Minimum points filter

hn front                             # Current front page stories
hn front -n 10                       # Fewer results

hn read ID                           # Read story + top comments
hn read ID --expand                  # All comments expanded

hn user USERNAME                     # User profile and karma

hn status                            # API health check
hn version                           # Version info

Aliases: hn s = hn search, hn f = hn front, hn r = hn read, hn u = hn user.

Workflow

  1. Search or browse front page: hn search "topic" -n 5 or hn front
  2. Note the item ID from the HN URL in results
  3. Read the full story + comments: hn read ID
  4. Expand all comments if needed: hn read ID --expand

Output Format

Compact plaintext by default (token-efficient). Use --json only when writing to files -- never use --json in LLM context.

Search output

1532 results:
1. [523pts 89c] Show HN: I built a tool for X  @username  2h ago
   https://example.com/article
   HN: https://news.ycombinator.com/item?id=12345

Read output

Full story title, metadata, URL, body text, and threaded comments with author and timestamps. Top 3 levels by default, --expand for all.

User output

@pg  karma:157316
Bug fixer.
https://news.ycombinator.com/user?id=pg

Exit Codes

  • 0 success
  • 1 general error
  • 3 empty result (no matches)
  • 5 not found (invalid ID or username)
  • 8 retryable error (network/timeout)

Installation

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