top of page
Writer's pictureganesh moorthy

Take control with TaskWarrior - Part 1

Updated: Aug 5, 2022


I have been looking for an easy-to-use command like TODO/task manager that works on Linux for some time now. Upon performing a curative Google search, I came across TaskWarrior, a free and open source(FOSS) software that, upon first look, seemed to fit the bit quite well. I decided to give it a shot on my Intel NUC system with Ubuntu 18.04 LTS Operating System.


Why don't you enjoy an original LoFi music track composed by "TheGaneshMoorthy" while you read the rest of the blog?




Getting Started


According to their website, Taskwarrior is Free and Open Source Software that manages your TODO list from the command line. It is flexible, fast, and unobtrusive. It does its job then gets out of your way.


Installation on Ubuntu


Installing on Ubuntu is just a couple of commands.


$ sudo apt update && sudo apt install taskwarrior

For other distribution, please refer to their Download section.


Ensure successful installation by looking at the version of the software



$ task --version
2.5.1

Please note that executing the command for the first time will prompt you to create the config file. Select "Yes".


Baby Steps


You can refer to the Quick Start documentation on their website to get started. However, the most often used basic commands are


Listing tasks


The command to list tasks is effortless and intuitive. It will show you the list of tasks you have created or empty if you are invoking it for the first time.



$ 
task list
ID Age Description                         Urg 
 1 3w  publish short story to website      0.14
 2 3w  create new tech blog on website     0.14
 3 3w  pay subscription to medium          0.14
 4 3w  write new articile for medium       0.14

Adding task


The "task add" command lets you add tasks to the list. The basic usage is

task add <task description>



$ task add testing 123
Created task 5.
$ task list
ID Age Description                         Urg 
 1 3w  publish short story to website      0.14
 2 3w  create new tech blog on website     0.14
 3 3w  pay subscription to medium          0.14
 4 3w  write new articile for medium       0.14
 5 4s  testing 123                            0

Modifying task


Post adding a task, you may wish to change its description, due date, priority, tags, or project information. The command syntax is "task <id> modify <options>'. For example, the following command is used to change the description of an existing task from a single line to a multi-line format.



$ task 5 modify "This is a testing task 1234"
Modifying task 5 'This is a testing task 1234'.
Modified 1 task.

Marking the task done


As you complete the tasks in the TODO list, you need to mark them completed so that the list is active and real. The syntax is "task <id> done"



$ task 5 done
Completed task 5 'This is a testing task 1234'.
Completed 1 task.

Removing or deleting a task


If you have mistakenly added a task to the list or is no longer valid, you can remove the task with the following syntax "task <id> delete". It will ask you for confirmation before deletion.




$ task 3 delete
Delete task 3 'pay subscription to medium'? (yes/no) yes
Deleting task 3 'pay subscription to medium'.
Deleted 1 task.

Advanced Operations


Now that you have a basic understanding of how TaskWarrior can be used for your everyday task management, let's take a look at some advanced usage.


Task Prioritization


The task can be set to High, Medium, or Low priorities as per the default configuration. If you need different highlights based on priority, you will need to use one of the pre-defined color themes available in the configuration. By default, it is set to None. Priorities can be set either during the creation of a task or modification of the existing task.


The syntax for setting priority at the time of adding a new task is "task add <description> priority:[H|M|L]".



$ task add "Testing with priority" priority:M
Created task 4.

$ taskwarriror_scripts$ task list

ID Age P Description                         Urg 
 2 3w  H create new tech blog on website     6.14
 4 4s  M Testing with priority                3.9
 1 3w    publish short story to website      0.14
 3 3w    write new articile for medium       0.14

*Note: The P column list the priority, and in the last column, 'Urg', defines the urgency. You only need the priority for your purpose. The list items are sorted by priority by default.


The syntax for setting or updating priority for existing task is "task <id> modify priority:[H|M|L]"



$ task 2 modify priority:L
Modifying task 2 'create new tech blog on website'.
Modified 1 task.

$ taskwarriror_scripts$ task list

ID Age  P Description                         Urg 
 4 4min M Testing with priority                3.9
 2 3w   L create new tech blog on website     1.94
 1 3w     publish short story to website      0.14
 3 3w     write new articile for medium       0.14

