A long time ago, I used a plain text file as my to-do list, I kept it on my university server, where I could connect to using ssh from pretty much anywhere with an internet connection, and I was satisfied with it. Slowly I started adding my standards to the text file: having @ in front of a word meant the task is related to some context (like @work, @personal, @medical, …), and having due:DATE meant the task has a due date.
Once I didn’t have access to the university server, I stopped using the to-do list. I migrated to multiple tools: Trello, Asana, and Todoist for personal use and Jira and Youtrack for work. While these are great, especially for collaborating on a task, I missed the ability to have a plain text from a terminal — as the terminal is where I spend most of my time.
Recently I encountered an open-source tool called todo.txt. I resolved an issue in the CLI but then realized todotxt has all the features I used in my plain text todo list and more… Much more. It provides the ability to use projects, context, priority, etc., on tasks; it allows you to search through tasks, etc.
I thought about the problem of accessing from multiple computers and managed to solve it by setting the plain text file on google drive that is synced among all computers I am using. This guide explains how to set it up.
Step 1 — Installation
To install the CLI on a mac, you can use homebrew
brew install todo-txt
Step 2 — Create a google drive folder
Change directory to your google drive folder and create the files: todo.txt, todo.txt.bak, report.txt, done.txt (replace the directory with your google drive directory):
cd "$HOME/Google Drive"
mkdir todo
cd todo
touch todo.txt todo.txt.bak report.txt done.txt
Step 3 — Copy the configuration file todo.cfg
You might need to replace the version number. At the time of writing this article, 2.12 was the latest version.
cp /opt/homebrew/opt/todo-txt/todo.cfg "$HOME/Google Drive/todo"
Step 4 — Update your .zshrc
If you are installing a command-line tasks manager, I assume you are using oh-my-zsh. If not, start using it. Alternatively, you can use the script initializing your shell (.bash_profile, etc.)
Add the following 2 lines to your .zshrc file:
source /opt/homebrew/etc/bash_completion.d/todo_completion complete -F _todo talias t="/opt/homebrew/bin/todo.sh-d $HOME/Google\ Drive/todo/todo.cfg"
Open a new terminal and test by running
t ls
You should get a list of your tasks, which is currently empty.
Step 5 — start using todo.txt
Adding a task is easy:
t add "my first task +project1 @work due:2020-12-01"
t add "my second task"
Viewing and filtering tasks is easy
t ls # View all tasks
t ls @work # View all tasks that have the @work context
t ls -@work # View all tasks that do not have the @work context
t lsa # View all tasks including done tasks
Marking a task as done
t do 1 # Mark task 1 as done