DEV Community

Cover image for A very simple command line tool as a side-project to learn go.
Florian Rand
Florian Rand

Posted on

A very simple command line tool as a side-project to learn go.

The story

I've been using Larder as my bookmark manager about a year and maybe and a half, more or less. Before Larder, I was -and still- using Buku (a powerful bookmark manager written in Python3 and sqlite3 -from Buku github page). Being used to Buku, one thing I was missing from larder was a cli to do searches directly from the command line, and since I love command line tools, what better excuse to start one in go?

Starting small

Every time I learn something new I like to find small projects, because keeping the idea small helps me to focus on specific tasks. Another reason to start small is because it's easier to finish the project in a reasonable amount of time and it feels great once it's finished, which is also great motivation to continue.

The cli

This is how larder-cli was born a month ago, with Buku in mind and as inspiration. The current state of the cli is not nearly close to being called a complete tool, but that wasn't its purpose. It's been a lot of fun working in this little piece of software and I'm planning to add more features. One thing I want to learn now is a proper way to manage command line args.

Another cool thing, I got an A+ in goreportcard!

goreportcard
(that screen is from my self-hosted app, because for some reason the main app is giving me an error).

I can't embed gitlab repos here so I'll leave the link: https://gitlab.com/flrnprz/larder-cli in case you want to check it out.

Thanks for reading and happy coding!

Top comments (7)

Collapse
 
alexfielder profile image
Alex Fielder

TIL about both Buku and Larder, but I have a question: How do they differ from tools like Evernote/OneNote - and assuming you've used either, which (out of all of them) would you say is the best?

I've been using

GitHub logo hound-search / hound

Lightning fast code searching made easy

Hound

Build Status Join the chat at https://gitter.im/etsy/Hound

Hound is an extremely fast source code search engine. The core is based on this article (and code) from Russ Cox Regular Expression Matching with a Trigram Index. Hound itself is a static React frontend that talks to a Go backend. The backend keeps an up-to-date index for each repository and answers searches through a minimal API. Here it is in action:

Hound Screen Capture

Quick Start Guide

Using Go Tools

  1. Use the Go tools to install Hound. The binaries houndd (server) and hound (cli) will be installed in your $GOPATH.
go get github.com/etsy/hound/cmds/
  1. Create a config.json in a directory with your list of repositories.

  2. Run the Hound server with houndd and you should see output similar to:

2015/03/13 09:07:42 Searcher started for statsd
2015/03/13 09:07:42 Searcher started for Hound
2015/03/13 09:07:42 All indexes built
2015/03/13 09:07:42 running server at http://localhost:6080...

Using Docker (1.4+)

  1. Create a config.json in a directory with…





search tool to collate repos that I find (and deem useful for development) for a while - online however, I've used both Evernote and OneNote and neither have really been that useful to me.

Recently I've also started using the "Email this page" Chrome extension in the hope that I can use Google's searching within gmail to help me refer back to useful articles.

Collapse
 
flrnd profile image
Florian Rand

Hey Alex, I'm not sure if we can compare any of the tools you mention. But hey, if it works for you nice!

Collapse
 
thefern profile image
Fernando B πŸš€

Thanks for sharing your experience with cli and making something you will personally use. For some reason the repo is showing as empty for me.

Collapse
 
flrnd profile image
Florian Rand

Hey, Fernando thank you for your kind words. I've checked and you are right, it seems you need to login in gitlab to see the repo content, sorry for the inconvenience.

Collapse
 
thefern profile image
Fernando B πŸš€

As I was registering gitlab features listed "show repos without login". Nevertheless I registered and same outcome. I can see source code for your other two repos.

Thread Thread
 
flrnd profile image
Florian Rand

Weird, it should be public.

Thread Thread
 
thefern profile image
Fernando B πŸš€

I can see it now, strange indeed.