A simple todo CLI built with Go and Sqlite.
Why did you use Sqlite instead of just text files?
Honestly just because I wanted to. It also makes it a bit snappier to do the
filtering. You can use the --format flag to customize the output to
csv, json, or simple text file which you could store in version control.
- Add, edit, complete and remove todo items
- List active and completed todos
- Automatic timestamping of completed tasks
- Customizable database file locations via environment variables
- Cross-platform support (Linux, macOS, Windows)
Download the latest binary for your platform from the releases page.
# Download and install (replace with actual download URL)
wget https://github.com/ali-chapman/todo/releases/latest/download/todo-linux-amd64
chmod +x todo-linux-amd64
sudo mv todo-linux-amd64 /usr/local/bin/todoDownload todo-windows-amd64.exe and place it in your PATH.
git clone https://github.com/ali-chapman/todo.git
cd todo
go build -o todo .todotodo Buy groceries
todo Finish project documentationtodo Write tests for @project1All words that start with a '@' symbol will be stored as tags on the todo.
todo -d 0 # Remove todo at index 0
todo --done 1 # Remove todo at index 1todo -e 0 "Updated todo text"
todo --edit 1 "New description"todo -sd
todo --status donetodo -sa
todo --status alltodo -c
todo --createdtodo -C
todo --completedtodo -n
todo --hide-tagsBy default, the sqlite database file is stored in: ~/.config/.todo.db
You can customize this using an environment variable:
export TODO_PATH="/path/to/your/todo/database_file"You can add tags to a todo by appending @ to a word within the new todo, for example:
todo @project1 do something relating to project1 @urgentWhen listing the todo you will see [project1, urgent] as the tags on this todo.
You can filter using the -T flag:
todo -T urgentIf you set the environment variable TODO_TAG, then this will be added as a tag to all new todos, and when listing the todos will be filtered by this tag.
| Command | Flag | Description |
|---|---|---|
todo |
List all active todos | |
todo "item" |
Add a new todo item | |
todo "item @tag1 @tag2" |
Add a new todo item with tags | |
todo -d <index> |
--done |
Mark todo at index as complete |
todo -e <index> "text" |
--edit |
Edit todo at index |
todo -f <string> |
--format |
Output format (table, json, csv, txt), defaults to "table" |
todo -x <index> |
--remove |
Remove todo at index from database, THIS CANNOT BE UNDONE |
todo -sd |
--status done |
List completed todos |
todo -sa |
--status all |
List all todos |
todo -c |
--created |
Display relative creation time |
todo -C |
--completed |
Display relative completion time |
todo -n |
--hide-tags |
Do not display tags for each todo |
todo -T mytag |
--tag mytag |
Filter todos by tag. If not set then uses TODO_TAG environment variable |