Task Tracker CLI is a command-line tool for managing and tracking tasks. It allows users to add, update, delete, mark tasks as in-progress or done, and list tasks by status. Task data is stored in a JSON file locally.
Source: https://roadmap.sh/projects/task-tracker
task-cli/
├── Makefile
├── cmd
│ └── main.go
├── go.mod
└── internal
├── model
│ ├── task.go
│ └── task_test.go
├── repository
│ ├── task_repository.go
│ └── task_repository_test.go
└── service
├── task_service.go
└── task_service_test.go
- Add new tasks
- Update task descriptions
- Delete tasks
- Mark tasks as "in-progress" or "done"
- List all tasks or filter by status (todo, in-progress, done)
- Persist task data in a
tasks.jsonfile
- Go 1.18 or higher
- No external library dependencies; uses only the Go standard library
-
Clone or download the project to your local machine:
git clone <repository-url> cd task-cli
-
Initialize the Go module (if not already initialized):
go mod init task-cli
-
Install dependencies:
make deps
-
Build the project:
make build
After building, the executable is named task-cli. Below are the supported commands:
./task-cli add "Buy groceries"Output: Task added successfully (ID: 1)
./task-cli update 1 "Buy groceries and cook dinner"Output: Task updated successfully
./task-cli delete 1Output: Task deleted successfully
-
Mark as in-progress:
./task-cli mark-in-progress 1
Output:
Task marked as in-progress -
Mark as done:
./task-cli mark-done 1
Output:
Task marked as done
-
List all tasks:
./task-cli list
-
Filter by status:
./task-cli list todo ./task-cli list in-progress ./task-cli list done
Each task includes the following properties, stored in tasks.json:
id: Unique identifierdescription: Task descriptionstatus: Task status (todo,in-progress,done)createdAt: Creation timestampupdatedAt: Last updated timestamp
The project includes comprehensive unit tests covering the model, repository, and service layers.
Run tests:
make testTest files:
internal/model/task_test.go: Tests the task structinternal/repository/task_repository_test.go: Tests JSON file operationsinternal/service/task_service_test.go: Tests task management logic
makeormake all: Build the projectmake build: Compile thetask-clibinarymake run: Build and run the applicationmake clean: Remove the binarymake deps: Tidy and download dependenciesmake fmt: Format codemake test: Run all tests
- Task data is stored in
tasks.jsonin the project root directory. - Commands return error messages for invalid task IDs.
- Ensure the Go environment is properly set up (
gocommand available).
Contributions are welcome! Please submit issues or pull requests. Ensure code follows Go conventions and run make fmt and make test before submitting.
MIT License