mirror of
https://github.com/AmanTahiliani/todo.git
synced 2026-08-07 11:54:14 -04:00
40d1fa64b89630ebfd5aa38b73da38f5b91c0290
Added Short representations and Help Flag
Go Todo CLI App
A simple command-line Todo application written in Go. Todos are stored in a SQLite database.
Features
- Add new todos with a title and description
- List all todos, grouped by incomplete and completed
- Mark todos as completed
- Remove todos by ID
- Data is persisted in SQLite database
- User-friendly command-line interface with action commands
Dependencies
- Go 1.x
- github.com/mattn/go-sqlite3
Usage
Build the app:
go build -o todo
Command Structure
The app uses a command-based interface where the action comes first, followed by flags:
./todo [action] [flags]
Available actions:
add- Add a new todo itemremove- Remove a todo itemcomplete- Mark a todo item as completedlist- List all todo items
Flags
-t, --title- Title for the todo (required for add)-d, --description- Description for the todo (required for add)-i, --id- ID of the todo (required for remove and complete)-h, --help- Display help information
Examples
Add a new todo:
./todo add -t "Buy milk" -d "Get 2 liters of milk"
List all todos:
./todo list
Complete a todo:
./todo complete -i 1
Remove a todo:
./todo remove -i 2
Display help:
./todo -h
Next Improvements
- Use a CLI library like cobra for better UX
- Add edit and search features
- Add unit tests
- Improve error handling
- Add binary release for different platforms and make it available through Homebrew, Winget and Apt
- Add due dates and priority levels for todos
- Implement categories/tags for better organization
- Add data export/import functionality
Description
Languages
Go
96.3%
Makefile
3.7%