Task Grouping (projects)


Tasks can be grouped into projects. For example, I can create a project called home and assign all house-related activities to this project. This is useful in a couple of ways. First, you can easily filter and list a subset of tasks grouped into these projects. Secondly, you can track progress at the project level.


Similar to priority, you can set or update the project variable of a task either on addition or modification. The syntax is "task [add | modify] {id} (description) project:<project name>"



$ task add "Adding a task with a project assignment" project:test
Created task 5.
The project 'test' has changed.  Project 'test' is 0% complete (1 task remaining).


$ task 1 modify project:website
Modifying task 1 'publish short story to website'.
Modified 1 task.
The project 'website' has changed.  Project 'website' is 0% complete (1 task remaining).


Task tagging


Tags can be used effectively for filtering. They are just a set of alphanumeric words (one to many). These can be used instead of projects however you will not get the completion %.

The syntax is the same as projects, except that you need to replace the project variable with tags.



$ task 1 add tags:blog
Created task 6.

The above task has been created with no description and an assigned tag, as seen below.


$ task list

ID Age   P Project Tags Description                                 Urg 
 4 33min M              Testing with priority                        3.9
 2 3w    L              create new tech blog on website             1.94
 6 4s              blog 1                                            0.8
 3 3w                   write new articile for medium               0.14
 5 5min    test         Adding a task with a project assignment        1
 1 3w      website      publish short story to website              1.14

6 tasks

We will now modify the same task to add the description and one more tag.



$ task 6 modify "This is the new description" tags:website
Modifying task 6 'This is the new description'.
Modified 1 task.


$ task list

ID Age   P Project Tags    Description                                 Urg 
 4 38min M                 Testing with priority                        3.9
 2 3w    L                 create new tech blog on website             1.94
 6 5min            website This is the new description                  0.8
 3 3w                      write new articile for medium               0.14
 5 10min   test            Adding a task with a project assignment        1
 1 3w      website website This is the new description                 1.94

6 tasks

Setting Due Date


Setting a due date for each task is important for closure. It can be a handy feature for filtering and sorting tasks based on the due date. The due date can be either set as an actual date or through human readable language like (today|tomorrow|EOW). The syntax is "task [add|modify]{id} due:<options>. You can read the available options on their site.



$ task add "new task with due date set to tomorrow" due:tomorrow
Created task 7.

$ task list

ID Age   P Project Tags    Due        Description                                 Urg 
 7 3s                      2022-08-02 new task with due date set to tomorrow      8.71
 4 46min M                            Testing with priority                        3.9
 2 3w    L                            create new tech blog on website             1.94
 6 13min           website            This is the new description                  0.8
 3 3w                                 write new articile for medium               0.14
 5 18min   test                       Adding a task with a project assignment        1
 1 3w      website website            This is the new description                 1.94

7 tasks

You will see a new column called 'Due' now that one of the tasks has a due date assigned.



Filtering Tasks


When you have a laundry list of tasks created or modified over time, the task list will show all of them. It makes it very difficult to manage and update tasks as they grow over time. TaskWarrior provides advanced filtering capabilities out of the box. You can filter using projects, tags, priority, due dates, or a combination of them using a concept called filter chaining. You can read about filters in detail here.


Few examples for your understanding of this power in your hands


Show all the tasks I added in the last one hour.


$ task entry.after:now-1hour list

ID Age   P Project Tags    Due        Description                                 Urg 
 7 13min                   2022-08-02 new task with due date set to tomorrow      8.71
 4 59min M                            Testing with priority                        3.9
 6 26min           website            This is the new description                  0.8
 5 31min   test                       Adding a task with a project assignment        1

4 tasks

Show all tasks belonging to the project test and due tomorrow.



$ task project:test due:tomorrow list

ID Age   P Project Due        Description                                Urg 
 7 16min H test    2022-08-02 new task with due date set to tomorrow     15.7

1 task

Conclusion


I believe you should have a good understanding of TaskWarrior by now. The ease of just using the command line makes it significantly more straightforward as you don't need to open up an application or website. There are extensions and add-ons if you still want to do them and will be covered in the next post. Don't forget to read their documentation and start using it daily to take control of your life!


Live Life Byte Size









51 views0 comments

Comments


bottom of page