A command-line task management application built in Go. This CLI tool helps you track and manage your tasks with features for adding, updating, marking progress, and listing tasks in different states.
- ✅ Add, update, and delete tasks
- 📊 Track task status (todo, in-progress, done)
- 📝 List all tasks or filter by status
- 💾 Persistent storage using JSON
- 🔒 Thread-safe file operations
- ⚡ No external dependencies
- Go 1.19 or higher
- Clone the repository
git clone https://github.com/letsmakecakes/task-tracker.git
cd task-tracker
- Build the application
go build -o task-cli cmd/task-cli/main.go
- Set the data file path
export TASKS_FILE_PATH=/path/to/custom/tasks.json
- (Optional) Add to PATH
mv task-cli /usr/local/bin/
task-cli add "Buy groceries"
# Output: Task added successfully (ID: 1)
task-cli update 1 "Buy groceries and cook dinner"
# Output: Task 1 updated successfully
task-cli delete 1
# Output: Task 1 deleted successfully
task-cli mark-in-progress 1
# Output: Task 1 marked as in-progress
task-cli mark-done 1
# Output: Task 1 marked as done
# List all tasks
task-cli list
# List by status
task-cli list todo
task-cli list in-progress
task-cli list done
task-tracker/
├── cmd/
│ └── task-cli/
│ └── main.go # Entry point
├── internal/
│ ├── cli/
│ │ ├── commands.go # Command handlers
│ │ └── parser.go # CLI argument parser
│ ├── models/
│ │ └── task.go # Task struct and methods
│ ├── storage/
│ │ ├── json_storage.go # JSON file storage
│ │ └── storage.go # Storage interface
│ └── utils/
│ ├── errors.go # Custom errors
│ └── time.go # Time utilities
├── go.mod
└── README.md
Each task contains the following information:
id
: Unique identifierdescription
: Task descriptionstatus
: Current status (todo/in-progress/done)createdAt
: Creation timestampupdatedAt
: Last update timestamp
- File Storage: Uses JSON for persistence due to its simplicity and human-readability
- Thread Safety: Implements mutex locks for concurrent file operations
- Interface-Based Design: Storage interface allows for easy testing and alternate implementations
- No External Dependencies: Uses only Go standard library for maintainability
The application handles various error cases:
- Invalid commands or arguments
- Invalid task IDs
- File operation errors
- Concurrent access issues
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Add task priorities
- Add due dates
- Add task categories/tags
- Add search functionality
- Add task notes/comments
- Add data export/import
- Add task completion statistics
If you have any questions or suggestions, please open an issue in the repository.