Task Tracker CLI is a command-line application built in Python to help you manage tasks efficiently. It allows you to add, update, delete, and track tasks, while saving the tasks in a JSON file for persistence.
- Project Page: Visit the Task Tracker project page for more information.
- Submission Solution: View my Task Tracker solution submission.
- Add new tasks
- Update task descriptions
- Delete tasks
- Mark tasks as in-progress or done
- List all tasks or filter tasks by status (todo, in-progress, done)
- Tasks are stored in a
tasks.json
file
- Python: Make sure you have Node.js installed. You can download it here.
-
Clone the repository:
git clone https://github.com/goldendevuz/task-tracker.git cd task-tracker
-
Install dependencies:
make i
-
Link the CLI to the custom commnad:
To link as
task-cli
command, run:alias task-cli="python main.py"
This will make the
task-cli
command available in this folder.
Once you've linked the CLI, you can use the task-cli
command to interact with the Task Tracker.
Use the add
command to create a new task.
task-cli add "Task description"
Example:
task-cli add "Finish the project report"
Use the update
command to modify the description of an existing task by its ID.
task-cli update <task_id> "Updated description"
Example:
task-cli update 1 "Finish the project report and submit"
Use the delete
command to remove a task by its ID.
task-cli delete <task_id>
Example:
task-cli delete 1
Use the mark-in-progress
command to update the status of a task to in-progress
.
task-cli mark-in-progress <task_id>
Example:
task-cli mark-in-progress 1
Use the mark-done
command to update the status of a task to done
.
task-cli mark-done <task_id>
Example:
task-cli mark-done 1
Use the list
command to view all tasks.
task-cli list
Example Result:
+----+------------------+--------+----------------------------+-----------+
| id | description | status | createdAt | updatedAt |
+----+------------------+--------+----------------------------+-----------+
| 1 | Task description | todo | 2025-03-08 22:37:48.704676 | None |
+----+------------------+--------+----------------------------+-----------+
You can filter tasks by their status using the list
command followed by the status (todo
, in-progress
, or done
).
task-cli list <status>
Examples:
-
List all tasks marked as
done
:task-cli list done
-
List all tasks marked as
in-progress
:task-cli list in-progress
-
List all tasks that are yet to be done:
task-cli list todo
Each task has the following properties:
- id: A unique identifier for the task.
- description: The description of the task.
- status: The status of the task (
todo
,in-progress
,done
). - createdAt: The date and time when the task was created.
- updatedAt: The date and time when the task was last updated.
Tasks are stored in a JSON file located in the project directory as tasks.json
. Here's an example of how tasks are stored:
[
{
"id": 1,
"description": "Finish the project report",
"status": "in-progress",
"createdAt": "2024-09-10T12:34:56.789Z",
"updatedAt": "2024-09-10T14:23:44.456Z"
},
{
"id": 2,
"description": "Review the design documents",
"status": "done",
"createdAt": "2024-09-10T13:45:12.123Z",
"updatedAt": "2024-09-10T15:11:22.987Z"
}
]
To test the CLI without linking globally, you can run it using:
python main.py <command> [args]
Manually test the application by running the various commands listed above. Be sure to check the tasks.json
file to ensure tasks are saved correctly.
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are always welcome.
This project is licensed under the MIT License - see the LICENSE file for details.