Aman Tahiliani 2e770df8f3 Merge pull request #1 from AmanTahiliani/sqlite-integration
Added Sqlite DB replacing JSON
2025-05-23 08:45:56 +05:30
2025-05-22 23:11:03 -04:00
2025-05-22 23:11:03 -04:00
2025-05-22 23:11:03 -04:00
2025-05-22 23:11:03 -04:00
2025-05-22 23:15:24 -04:00
2025-05-22 23:11:03 -04:00

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

Dependencies

  • Go 1.x
  • github.com/mattn/go-sqlite3

Usage

Build the app:

go build -o todo

Add a Todo

./todo -action=add -title="Buy milk" -description="Get 2 liters of milk"

List Todos

./todo -action=list

Complete a Todo

./todo -action=complete -id=1

Remove a Todo

./todo -action=remove -id=1

Flags

  • -action (add, remove, list, complete) — What you want to do
  • -title — Title for the todo (required for add)
  • -description — Description for the todo (required for add)
  • -id — ID of the todo (required for remove and complete)

Example

./todo -action=add -title="Read Go book" -description="Finish chapter 3"
./todo -action=list
./todo -action=complete -id=1
./todo -action=remove -id=1

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
Description
No description provided
Readme 14 MiB
Languages
Go 96.3%
Makefile 3.7%