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.

5 functions 5 read 0 write No credentials auth

Hacker News CLI Setup

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

# 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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

No credentials are required.

Call Hacker News Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call hackernews.hackernews_get_item '{
  "id": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:hackernews hackernews_get_item '{
  "id": 1
}' --json

Agent Discovery Commands

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

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Hacker News.

hackernews.hackernews_get_item

Read read

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.

Parameters
id

Generic CLI call

kosmo integrations:call hackernews.hackernews_get_item '{"id":1}' --json

Provider shortcut

kosmo integrations:hackernews hackernews_get_item '{"id":1}' --json

hackernews.hackernews_get_user

Read read

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.

Parameters
id

Generic CLI call

kosmo integrations:call hackernews.hackernews_get_user '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:hackernews hackernews_get_user '{"id":"example_id"}' --json

hackernews.hackernews_list_top_stories

Read read

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).

Parameters
limit

Generic CLI call

kosmo integrations:call hackernews.hackernews_list_top_stories '{"limit":1}' --json

Provider shortcut

kosmo integrations:hackernews hackernews_list_top_stories '{"limit":1}' --json

hackernews.hackernews_list_new_stories

Read read

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.

Parameters
limit

Generic CLI call

kosmo integrations:call hackernews.hackernews_list_new_stories '{"limit":1}' --json

Provider shortcut

kosmo integrations:hackernews hackernews_list_new_stories '{"limit":1}' --json

hackernews.hackernews_list_best_stories

Read read

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.

Parameters
limit

Generic CLI call

kosmo integrations:call hackernews.hackernews_list_best_stories '{"limit":1}' --json

Provider shortcut

kosmo integrations:hackernews hackernews_list_best_stories '{"limit":1}' --json

Function Schemas

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

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.

Operation
Read read
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

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.

Operation
Read read
Schema command
kosmo integrations:schema hackernews.hackernews_get_user --json
ParameterTypeRequiredDescription
id string yes The Hacker News username (e.g., "pg", "dang").

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).

Operation
Read read
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

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.

Operation
Read read
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

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.

Operation
Read read
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).

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.