npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@brianlovin/hn-cli

v0.4.18

Published

Interactive terminal UI for browsing Hacker News

Readme

HN CLI

A terminal UI for browsing Hacker News, modeled after the HN reader on my personal website.

Installation

# Run directly (no install needed)
bunx @brianlovin/hn-cli

# or with npx
npx @brianlovin/hn-cli

# Or install globally
bun install -g @brianlovin/hn-cli
hn

# Or with npm
npm install -g @brianlovin/hn-cli
hn

From source

git clone https://github.com/brianlovin/hn-cli.git
cd hn-cli
bun install
bun run start

Usage

Navigation

| Key | Action | | --------- | ---------------------------- | | j / k | Navigate between stories | | space | Jump to next root comment | | o | Open story URL in browser | | r | Refresh stories | | c | Chat with AI about the story | | t | AI-generated tl;dr | | s | Open settings |

Mouse Support

  • Click on stories in the sidebar to select them
  • Click story title/URL to open in browser

AI Features

TL;DR Summaries

Press t on any story to generate an AI-powered summary. The AI reads the article and all comments, then provides:

  • A concise summary of the article
  • Key takeaways from the discussion

Summaries are cached locally, so you can revisit them without regenerating.

Chat

Press c to start a conversation with an AI about the story. The AI has full context of the article and all comments, so you can ask follow-up questions, get clarification, or dive deeper into specific topics.

Bring Your Own API Key

The chat feature requires an API key from either Anthropic or OpenAI. On first use, you'll be prompted to choose a provider and enter your key.

Option 1: Environment variables

# For Anthropic
export ANTHROPIC_API_KEY=sk-ant-...

# For OpenAI
export OPENAI_API_KEY=sk-...

Option 2: In-app setup

Press s to open settings and you'll be guided through the setup. Your key is stored locally at ~/.config/hn-cli/config.json.

Settings

Press s at any time to open the settings panel.

AI Provider

  • Switch between Anthropic and OpenAI
  • Change the model (Claude Opus/Sonnet/Haiku, GPT-5 Nano/GPT-5 Mini/GPT-5.2)
  • Add or clear API keys

Story Filtering

These settings control which stories appear in your feed:

| Setting | Default | Description | | ------------ | ------- | --------------------------------------- | | Max Stories | 24 | Maximum number of stories to display | | Time Window | 24h | Only show stories from the last N hours | | Min Points | 50 | Minimum points required | | Min Comments | 20 | Minimum comments required |

Comment Display

| Setting | Default | Description | | -------------- | ------- | ------------------------------------------- | | Root Comments | 12 | Maximum root-level comments shown per story | | Child Comments | 8 | Maximum replies shown per comment | | Nesting Depth | 3 | Maximum levels of nested replies |

Settings are stored locally at ~/.config/hn-cli/config.json.

Design decisions

The default settings match my HN reader on my personal website. I made these choices so that it's easier for me to keep up with the most interesting stories throughout the day without getting sucked too deep into long comment threads or the flood of new submissions.


Development

Running locally

bun install          # Install dependencies
bun run start        # Run the app
bun run dev          # Run with hot reload
bun run dev:update   # Run with simulated update notification

Testing the update notification

To test the update notification UI without publishing a new version:

bun run dev:update

You can also customize the simulated versions:

HN_SIMULATE_VERSION=0.2.0 HN_SIMULATE_LATEST=0.5.0 bun run start

Testing

bun run test         # Run tests
bun run typecheck    # Check types

Debug modes

bun run debug                      # Test long comment wrapping
bun run debug story-list           # Test story list view
bun run debug highlighted-comment  # Test comment highlighting

Architecture

  • src/index.ts - Entry point
  • src/app.ts - Main app class with UI and keyboard handling
  • src/api.ts - API client for fetching from HNPWA API
  • src/config.ts - Configuration and API key management
  • src/settings.ts - Configurable filter settings with validation
  • src/types.ts - TypeScript types for HN data structures
  • src/test/ - Test suite

Telemetry

This CLI collects anonymous usage data to help understand how people use it and what features to improve. No personal information or content is ever collected.

What's collected

  • App launches (with version number)
  • Feature usage counts (TLDR, chat, refresh)
  • Navigation patterns (stories selected, comments viewed)
  • Keyboard shortcut usage

What's NOT collected

  • Story content, titles, or URLs
  • Chat messages or AI responses
  • API keys or credentials
  • IP addresses or location data

Disabling telemetry

Option 1: Settings menu

Press s to open settings, then toggle "Telemetry" off.

Option 2: Launch flag

hn --disable-telemetry

This permanently disables telemetry. Your preference is stored locally at ~/.config/hn-cli/config.json.

Credits

Built with OpenTUI