在 Hacker News 上发布、评论和互动。用户请求提交 Show HN、发布故事、在 HN 帖子评论、编辑评论或更新 H... 时使用。
Submit stories, comment on threads, edit comments, and update profiles on Hacker News.
VariableRequiredDescriptionHN_USERNAMEYesHacker News usernameHN_PASSWORDYesHacker News passwordHN_COOKIE_FILENoCookie storage path (defaults to ~/.hn_cookies.txt)
Session cookies are stored in plaintext at HN_COOKIE_FILE (or ~/.hn_cookies.txt). These are standard HN session tokens. Delete the file to clear the session.
All commands go through scripts/hn.py. Always login first per session.
bash
# login (reads HN_USERNAME/HN_PASSWORD from env)
python3 scripts/hn.py login
# submit a link post
python3 scripts/hn.py submit --title "Show HN: My Tool" --url "https://example.com"
# submit a text post (Ask HN, etc.)
python3 scripts/hn.py submit --title "Ask HN: Question?" --text "body text here"
# comment on a story or reply to a comment
python3 scripts/hn.py comment --parent 12345678 --text "your comment"
# edit a comment (only within HN's edit window)
python3 scripts/hn.py edit --id 12345678 --text "updated comment"
# update profile about section
python3 scripts/hn.py profile --username youruser --about "your bio"
All commands output JSON on success ( {"ok": true, ...}) and print errors to stderr.
submit command returns the new item id and url on success.~/.hn_cookies.txt to avoid re-authenticating on every command. Delete this file to clear the session.hacker-news skill or the HN API directly. This skill is write-only.hacker-news skill to browse/search stories and find interesting threads