DEV Community

Cover image for The Story of How I wrote A CLI for Your Bookmarks using Larder.io

The Story of How I wrote A CLI for Your Bookmarks using Larder.io

Josh Hawkins on October 28, 2018

The story starts when I began using Larder recently, and while I loved the mobile app and browser integrations, I really just wanted to use it from...
Collapse
 
chenge profile image
chenge

Can I add a bookmark?

I only see import. Am I wrong?

Collapse
 
hawkinjs profile image
Josh Hawkins

Yes, you can use lard bookmark <FOLDER> <TITLE> <LINK> [tags...] to add a link

Collapse
 
chenge profile image
chenge

How can I login?

lard login

When I created a client, it asked me this: Redirect URIs*

What's this?

Thread Thread
 
hawkinjs profile image
Josh Hawkins

Hmm, sounds like a bug! I'm not sure tho, I can't reproduce that on any of my machines...

What terminal emulator are you using? I know it needs to support interactive applications. Git bash gives me trouble, for instance.

I haven't encountered anything like "Redirect URIs" though, so I'm not sure what's happening there at all. Are you getting a stack trace?

Thread Thread
 
chenge profile image
chenge

$ lard login

Note: You can retrive your API token from larder.io/apps/clients/

I goto larder.io to fetch token, it told me no token and can create one.
Then I create and meet a form, it has a must filled item "Redirect URIs"

Do you get it?

Collapse
 
hawkinjs profile image
Josh Hawkins

OK, so there are a lot of links to commits in this article. Sorry! I would paste more code blocks into the article, but for the most part, the commits grow off eachother (like commits do...), so it doesn't always wind up with small enough chunks of code to show without having to put all the functions they depend on etc for it to make sense.

I put the tests and the initial version in code blocks in the article, and I may port a few more diffs into the article code blocks instead of just links to GitHub, but bear with me here...

Collapse
 
tux0r profile image
tux0r

What will this thing do better than Buku?

Collapse
 
hawkinjs profile image
Josh Hawkins

I hadn’t heard of Buku before, thanks! I’ll definitely check it out as I improve lard’s interface.

To answer your question, Lard works for Larder, which is what I needed. So it brings along Larder’s integrations with GitHub and Stack Overflow and the mobile app, website, and browser extensions. Also, the Larder team has been very open about how data is stored (what is plain text, what is encrypted, why, etc) and privacy in general, so I trust them to manage that.

Sure they solve similar problems, like many tools in the software world. But this one solves my problem, which is that I needed a command line interface for Larder.