The Task Manager CLI is a command-line interface (CLI) tool built with GoLang. Users can add, view, update, and delete tasks, all of which are stored in a SQLite database.
- Add Task: Add a new task with a title and description.
- List Tasks: View all tasks with details.
- Update Task: Modify existing tasks.
- Delete Task: Remove a task from the list.
- Mark as Done: Mark a task as completed.
- Search Tasks: Search tasks by keyword.
cmd/
: Contains Go files for different commands (add, list, update, etc.).db/
: Manages database connection and migrations.models/
: Defines the Task model and related database operations.main.go
: The entry point of the application.
- Go 1.21.2 or later
- SQLite
-
Clone the repository:
git clone https://github.com/dulanhewage/go-task.git cd go-task
-
Install dependencies:
go mod tidy
-
Build the project:
go build -o go-task
Run all tests:
go test ./cmd/...
Run a specific test file:
go test ./cmd/add_test.go
Run tests with verbose output:
go test -v ./cmd/...
After building the project, you can use the CLI tool by running the generated binary:
./go-task --help
Here is an example of how to use the Task Manager CLI:
- Add a new task:
./go-task add --title "Buy groceries" --description "Milk, Bread, Eggs"
- List all tasks:
./go-task list
- Update a task:
./go-task update --id 1 --title "Buy groceries and fruits" --description "Milk, Bread, Eggs, Apples"
- Mark a task as completed:
./go-task complete --id 1
- Search tasks by keyword:
./go-task search --keyword "groceries"
- Delete a task:
./go-task delete --id 1