Show HN: Circumflex, browse HN in your terminal (github.com)
`clx` is written in Go using Bubble Tea[1]. You can read the comment section or the linked article in reader mode in the pager `less`.
Using `lesskey` to add custom keybindings, the replies can be collapsed and expanded in real-time (but not individual replies, only all replies at once). Behind the scenes I am appending invisible unicode characters to each line so that I can use the custom keybindings to filter them out. The same technique is used to allow for jumping between top-level comments.
I spent a lot of time thinking about syntax highlighting and finding relevant bits to highlight while also not going overboard with colors. The end result is highlighting of things I find useful for providing context in the comment section, like indicating parent poster and original poster, coloring references, coloring indentations as well as formatting YC startups.
Other quality of life features include adding submissions as favorites (it is stored as a pretty-printed json so you can check it into your vcs to allow for readable diffs). Submissions are marked as read and new comments are indicated with a bullet point.
63 comments
[ 2.6 ms ] story [ 139 ms ] threadI'm very happy with glider on mobile but still looking for something in the terminal.
https://github.com/Livinglist/Hacki
For the record: less v581.2 is the one being shipped by macOS 12.6 Monterey, I simply updated with "brew install less"
less 608 was releaseed september 2nd 2022...
this happens so often... i find a new cool cli tool, only for it to have a dependency on a newer version of something. so i can't use it until next OS upgrade, and by then, i've forgotten about it cause i never got to test it out.
i guess devs just don't use OS packages and compile every single tool they use?
i used to do that, when i used slackware in the '90s.
Any plans for adding login and posting support?
But I guess that would mean moving away from less for the comments.
[1]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3c...
https://imgur.com/a/DlrEbvI
I'm really glad to report our eyes are safe :)
And damn you so awesome!
On linux you can still install with homebrew[1], but if you prefer you can install from source as well. Follow the installation instruction for installing Go, maybe your distro has a preferred way. Then you can clone the repo and either 1. install the binary with `go install` (make sure $GOPATH/bin in in your path variable) or 2. run with `go run main.go`.
On a side note, I am looking for help to add `clx` to linux package managers.
[1] https://docs.brew.sh/Homebrew-on-Linux
If you don't mind a bit of a shameless plug, I've also recently built a terminal client for HN [1], although with a slightly different objective - to make it look less like a website, and more like a traditional mail/news reader (i.e. mutt/slrn)
It's not going to have any advanced features because I mostly wrote it for my own use, but maybe someone finds it useful.
[1] https://luke8086.neocities.org/retronews.html
https://github.com/epilys/nntpserver.py
From the top of my head this is my personal list of minimum requirements such an app would have to support:
1. Text search within all of comments in a thread.
2. Easy command collapse/expand workflow when viewing threads.
Glancing through the doc it seems that this app doesn't (yet) support either of these requirements, is this correct?
2. You can collapse / expand the comment section with h/l or left arrow and right arrow. The limitation to this is that it is not possible to collapse specific threads / replies, only all replies at once.
Sure, but doesn't this assume running `less` in this case only to search specific text strings? So this means if you wanted to apply any other operations, you'd have to exit out of the $PAGER back into the main terminal app?
What if I wanted to combine it with other operations such as collapse / expand comments? Speaking of:
> 2. You can collapse / expand the comment section with h/l or left arrow and right arrow. The limitation to this is that it is not possible to collapse specific threads / replies, only all replies at once.
So an collapse / expand operation is applied to _all_ comments in a thread? Hmm, in that case for me in terms of usability the browser is still superior.
https://imgur.com/a/4PrpwTc
I installed using brew on linux mint. The "correct" version of less seems to be in the path
Any interest in adding logged-in-user effects?