A professional, lightweight command-line interface (CLI) application built with Node.js to help you track your daily tasks. This project demonstrates clean software architecture, ES Modules, and persistent data storage using JSON. Project Idea from Roadmap.sh task tracker.
Quick Install (Recommended):
Install globally via npm to use the task command anywhere on your system:
npm install -g @notankit/task-tracker-cliInstall from Source:
-
Clone the repository:
git clone <repository-url> cd Task-Tracker-CLI
-
Link the command globally: This step allows you to run
taskfrom any folder in your terminal.npm link
Create a new task to your to-do list. Every new task starts with the status todo.
- Command:
add - Usage:
task add "Your task description" - Example:
task add "Finish the Node.js project documentation" - Behavior: Generates a unique ID and adds
createdAtandupdatedAttimestamps.
View your tasks. You can see everything or filter by a specific state.
- Command:
list - Usage:
task list [filter] - Filters:
all(default): Shows every task.todo: Shows tasks not yet started.in-progress: Shows tasks currently being worked on.done: Shows completed tasks.
- Example:
task list in-progress
Modify the description of a task if your requirements change.
- Command:
update - Usage:
task update <id> "New description" - Example:
task update 1 "Finish the Node.js project documentation and add examples" - Behavior: Updates the text and refreshes the
updatedAttimestamp.
Move tasks through your workflow lifecycle.
- Command:
mark-in-progress - Usage:
task mark-in-progress <id> - Example:
task mark-in-progress 1
- Command:
mark-done - Usage:
task mark-done <id> - Example:
task mark-done 1
Remove a task from your list permanently.
- Command:
delete - Usage:
task delete <id> - Example:
task delete 1
This project follows the Separation of Concerns principle, splitting the app into three distinct layers:
The "Entry Point." It handles:
- Command-line argument parsing via
process.argv. - Input validation (checking for missing IDs or descriptions).
- Formatting data for the console.
The "Brain." It handles:
- Business rules (e.g., how to generate a unique ID).
- Data filtering logic.
- Coordinating between the user's request and the storage.
The "Persistence." It handles:
- Reading and writing the
tasks.jsonfile. - JSON serialization and deserialization.
- Ensuring the data file is created if it doesn't exist.
Each task is stored as an object in tasks.json with the following properties:
| Property | Type | Description |
|---|---|---|
id |
Number | Unique identifier for the task. |
description |
String | The text description of the task. |
status |
String | Current state: todo, in-progress, or done. |
createdAt |
ISO Date | When the task was first created. |
updatedAt |
ISO Date | When the task was last modified. |
ISC