Creating a CLI to Improve My Focus

I am trying to improve my focus and rediscovered the Pomodoro Technique. But because I struggle to form new habits, I decided to make it more interesting by building my own productivity tool.

A picture of a book, with an open chapter on productivity
Photo by kris / Unsplash

I am someone who is always thinking about something. More often than not, I am thinking about things that I would like to see in the world. I have written about a few of these, for example better tools for developers and a video game to practice programming. But there are more ideas. Way more.

Feeling overwhelmed by the constant buzzing of ideas in my head, I started looking for techniques to bring some order to the chaos. I read Getting Things Done (twice), and starting using OmniFocus to collect my projects in a single place. I used Bullet Journals for a year or two, tried to develop a meditation habit (and failed to do so), and read any article about productivity hacks that I came across.

One of the things that I read years ago, and then re-discovered recently, is the Pomodoro Technique. It divides work into timeboxed intervals, each of which focuses on a single task. I don't remember the first time that I tried the technique, and why it didn't stick. But when I tried it again a few weeks ago, it felt like the missing piece of the puzzle. Over the years, I had gotten better at collecting, organizing, and planning tasks. But I didn't feel like my execution had improved at a similar rate. I wasn't getting things done.

Adopting Pomodoro for the Digital Age

What I find attractive about the Pomodoro Technique is its simplicity. Theoretically, all you need is a kitchen timer. I found a simple app that I liked, put in the task that I wanted to work on, and listened to a soothing ticking sound for 25 minutes. By writing down the task, I knew exactly what I wanted to achieve in this time. And knowing that the time was limited both motivated me to focus, and helped me "reschedule" any distracting thoughts for later.

This has worked well for me many times, but equally as often it didn't. Either I forgot to set a timer, forgot to take a break, or changed what I was working on during the session. Making the Pomodoro Technique a habit has been difficult.

But I know myself. I like measuring things and then improving them. Show me a chart, and I'll make the line go in the right direction. So, to be more consistent with Pomodoro, I need to track my sessions and visualize them. Given the amount of apps that exist for the Pomodoro Technique or time tracking in general, this seems like an easy enough objective.

There's one problem, though. I don't want to change my process to fit a certain tool. I want a tool that fits my process.

Creating My Perfect Productivity Tool

The idea to create my own productivity tool has been floating around my head for a while. I think every developer has, at one point or another, the idea to create their perfect tool. Be it a code editor, a note-taking app, or any other piece of software that they touch every day. I don't know why be believe this, but we think that we can create better tools for ourselves. With more features and less issues.

So maybe it is hybris, but I do want to try create a tool that implements my own process. That works well for me. That interfaces with the other software that I use. The first step on that journey is building a simple command-line tool that supports the Pomodoro Technique.

Focusing on Progress

This is a good opportunity for myself to train my focus and productivity. Instead of getting lost in complex features and grand visions, I can practice to work on this tool in small slices. Only pick features that are relevant to me now, and that I can get done in a short amount of time. In a few 25 minute intervals, for example.

I am essentially dogfooding my own productivity tool.

This process is very much inspired by a great conference talk I saw at RailsConf 2019 called The Selfish Programmer by Justin Searls. In the talk, Justin argues that we can take more liberties when writing software for ourselves. We can focus on things that we find interesting or want to learn. And ignore practices that exist to enable efficient collaboration with others. I found the talk very inspiring, and this seems like a great project to try out some of its ideas.

Introducing WORK-E

I've decided to call my tool WORK-E, short for Work Organizer and Record Keeper: Earth-Class. The goal is to develop it into the perfect companion for myself, with all the weird requirements and idiosyncrasis that I find important. But, it will be developed in a very agile way, feature by feature without a long-term roadmap.

The first feature that is important to me is its support for the Pomodoro Technique. The feature set for the first iteration is rather small:

  • Write down the task
  • Start a timer
  • Play a ticking sound during the session
  • Ring an alarm when the session ends
  • Store the session in a database for future analysis

For a second, I contemplated building this tool with Go and the awesome libraries that charm.sh provide. But then I remembered the talk by Justin, and decided to lean into Rust. It's my favorite programming language, and this project is a great opportunity to practice it as well. ❤️

The command-line interface is simple. It requires the user to pass in the name for the session, and allows them to optionally overwrite the session's duration:

work-e track --name "Write a blog post"

When run, it blocks for the length of the duration and plays a ticking sound in the background. When the session ends, it is saved to a local SQLite database.

This is everything that I need to start using WORK-E to track my own work. And let me tell you, it's been a huge success! I don't know what it is in my brain that finds data so interesting, but knowing that each session is recorded somewhere has been super motivating. I am not doing anything with the data yet, but just knowing that it is there is enough.

There are a few small improvements to the CLI that I already identified. For example, it does not ring an alarm at the end of a session, which has caused me to miss the end of a session at least twice today. It also doesn't tell me how much time is still left in a session.

I will work on WORK-E and improve it as I go. It's liberating to think of it as a small project that I am doing purely for myself. And that allows me to be selfish...