DEV Community

Cover image for TheBrag CLI: Save your brags from terminal
Khushboo Parasrampuria
Khushboo Parasrampuria

Posted on • Edited on

TheBrag CLI: Save your brags from terminal

What I built

If you're anything like me, you believe in getting things done as quickly as possible, but when the time comes for a performance review or job interview, you're stuck with a bad memory and a blank page, frantically combing through JIRA tickets, emails, and closed PRs from multiple projects.

Now, you don't have to think about what you did in the last six months or a year with TheBrag

Brag now, remember later.

TheBrag is a CLI-based application that lets you save your brags (things you want to show off) directly from your terminal.

TheBrag has the following features:

  • You can add, view, update, or delete brags directly from the CLI.
  • Create custom categories to sort out your accomplishments like work tasks, personal tasks, blogs, etc.
  • Use the "export to file" functionality to recieve a copy of your accomplishments via email.
  • You can export all your data or by selected categories within a date range.

Category Submission:

  • Wacky Wildcard
  • Integration Innovators
  • SaaS Superstars

App Link

Download the CLI application from this link.

Installation Steps:

  1. Download the application from the link above.
  2. Run chmod a+x thebrag from the directory where the file was downloaded. This will make the file executable for all groups on your system.
  3. From the same directory you can run ./thebrag on your terminal to start using it. OR
  4. If you want to access thebrag command from anywhere in your system, you need to add the application path to your $PATH environment variable.
    • Navigate to your home directory by typing cd in the terminal.
    • Type nano .profile or nano .zshrc.
    • Inside this file, add the following line: export PATH=$PATH:/foo/bar (Replace /foo/bar with the location of the downloaded file)

.zshrc screenshot showing how to add file path

  • Save and quit.
  • Exit Terminal.app (or whichever term program you're using) and restart it.

You should now be able to run thebrag from anywhere.

Screenshots

  • thebrag command: Gives the basic information about the app along with a list of commands that can be used.

thebrag command

  • thebrag login command

thebrag login command

  • Add a new category: thebrag category -c "<category_name>"

Add category command

  • List all existing categories: thebrag category

List categories command

  • Add a brag: thebrag add -c "<category_name>" -t "<brag title>" -d "<brag details>"

Add a brag command

  • List brags: thebrag get -n <no. of brags>

thebrag get -n <no. of brags> -s <skip_from_start>

List brags command

  • Get a specific brag: thebrag get -i <brag_id>

Get brag by id command

  • Update a brag: thebrag update -i <brag_id> -d "new details content" -t "new title content" -c "new category name"

Update a brag command

  • Delete a brag: thebrag delete -i <brag_id>

Delete a brag command

  • Export brags: thebrag export -d "<from_date>,<to_date>" -c "<category_name>"

Export brags commands

  • Received Email:

Brags Email

  • Exported Brags CSV:

Exported Brags file

Description

A high level view of the system:

TheBrag - System design diagram

  1. The user interacts with the application via the CLI to manage their brags.
  2. The request is sent to the thebrag APIs, hosted on Linode servers, for processing .
  3. The API interacts with the MySQL database to get/update the data.
  4. The Export Module will let you export brags into a CSV file.
  5. After generating the file, it is uploaded an Object Storage bucket on Linode and sent to the registered email id using SendGrid Emails.

Link to Source Code

  1. APIs: thebrag-api
  2. CLI: thebrag-cli

Permissive License

MIT License

Background

From trying to come up with things to write about in the year end review for appraisals and giving talking points to help my manager for award nomination at work, made me think that I should start logging the things I've worked on in one place.

Inspired by this post by Julia Evans and practically spending all day in the terminal, I decided to just a write CLI application which will let me log my work directly from the terminal.

The skeleton is me 😵‍💫.
How to exit vim?

How I built it

Language, Framework and Libraries:

TheBrag-CLI uses the Golang's Cobra library which provides a simple interface to create powerful CLI applications.

TheBrag-API is built using Golang's Gin framework for easy implementation of REST-APIs and Gorm for MySQL integration.

This is my first GoLang Application 🤩

Infrastructure:

  • APIs are deployed on Linux virtual machines called Compute Instances provided by Linode. For demo purpose this is setup on a shared CPU nanode 1GB.
  • MySQL is also provisioned on Linode using their high performing managed database clusters. Also on shared CPU nanode 1GB.
  • Exported brag files are uploaded in a private bucket on Object Storage offering by Linode to save the exported data files on cloud.
  • SendGrid is used to send the email containing the exported data file.
  • Thebrag CLI app is hosted in a bucket on Object Storage by Linode with public read access to allow anyone to download the app and start using it.

Future Scope/Roadmap

This is not the end for this project, I'm going to continue adding features to this.

  • Filter brags by category, date range etc.
  • Setup Github Actions for deployment.
  • Convert your brags into a resume.
  • Performance optimisation: Move export functionality to a worker.
  • Dashboard for people who prefer a GUI.

PS: Feel free to share suggestions or feature requests.

Additional Resources/Info

[1] Opening a port on linux or this one linux-how-to-open-a-port
[2] Copy files from local to remote server
[3] All go tutorials use localhost for API to listen to, remember to change the IP for production deployment. After 2 days of confusion I found this: port-seems-to-be-open-but-connection-refused
[4] SendGrid for emails

Top comments (1)

Collapse
 
rupali59 profile image
Rupali Bhatnagar

Congratulations! This is a great project!!