From the lab

Prototyp CLI

A common Prototyp command line interface (CLI) to be used for both communication in Slack, time reporting in Harvest and time estimation in Planning Poker.

Tech used

  • CLI
  • Charm
  • Go

Background and problem

As developers we spend a lot of time in the terminal. In fact we love spending time in the terminal! So we thought we could introduce more of our everyday tasks to the command line.

Maybe it sounds a bit contradictory, but we felt as if switching between a lot of graphical user interfaces slowed us down. For instance, we write to our colleagues on Slack, report our worked hours in Harvest and estimate stories through planning poker. All of these things we thought could be made faster, better and smoother through a command line interface (CLI).

Idea and solution

A common Prototyp command line interface (CLI) to be used for both communication in Slack, time reporting in Harvest and time estimation in Planning Poker.

Implementation and results

We have had our eyes on the Charm collection of libraries for a while and this was the perfect case to try them out. The Charm libraries are written in the Go programming language and provide the tools you need to build an advanced terminal application with a nice user interface.

The main part is the Bubble Tea framework which, inspired by the Elm architecture, allowed us to create multiple modules. We could then combine the various features we wanted into a single application: the Prototyp CLI. Lastly, we used the Lip Gloss library to add some nice styling to the rendered strings and create an advanced layout in the terminal.

Slack module

The first module we created was the Slack module. Using the Slack API we created a small form to enable the users of the CLI to post messages to any Slack channel. The authentication is enabled through an OAuth flow to get a personal token that we can use with the Slack Go SDK to communicate with the Slack service.

Time Reporting Module

We used the Harvest API to get information on the projects that a developer is assigned to. We could then create an application where a developer can report worked hours on a project and what task they worked on within a few keystrokes.

Estimation / Pointing Poker Module

One of the first modules we discussed that could be both useful and a fun challenge to sink our teeth into was to develop a completely Peer-to-Peer command line version of the estimation tool Pointing Poker.

Having never delved too deep in Go nor P2P-networks, it proved to be a more difficult task than initially assumed. Synchronising the application state across a number of peers, handling updates and race conditions were all challenges that had to be overcome. In the end the final product somewhat resembles a simplified blockchain, a well known P2P implementation.

Users can connect over TCP to each other, join sessions and submit estimates about current tasks.

Insights and reflections

It was fun to be able to try our hand at Go and also to use Charm libraries. It was also a crucial part of the project to think of the user experience when creating a solution where the user interacts strictly through text.

It was also interesting to work with implementing P2P network protocols, and OAuth authentication in the terminal.