DEV Community

loading...
Cover image for Bookmark - command-line tool to quickly access obnoxious URLs

Bookmark - command-line tool to quickly access obnoxious URLs

Szymon Gibała
・3 min read

Introduction

Bookmark is a simple command-line application written in Rust that allows saving, grouping, and tagging your URLs as well as accessing them quickly from the comforts of your terminal.

What does it do?

Bookmark - Demo

The main objective of Bookmark is to make it easier to find the URL you are looking for and open it quickly without clicking through dozens of folders with bookmarks or scrolling endlessly through the bookmarks bar.

It aims to minimize time and cognitive effort spend on switching to the browser and looking for the URL.

With the Bookmark you can:

  • Save URLs you are using often or just temporarily for some period of time when, for example working on some task.
  • Assign bookmarks into groups.
  • Tag them to make it easier to find.
  • Open URLs directly in the browser without touching your mouse.

How does it work?

The tool can work in two modes:

  • Standard command-line tool - you type commands and see the outputs in the terminal.

    Bookmark Standard mode - Demo

  • Interactive mode - the terminal user interface from which you can search, open, or modify your bookmarks.

    Bookmark Interactive mode - Demo

Bookmark is most useful when working in the Interactive mode, as you can access it very quickly - just by typing bookmark in your terminal - and from there you can search for a bookmark you are looking for and simply press enter to open it in the browser saving yourself several clicks or these annoying moments trying to remember the exact URL.

Why have I written Bookmark?

I have often found myself opening a lot of the same URLs during my workday. This means switching from whatever IDE or terminal I was working with to the browser and then either clicking through my bookmarks folder or wrestling with Chrome search bar to suggest me the one URL I am currently looking for and never actually remember it (the fact that the word github is in 90% of those, probably is not very helpful for Chrome).

With Bookmark I can tag the URL with something like GitHub issue number or a specific topic and by typing it in the search bar have all the URLs at my disposal.

Adding the tag or group you came up with by yourself makes it easier to remember it as you have some connection with it as opposed to just some URL that your colleges send you and you probably did not even read it.

Bookmark may not be the most useful for websites like Twitter, Reddit, or Dev that are short and distinct. We use them all the time and our fingers already developed muscle memory for accessing them.

However, I believe it is a good tool for things like the URL for that another repository which differs just by a single word from the other fifteen internal repositories of your company as well as those ridiculously long domain names containing more dots than this entire post.

And yes, let's be honest the final obvious reason is that we developers love our terminals. ❤️

What did I use?

Bookmark is written in Rust, as this is the language I am currently learning (and really like!).

I have found it quite helpful in command-line based application, as it is not easy to test those end-to-end automatically, so the strict rules enforced by the compiler were invaluable. In the vast majority of cases when the code compiled, everything just worked, which saved me a lot of time and sanity looking for bugs or fixing regressions.

Of course, nothing is a silver bullet. I probably spend more time writing the code than I would in something like Go and a few bugs slipped in here and there anyways. Overall I am happy with my choice.

Some cool libraries used in the project are:

  • Clap - great library for writing command-line application.
  • tui-rs - library for creating awesome terminal user interfaces.

Summing up

You can find the project on GitHub.

It might not be the greatest tool on the planet it also is not particularly advanced but it still can smoothen the work just a little bit for some of us and spare ourselves some mental energy. If you are interested check it out and let me know if it is in any way useful for you!

If you have some suggestions or feedback let me know! Also, feel free to create an issue or shoot a pull request!

Discussion (1)

Collapse
banzyme2 profile image
EN_DEE_SA

I could see myself using this, great work!

Forem Open with the Forem app