A simple command-line task tracker built with Python. Add, update, delete, and track tasks from your terminal, with data persisted in a local JSON file.
This project is an implementation of the Task Tracker challenge from roadmap.sh.
- Add, update, and delete tasks
- Mark tasks as
in-progressordone - List all tasks, or filter by status (
todo,in-progress,done) - All data persisted to a local
tasks.jsonfile - No external dependencies — uses only the Python standard library
- Python 3.7+
No installation needed. Just clone and run.
# Add a new task
python task_cli.py add "Buy groceries"
# Output: Task added successfully (ID: 1)
# Update a task
python task_cli.py update 1 "Buy groceries and cook dinner"
# Delete a task
python task_cli.py delete 1
# Mark task status
python task_cli.py mark-in-progress 1
python task_cli.py mark-done 1
# List tasks
python task_cli.py list # all tasks
python task_cli.py list todo # only todo
python task_cli.py list in-progress # only in-progress
python task_cli.py list done # only doneEach task is stored with the following fields:
| Field | Description |
|---|---|
id |
Auto-incrementing unique identifier |
description |
Task description |
status |
One of todo, in-progress, done |
createdAt |
ISO 8601 creation timestamp |
updatedAt |
ISO 8601 last-update timestamp |
Tasks are stored as a JSON array in tasks.json in the current working directory. The file is created automatically on the first add command.
Example tasks.json:
[
{
"id": 1,
"description": "Buy groceries",
"status": "todo",
"createdAt": "2026-05-27T10:00:00",
"updatedAt": "2026-05-27T10:00:00"
}
]The CLI handles common error cases gracefully:
- Missing arguments → usage hint
- Non-numeric IDs → clear error message
- Non-existent task IDs →
Task not found - Unknown commands or statuses → error message
task-tracker/
├── task_cli.py # Main CLI script
├── tasks.json # Auto-generated data file (gitignored)
└── README.md
MIT