A simple command-line interface (CLI) application to track and manage your tasks and to-do list. Built with Python, this project demonstrates fundamental programming concepts including file I/O, JSON data persistence, object-oriented programming, and CLI development.
- ✅ Add new tasks with descriptions
- ✏️ Update existing task descriptions
- 🗑️ Delete tasks by ID
- 📋 Mark tasks as in-progress or completed
- 📊 List all tasks or filter by status
- 💾 Persistent storage using JSON files
- 🔍 Input validation and error handling
# Clone the repository
git clone https://github.com/jscode-1302/task-tracker.git
cd task-tracker
# Run the application
python main.py
# Add your first task
add 'Learn Python CLI development'- Python: 3.7 or higher
- Operating System: Windows, macOS, or Linux
- Dependencies: None (uses only Python standard library)
git clone https://github.com/jscode-1302/task-tracker.git
cd task-tracker
python main.py- Download the ZIP file from the repository
- Extract to your desired location
- Navigate to the folder in your terminal
- Run
python main.py
The application runs in interactive mode. After starting, you'll see a welcome message and can enter commands.
add 'Buy groceries'
# Output: Task added successfully (ID: 1)
add 'Complete Python project'
# Output: Task added successfully (ID: 2)update 1 'Buy groceries and cook dinner'
# Output: Task updated successfully!delete 1
# Output: Task deleted successfully!# Mark as in progress
mark-in-progress 1
# Output: Task marked in progress successfully!
# Mark as completed
mark-done 1
# Output: Task marked done successfully!# List all tasks
list
# List by status
list todo
list in-progress
list donehelp
# Shows all available commands and usage examplesWelcome!
Enter 'help' to see the commands
> add 'Learn Python OOP'
Task added successfully (ID: 1)
> add 'Build a CLI app'
Task added successfully (ID: 2)
> mark-in-progress 1
Task marked in progress successfully!
> list
ID: 1 - Description: Learn Python OOP - Status: in-progress - Created at: 01/07/2025 - Updated at: 01/07/2025
ID: 2 - Description: Build a CLI app - Status: todo - Created at: 01/07/2025 - Updated at: 01/07/2025
> mark-done 1
Task marked done successfully!
> list done
ID: 1 - Description: Learn Python OOP - Status: done - Created at: 01/07/2025 - Updated at: 01/07/2025task-tracker-cli/
│
├── main.py # Main application entry point and CLI interface
├── models.py # Task and TaskManager classes
├── utils.py # Utility functions for data handling
├── tasks.json # JSON file for persistent data storage (auto-generated)
├── .gitignore # Git ignore rules
├── LICENSE # MIT License
└── README.md # Project documentation
Task Class
- Properties: id, description, status, created_at, updated_at
- Validation: Ensures task descriptions are at least 3 characters long
- Features: Automatic timestamp management and string representations
TaskManager Class
- Functionality: Manages all task operations (CRUD)
- Data Handling: JSON serialization/deserialization
- Features: Automatic ID generation and file persistence
Tasks are stored in tasks.json with this structure:
[
{
"id": 1,
"description": "Sample task",
"status": "todo",
"created_at": "01/07/2025",
"updated_at": "01/07/2025"
}
]| Status | Description |
|---|---|
todo |
Default status for new tasks |
in-progress |
Tasks currently being worked on |
done |
Completed tasks |
Common Issues:
- "Command not recognized": Make sure you're using the exact command format shown in
help - "Invalid command or format": Check that task descriptions are enclosed in single quotes
- "Id not found": Verify the task ID exists by running
list - Python not found: Ensure Python 3.7+ is installed and in your PATH
File Issues:
- The
tasks.jsonfile is created automatically on first use - If the file becomes corrupted, delete it and restart the application
- Object-Oriented Design: Clean separation between Task entities and TaskManager operations
- Data Persistence: JSON file storage with automatic loading/saving
- Input Validation: Regex-based command parsing with comprehensive error handling
- User Experience: Clear success/error messages and help documentation
- Error Handling: Graceful handling of invalid inputs and edge cases
- Add task priorities (high, medium, low)
- Implement due dates and reminders
- Add task categories/tags
- Export tasks to different formats (CSV, TXT)
- Add search functionality
- Implement task completion statistics
- Add task dependencies
- Create a web interface version
This is a learning project, but contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
git clone https://github.com/yourusername/task-tracker.git
cd task-tracker
# Make your changes
python main.py # Test your changesThis project is licensed under the MIT License - see the LICENSE file for details.
This project was built as part of my journey learning Python and backend development. It demonstrates core programming concepts including:
- Object-oriented programming principles
- File I/O operations and JSON handling
- Regular expressions for input parsing
- Error handling and validation
- CLI application development
Project inspired by: roadmap.sh Task Tracker CLI Project
⭐ Found this helpful? Give it a star on GitHub!