KosmoKrator

data

Hacker News CLI for AI Agents

Use the Hacker News CLI from KosmoKrator to call Hacker News tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

Hacker News CLI Setup

Hacker News can be configured headlessly with `kosmokrator integrations:configure hackernews`.

Install, configure, and verify
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure hackernews --enable --read allow --write ask --json
kosmokrator integrations:doctor hackernews --json
kosmokrator integrations:status --json

Credentials

Authentication type: No credentials none. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

No credentials are required.

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call hackernews.hackernews_get_item '{"id":1}' --json
Provider shortcut
kosmo integrations:hackernews hackernews_get_item '{"id":1}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs hackernews --json
kosmo integrations:docs hackernews.hackernews_get_item --json
kosmo integrations:schema hackernews.hackernews_get_item --json
kosmo integrations:search "Hacker News" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

hackernews.hackernews_get_item

Fetch a Hacker News item (story, comment, job, poll, or poll option) by its numeric ID. Returns all available fields: title, URL, text, author (by), score, time, descendants, and kids (child comment IDs). Use this to look up any HN item when you know its ID.

Read read
Parameters
id
Generic call
kosmo integrations:call hackernews.hackernews_get_item '{"id":1}' --json
Shortcut
kosmo integrations:hackernews hackernews_get_item '{"id":1}' --json

hackernews.hackernews_get_user

Fetch a Hacker News user profile by username. Returns karma score, about text, account creation date, and lists of submitted item IDs (submissions) and comment IDs.

Read read
Parameters
id
Generic call
kosmo integrations:call hackernews.hackernews_get_user '{"id":"example_id"}' --json
Shortcut
kosmo integrations:hackernews hackernews_get_user '{"id":"example_id"}' --json

hackernews.hackernews_get_max_item

Fetch the current largest Hacker News item ID. Useful for walking backward through all public HN items.

Read read
Parameters
none
Generic call
kosmo integrations:call hackernews.hackernews_get_max_item '{}' --json
Shortcut
kosmo integrations:hackernews hackernews_get_max_item '{}' --json

hackernews.hackernews_get_updates

Fetch recently changed Hacker News item IDs and user profile IDs from the official updates endpoint.

Read read
Parameters
none
Generic call
kosmo integrations:call hackernews.hackernews_get_updates '{}' --json
Shortcut
kosmo integrations:hackernews hackernews_get_updates '{}' --json

hackernews.hackernews_list_top_stories

Fetch the current top stories from Hacker News. Returns up to N stories with full item data (title, URL, score, author, comment count). The "top" list is ranked by the HN algorithm (a combination of score, recency, and flags).

Read read
Parameters
limit
Generic call
kosmo integrations:call hackernews.hackernews_list_top_stories '{"limit":1}' --json
Shortcut
kosmo integrations:hackernews hackernews_list_top_stories '{"limit":1}' --json

hackernews.hackernews_list_new_stories

Fetch the newest stories from Hacker News. Returns up to N stories with full item data (title, URL, score, author, comment count). These are the most recently submitted stories, not yet ranked by the HN algorithm.

Read read
Parameters
limit
Generic call
kosmo integrations:call hackernews.hackernews_list_new_stories '{"limit":1}' --json
Shortcut
kosmo integrations:hackernews hackernews_list_new_stories '{"limit":1}' --json

hackernews.hackernews_list_best_stories

Fetch the highest-scoring (best) stories from Hacker News. Returns up to N stories with full item data (title, URL, score, author, comment count). These are the stories with the highest scores, regardless of age.

Read read
Parameters
limit
Generic call
kosmo integrations:call hackernews.hackernews_list_best_stories '{"limit":1}' --json
Shortcut
kosmo integrations:hackernews hackernews_list_best_stories '{"limit":1}' --json

hackernews.hackernews_list_ask_stories

Fetch the latest Ask HN stories. Returns up to N Ask HN items with title, text, author, score, time, and comment count.

Read read
Parameters
limit
Generic call
kosmo integrations:call hackernews.hackernews_list_ask_stories '{"limit":1}' --json
Shortcut
kosmo integrations:hackernews hackernews_list_ask_stories '{"limit":1}' --json

hackernews.hackernews_list_show_stories

Fetch the latest Show HN stories. Returns up to N Show HN items with title, URL, author, score, time, and comment count.

Read read
Parameters
limit
Generic call
kosmo integrations:call hackernews.hackernews_list_show_stories '{"limit":1}' --json
Shortcut
kosmo integrations:hackernews hackernews_list_show_stories '{"limit":1}' --json

hackernews.hackernews_list_job_stories

Fetch the latest Hacker News job stories. Returns up to N job items with title, URL/text, author, score, and time.

Read read
Parameters
limit
Generic call
kosmo integrations:call hackernews.hackernews_list_job_stories '{"limit":1}' --json
Shortcut
kosmo integrations:hackernews hackernews_list_job_stories '{"limit":1}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

hackernews.hackernews_get_item 1 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_get_item --json
ParameterTypeRequiredDescription
id integer yes The Hacker News item ID (e.g., 12345).
hackernews.hackernews_get_user 1 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_get_user --json
ParameterTypeRequiredDescription
id string yes The Hacker News username (e.g., "pg", "dang").
hackernews.hackernews_get_max_item 0 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_get_max_item --json
ParameterTypeRequiredDescription
No parameters.
hackernews.hackernews_get_updates 0 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_get_updates --json
ParameterTypeRequiredDescription
No parameters.
hackernews.hackernews_list_top_stories 1 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_list_top_stories --json
ParameterTypeRequiredDescription
limit integer no Maximum number of stories to return (default: 30, max: 100).
hackernews.hackernews_list_new_stories 1 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_list_new_stories --json
ParameterTypeRequiredDescription
limit integer no Maximum number of stories to return (default: 30, max: 100).
hackernews.hackernews_list_best_stories 1 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_list_best_stories --json
ParameterTypeRequiredDescription
limit integer no Maximum number of stories to return (default: 30, max: 100).
hackernews.hackernews_list_ask_stories 1 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_list_ask_stories --json
ParameterTypeRequiredDescription
limit integer no Maximum number of Ask HN stories to return (default: 30, max: 100).
hackernews.hackernews_list_show_stories 1 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_list_show_stories --json
ParameterTypeRequiredDescription
limit integer no Maximum number of Show HN stories to return (default: 30, max: 100).
hackernews.hackernews_list_job_stories 1 parameters
Schema command
kosmo integrations:schema hackernews.hackernews_list_job_stories --json
ParameterTypeRequiredDescription
limit integer no Maximum number of job stories to return (default: 30, max: 100).

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.