hackernews-cli

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: Apache-2.0

README

hn

A command line for Hacker News.

hn is a single pure-Go binary. It speaks to hackernews over plain HTTPS, shapes the responses into clean records, and pipes into the rest of your tools. No API key, nothing to run alongside it.

Install

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

Or grab a prebuilt binary from the releases, or run the container image:

docker run --rm ghcr.io/tamnd/hn:latest --help

Usage

hn --help
hn version

This is a fresh scaffold. The command tree starts with version; build out the real commands in cli/ on top of the hackernews library package.

Development

cmd/hn/   thin main, wires cli.Root into fang
cli/                 the cobra command tree
hackernews/                the library: HTTP client and data models
docs/                tago documentation site
make build      # ./bin/hn
make test       # go test ./...
make vet        # go vet ./...

Releasing

Push a version tag and GitHub Actions runs GoReleaser, which builds the archives, Linux packages, the multi-arch GHCR image, checksums, SBOMs, and a cosign signature:

git tag v0.1.0
git push --tags

The Homebrew and Scoop steps self-disable until their tokens exist, so the first release works with no extra secrets.

License

Apache-2.0. See LICENSE.

Directories

Path Synopsis
Package cli builds the hn command tree on top of the hackernews library.
Package cli builds the hn command tree on top of the hackernews library.
cmd
hn command
Command hn is a single-binary command line for hackernews.
Command hn is a single-binary command line for hackernews.
Package hackernews is the library behind the hn command: the HTTP client, request shaping, and the typed data models for Hacker News.
Package hackernews is the library behind the hn command: the HTTP client, request shaping, and the typed data models for Hacker News.
pkg
render
Package render turns slices of record structs into one of the output formats hackernews-cli supports: table, json, jsonl, csv, tsv, url, and raw.
Package render turns slices of record structs into one of the output formats hackernews-cli supports: table, json, jsonl, csv, tsv, url, and raw.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL