How to setup TaskWarrior and TimeWarrior for CLI tracking
Introduction
I recently setup TaskWarrior and TimeWarrior; I even briefly wrote about them in my daily code logs. I love the platform so much but I had found it a little difficult to flip through the docs just to get everything setup. In this post, I’ll show you all of the steps to getting it setup how I have it along with some additional notes. If you follow along, you will have TaskWarrior and TimeWarrior installed on your computer and can start keeping track of what you have to do and (more importantly) what you already did!
Caution - I only have a mac - I don’t know if any of this applies to non-mac computers.
If you regularly use the command line, this is for you. In order to complete this tutorial, you’ll need a little bit of patience, admin privileges, and a text editor. I assume that you already have homebrew
installed. If not, you can easily get homebrew.
Installation
Let’s install. I’ll let you know at the outset that the documentation does cover this, but my experience was that there were too many options in the documentation and also that it was different on the site than on github. This is what worked for me.
TaskWarrior installation
It is super simple. Fire up your terminal:
Yep, that’s it. You are good. You may get a message that says you do not yet have a .taskrc
- go ahead and agree to let one be made for you.
TimeWarrior installation
TimeWarrior is a little bit more of a bear, but not much. If you do not have cmake, you will need to install it.
skip this one if you already have cmake
Once you have cmake, you are ready to go here. The first line downloads the tarball. Then, you have to go and cmake it.
You can verify everything is working by typing timew help
- you should get a very long response. Your home folder may now include the following: /.task
, .taskrc
, and /.timewarrior
Configuration
I configured both for me, and if you start with this setup, you will be able to move to something that meets your needs.
TaskWarrior configuration
All of the configuration is in the .taskrc
file that may have been set up for you during installation. If so, open it for editing. If not create a new one. I use atom - it will automatically generate a file if it doesn’t exist, but you can use any text editor.
In your home directory:
In the editor, you may see nothing or:
This basic configuration just points to where your task data storage is. I changed mine to the following:
Essentially, I have set it up so that the default output is the ready report and it is structured with the columns that I have identified. Note that ‘default.command’ means what taskwarrior should do when you just type task
at the command line.
TimeWarrior configuration
The configuration can get pretty fancy, but I think the most essential is to setup your likely/probable/exact working hours. This helps because it makes it clear when you are out, but it also stops tasks that you leave running, say overnight. Configuration for time warrior goes into /.timewarrior/timewarrior.cfg
. If you do not have that file, just add it.
Here is my setup that just says that I am out of the office before 0500 and after 1900 every day:
Now, when I run, say timew week
, this greys out my out of office hours:
A fun add on for your zsh profile.
Ok. The whole way that I was introduced to TaskWarrior was through a post on dev.to all about everyone sharing Terminal views. I saw a prompt that was unicode character and someone said that it changed based on their task status. Intrigued, I dug in. I added the task status to my prompt based on Paul Fenwick’s tweet referred to me in another tweet from Dave Jacoby after a discussion on dev.to.
I simply put this at then end of my .zshrc (I’m using oh-my-zsh with the philips theme). This adds unicode emoji to my prompt for a high level overview of where I’m at!
Go try it out
You can start using these right away. Keep in mind that TimeWarrior reports will not be too exciting until you use it for awhile.
- Create a new task in the project test and then start working on it
- Create a new task in the project test with a tag of analysis (you don’t have to use tags, but you can)
- Look at your tasks. If you followed my
.taskrc
setup, this will give you both task 1 and task 2 in a task ready table.
- Stop working on task 1 and finish it (if you just say
done
,stop
is implied. But you may start and stop a task many times before finishing it.)
- See your daily and weekly time spent
- (edit next day) Fix the time attributed to something if you accidentally leave it running
You are now good to go. Once you feel comfortable, or if you want to do something else, dive into the TaskWarrior docs.