A simple command-line interface (CLI) application for tracking and managing your daily tasks. This project was built as part of the roadmap.sh task tracker project to practice CLI development and file handling in Python.
- ✅ Add new tasks with unique IDs
- ✏️ Update existing task descriptions
- 🗑️ Delete tasks by ID
- 📋 List all tasks or filter by status
- 🔄 Mark tasks as in-progress or completed
- 💾 Persistent storage using JSON file
- ⏰ Automatic timestamps for creation and updates
- Python 3.6 or higher
- No external dependencies (uses only Python standard library)
-
Clone this repository:
git clone https://github.com/ashrithvm/task-tracker-cli.git cd task-tracker-cli
-
Make the script executable (optional):
chmod +x task_cli.py
-
(Optional but Recommended) Create a Symbolic Link: To make the command available system-wide, create a symbolic link to it in a directory that is in your system's PATH. A common location is
/usr/local/bin
.sudo ln -s "$(pwd)/task_cli.py" /usr/local/bin/task-cli
You can now run your application from any directory in the terminal like this:
task-cli add "Finish my project"
task-cli add "Buy groceries"
task-cli update 1 "Buy groceries and cook dinner"
task-cli delete 1
task-cli mark-in-progress 1
task-cli mark-done 1
List all tasks:
task-cli list
List tasks by status:
# List only todo tasks
task-cli list todo
# List only in-progress tasks
task-cli list in-progress
# List only completed tasks
task-cli list done
task-cli --help
Each task contains the following properties:
id
: A unique identifier for the taskdescription
: A short description of the taskstatus
: The status of the task (todo
,in-progress
,done
)createdAt
: The date and time when the task was createdupdatedAt
: The date and time when the task was last updated
Tasks are stored in a tasks.json
file in the same directory as the script. The file is created automatically when you add your first task.
[
{
"id": 1,
"description": "Buy groceries",
"status": "todo",
"createdAt": "2025-09-27T10:30:00.123456",
"updatedAt": "2025-09-27T10:30:00.123456"
},
{
"id": 2,
"description": "Walk the dog",
"status": "in-progress",
"createdAt": "2025-09-27T11:00:00.654321",
"updatedAt": "2025-09-27T11:15:00.789012"
}
]
task-tracker-cli/
├── task_cli.py # Main CLI script
├── tasks.json # Task data storage (created automatically)
└── README.md # Project documentation
The project implements the following core functionalities as specified in the roadmap.sh project requirements:
- Task Management: Add, update, and delete tasks
- Status Tracking: Three status levels (todo, in-progress, done)
- Persistent Storage: JSON file-based storage
- CLI Interface: Command-line argument parsing using
argparse
- Data Validation: Input validation and error handling
- Timestamps: Automatic tracking of creation and update times
The application includes robust error handling for common scenarios:
- Invalid task IDs
- Invalid status values
- Missing or corrupted JSON files
- Invalid command-line arguments
This is a learning project, but contributions are welcome! Here's how you can contribute:
- 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
Some ideas for extending this project:
- Task priorities (high, medium, low)
- Due dates and reminders
- Task categories/tags
- Export to different formats (CSV, PDF)
- Task search functionality
- Undo/redo operations
- Task dependencies
- Time tracking for tasks
This project is open source and available under the MIT License.
- roadmap.sh for providing the project specifications
- Python community for excellent documentation and resources
Happy task tracking! 🚀