Files
todo/README.md

85 lines
1.7 KiB
Markdown
Raw Normal View History

2025-05-21 00:35:51 -04:00
# Go Todo CLI App
2025-05-22 23:15:24 -04:00
A simple command-line Todo application written in Go. Todos are stored in a SQLite database.
2025-05-21 00:35:51 -04:00
## 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
2025-05-22 23:15:24 -04:00
- Data is persisted in SQLite database
- User-friendly command-line interface with action commands
2025-05-22 23:15:24 -04:00
## Dependencies
- Go 1.x
- github.com/mattn/go-sqlite3
2025-05-21 00:35:51 -04:00
## Usage
Build the app:
```sh
go build -o todo
```
### Command Structure
The app uses a command-based interface where the action comes first, followed by flags:
2025-05-21 00:35:51 -04:00
```sh
./todo [action] [flags]
2025-05-21 00:35:51 -04:00
```
Available actions:
- `add` - Add a new todo item
- `remove` - Remove a todo item
- `complete` - Mark a todo item as completed
- `list` - List all todo items
2025-05-21 00:35:51 -04:00
### Flags
2025-05-21 00:35:51 -04:00
- `-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
2025-05-21 00:35:51 -04:00
### Examples
Add a new todo:
2025-05-21 00:35:51 -04:00
```sh
./todo add -t "Buy milk" -d "Get 2 liters of milk"
2025-05-21 00:35:51 -04:00
```
List all todos:
2025-05-21 00:35:51 -04:00
```sh
./todo list
2025-05-21 00:35:51 -04:00
```
Complete a todo:
```sh
./todo complete -i 1
```
2025-05-21 00:35:51 -04:00
Remove a todo:
```sh
./todo remove -i 2
```
2025-05-21 00:35:51 -04:00
Display help:
2025-05-21 00:35:51 -04:00
```sh
./todo -h
2025-05-21 00:35:51 -04:00
```
## Next Improvements
- Use a CLI library like [cobra](https://github.com/spf13/cobra) for better UX
- Add edit and search features
- Add unit tests
- Improve error handling
2025-05-22 23:15:24 -04:00
- 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