Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: CLI for Hacker News (github.com/aperocky)
9 points by Aperocky on March 26, 2023 | hide | past | favorite | 5 comments
Hi HN! I've built hnterminal, a pip package that lets you browse, upvote, and comment on HN from terminal:

  $ pip install hnterminal
  $ hnterminal
hnterminal is an interactive REPL environment with commands like "get_front_page", "get_tree", "upvote", "reply_to", etc, each of which supports rich arguments and comes with full help documentation.

On the read side, hnterminal uses the HN API to construct front page and comment trees. On the write side, it reads the webpage and constructs an API response from parsed information. Unfortunately, a write API does not exist for HN (that I know of). Login is accomplished with a login cookie that is only stored in memory as it runs. You don't need to login to browse HN, its only for upvotes and commenting.



Check out the readme for full demo: https://github.com/Aperocky/hnterminal/blob/master/README.md

This comment is edited in vim and sent from hnterminal CLI.


If it showed full links those would be clickable with cmd+click on fp w iterm or such


you can use get_link [POINTER] to get the full HN link on any story/comment. For story links, they are listed whenever `get_story` or `get_tree` is called.


For example:

  hnterminal > gt 4
  POINTER -1: PARENT STORY
  Show HN: CLI for Hacker News
  2023-03-26 12:23:28
  AUTHOR: Aperocky
  FULL URL: https://github.com/Aperocky/hnterminal


replying from HN terminal as well. I love this. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: