A simple, efficient command-line to-do list manager built with Go. Manage your tasks directly from the terminal with an intuitive interface. This project was based on the following YouTube tutorial: "How to Build A CLI Todo App in Go" by Coding with Patrik. Link: https://www.youtube.com/watch?v=g16Zf0KQEWI It is intended for learning purposes.
- β Add tasks - Quickly add new to-do items with priority levels
- ποΈ Delete tasks - Remove completed or unwanted tasks
- βοΈ Edit tasks - Update task titles anytime
- βοΈ Toggle completion - Mark tasks as done/undone with timestamps
- π― Priority levels - Categorize tasks as Low, Medium, or High priority
- π·οΈ Tags/Categories - Organize tasks with custom tags
- π Due dates - Set deadlines for your tasks with reminders
- π Search functionality - Find tasks by title
- π·οΈ Filter by tags - View tasks by category
- π Statistics - See task completion progress and priority breakdown
- π Sorting - Sort tasks by priority or creation date
- πΎ Persistent storage - All tasks saved to JSON file
- π Beautiful CLI table - View all tasks in a colored, formatted table
- π¨ Color-coded output - Priorities and completion status shown with colors
- Go 1.18 or higher installed on your machine
- Clone the repository:
git clone https://github.com/ybrodsky-rh/ToDoListApp.git
cd ToDoListApp- Install dependencies:
go mod download- Build the application:
go build./ToDoListApp -add "Buy groceries"
./ToDoListApp -add "Finish project report"./ToDoListApp -add "Learn Go" -priority "High" -tags "learning,golang" -due "2026-01-20"
./ToDoListApp -add "Buy groceries" -priority "Low" -tags "shopping,home"
./ToDoListApp -add "Project deadline" -priority "High" -tags "work" -due "2026-01-25"./ToDoListApp -listShows all tasks in a colored table with priorities, due dates, and task statistics.
./ToDoListApp -search "Go"Finds all tasks containing the search term (case-insensitive).
./ToDoListApp -tag "work"
./ToDoListApp -tag "home"./ToDoListApp -statsDisplays: Total tasks, Completed, Pending, and High Priority count.
./ToDoListApp -sort "priority" # Sort by priority (High β Medium β Low)
./ToDoListApp -sort "date" # Sort by creation date (oldest first)./ToDoListApp -toggle 0./ToDoListApp -del 0./ToDoListApp -edit "0:Updated task title"ToDoListApp/
βββ main.go # Entry point of the application
βββ todo.go # Todo struct and operations (add, delete, toggle, etc.)
βββ command.go # Command-line flag parsing
βββ storage.go # JSON file I/O operations
βββ go.mod # Go module definition
βββ go.sum # Dependency checksums
βββ todos.json # Persistent storage file (auto-generated)
βββ README.md # This file
- Load - Reads existing todos from
todos.json - Parse - Parses command-line flags (
-add,-del,-toggle,-edit,-list,-search,-tag,-sort,-stats, etc.) - Execute - Performs the requested operation
- Save - Persists changes back to
todos.json
| Flag | Description | Example |
|---|---|---|
-add |
Add a new task | -add "Buy milk" |
-priority |
Set priority level | -priority "High" (Low, Medium, High) |
-tags |
Add tags (comma-separated) | -tags "work,urgent,learning" |
-due |
Set due date | -due "2026-01-20" (YYYY-MM-DD) |
-list |
List all tasks | -list |
-search |
Search by title | -search "golang" |
-tag |
Filter by tag | -tag "work" |
-sort |
Sort tasks | -sort "priority" or -sort "date" |
-stats |
Show statistics | -stats |
-toggle |
Mark as complete/incomplete | -toggle 0 |
-edit |
Edit task title | -edit "0:New title" |
-del |
Delete a task | -del 0 |
- Pointers (
*) - Modify original data in methods - Methods - Functions attached to types using receivers
- Generics (
[T any]) - Flexible Storage type for any data - Error Handling - Proper error returns and validation
- JSON marshaling - Serialize/deserialize data
- Slices - Dynamic arrays for managing todos
- Type constants - Custom Priority type and color constants
- Sorting - Using
sort.Slice()for custom sorting logic - String manipulation - Parsing dates, tags, and search queries
github.com/aquasecurity/table- Beautiful CLI table formatting
go test ./...go mod tidy# Add some tasks with different priorities
./ToDoListApp -add "Learn Go basics" -priority "High" -tags "learning,golang" -due "2026-01-20"
./ToDoListApp -add "Build a CLI project" -priority "High" -tags "work,golang"
./ToDoListApp -add "Buy groceries" -priority "Low" -tags "shopping,home"
./ToDoListApp -add "Code review" -priority "Medium" -tags "work"
# View all tasks with colors and statistics
./ToDoListApp -list
# Search for specific tasks
./ToDoListApp -search "Go"
# Filter tasks by tag
./ToDoListApp -tag "work"
./ToDoListApp -tag "shopping"
# Sort tasks by priority
./ToDoListApp -sort "priority"
# View quick statistics
./ToDoListApp -stats
# Mark first task as done
./ToDoListApp -toggle 0
# Edit a task
./ToDoListApp -edit "1:Completed my first project"
# Delete a task
./ToDoListApp -del 2
# View updated list
./ToDoListApp -listWhen you run -list, you'll see:
βββββ¬ββββββββββββββββββββββββββ¬βββββββββββ¬ββββββββββββ¬βββββββββββββ¬βββββββββββββ
β # β Title β Priority β Completed β Created At β Due Date β
βββββΌββββββββββββββββββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββββ€
β 0 β Learn Go basics β High β β
β 2026-01-11 β 2026-01-20 β
β 1 β Build a CLI project β High β β β 2026-01-11 β β
β 2 β Buy groceries β Low β β β 2026-01-11 β β
β 3 β Code review β Medium β β β 2026-01-11 β β
βββββ΄ββββββββββββββββββββββββββ΄βββββββββββ΄ββββββββββββ΄βββββββββββββ΄βββββββββββββ
π Task Statistics:
Total: 4 | Completed: 1 | Pending: 3 | High Priority: 2
β° Due Today:
Nothing due today! π
This project is great for learning:
- Go fundamentals (structs, methods, receivers)
- Command-line argument parsing with the
flagpackage - File I/O and JSON handling (marshaling/unmarshaling)
- Generic types (Go 1.18+)
- Error handling patterns
- Custom type definitions and constants
- Sorting and searching algorithms
- Working with time/date handling
- Building practical CLI applications
This project is open source and available under the MIT License.
Feel free to fork this repository and submit pull requests for any improvements!
For questions or suggestions, please open an issue on GitHub.
Happy task managing! π