Recently I came across terminal shop, which lets you run a CLI tool via SSH. As someone who love the terminal, this just blew my mind. So I wanted to find out how it was built, out of curiosity. It's when I cam across bubbletea. Took me less than an hour to go through the docs and understand how to do some simple things. Then I was like, I want to build something with it. As I was thinking of things I could build with it, I got the idea of providing this very blog over SSH in a terminal. So I decided to try it out, by getting the RSS feed and displaying it on the terminal. The UI looks so good with the defaults from bubbletea. Looked at a few examples, and quite quickly got it to a stage where it fetches the latest blogs and shows them in a table, which you can scroll through. The next step is to render a page when someone presses [Enter].
I've been having quite a lot of fun with it. Today I got it show a spinner as it loads the feed, and made it show up in the middle of a full screen.
Next steps:
- Get the full post from the RSS feed. Not sure, how to view the document in the terminal as it is in Html. I've had a look at the Ghost (where the blog is hosted) API, there are a few options, I'll look through it tomorrow if the RSS feed won't work.
- Setup a server and serve the CLI over SSH.
- Load more posts in the table, as the user scrolls down. Maybe add pages
You can find the code here