A simple Command Line Interface (CLI) task tracker built in Go (Golang).
Note
This is a learning project designed to explore Go's core concepts, CLI argument handling, file I/O operations, JSON encoding/decoding, and basic Go project structures.
- Sequential Task ID Generation: Automatically increments task IDs based on list size.
- Task Management:
add: Add new tasks to the tracker.list: View all tasks with their completion status.done: Mark a specific task as completed.del: Delete a task (automatically shifts subsequent task IDs to maintain clean sequential order).
- JSON Lines Persistence: Stores tasks in a local
tasks.jsonlfile.
- Go (version 1.26.4 or later recommended)
To run the CLI during development without building a binary:
# Run the entire package/directory (required due to multi-file structure)
go run . <command> [arguments]To compile the project into a local executable:
# Build the binary
go build -o goTrack
# Run the compiled binary
./goTrack <command> [arguments]To install the binary globally into your $GOPATH/bin or $GOBIN:
go installAfter installation, you can run the command from anywhere:
goTrack <command> [arguments]If you have configured GitHub Releases via GoReleaser:
- Navigate to the Releases page of this repository.
- Download the appropriate pre-compiled archive for your OS and architecture.
- Extract the binary and place it in your system's PATH.
Here are the commands you can use:
go run . add "Buy groceries"
go run . add "Learn Go concepts"go run . listOutput Example:
[ ] 1 Buy groceries
[ ] 2 Learn Go concepts
go run . done 1Output Example:
Completed task: {1 Buy groceries true}
go run . del 1Output Example:
Deleted task: {1 Buy groceries true}
Tip
Deleting a task will shift the IDs of all tasks after it (e.g., Task 2 becomes Task 1) to keep the list sequentially numbered without gaps.
- Sequential ID Generation Fix: Transition to database-like stateful auto-incrementing IDs so shifting isn't necessary upon deletion.
- CLI Argument Parsing: Migrate from basic manual
os.Argsmanipulation to Go's standard libraryflagpackage orcobrafor flags and clean help screens. - User Experience Improvements: Implement pretty-printed tables or color-coded terminal text to indicate completed vs. active tasks.