A command-line todo application written in Go that helps you manage tasks with simplicity and efficiency.
- Add new tasks
- List all tasks with their status
- Mark tasks as complete
- Delete tasks
- Automatic cleanup of completed tasks from the previous day
- Go 1.16 or higher
- SQLite3
-
Clone the repository
git clone https://github.com/yourusername/todo-cli.git cd todo-cli -
Build the application
go build -o todo
-
Move the binary to your PATH (optional)
sudo mv todo /usr/local/bin/
todo add -t "Complete the project documentation"todo listThis will display a formatted table with columns for ID, task description, status, and creation date.
todo complete -i 1Where 1 is the ID of the task you want to mark as complete.
todo delete -i 1Where 1 is the ID of the task you want to delete.
The application uses SQLite3 as its database engine. The database file (todo.db) is stored in your home directory.
When you start the application, it automatically removes all completed tasks from the previous day, helping you keep your task list clean and focused on current items.
| Command | Flag | Description |
|---|---|---|
| add | -t, --task | Add a new task |
| list | List all tasks | |
| list | -F, --top | Show top five tasks (not fully implemented) |
| list | -B, --bottom | Show last five tasks (not fully implemented) |
| complete | -i, --id | Mark a task as complete |
| delete | -i, --id | Delete a task |
main.go- Entry point of the applicationcmd/- Contains command definitions using Cobraroot.go- Root command setuptodo.go- Command implementations
helpers/- Helper functionssql_helpers.go- Database operations
- Cobra - Command-line interface framework
- go-sqlite3 - SQLite driver for Go
- Implement filtering for list command (top/bottom functionality)
- Add due dates for tasks
- Add priority levels
- Implement task categories/tags cli-todo-go