A command-line interface for managing tasks with features for creating, updating, listing, and analyzing tasks.
- Node.js (v12 or higher recommended)
- npm (comes with Node.js)
- Clone this repository or download the source code
- Navigate to the project directory
- Install dependencies:
npm installThis will install the required dependencies:
- commander: For command-line interface
- uuid: For generating unique IDs
The main entry point is cli.js. You can run it directly with Node.js:
node cli.js [command] [options]For convenience, you can make the script executable (on Unix-based systems):
chmod +x cli.js
./cli.js [command] [options]Running the script without any commands will display the help menu.
node cli.js create <title> [options]Options:
-d, --description <description>: Task description (default: empty)-p, --priority <priority>: Task priority (1-4, where 1=LOW, 2=MEDIUM, 3=HIGH, 4=URGENT) (default: 2)-u, --due <due_date>: Due date in YYYY-MM-DD format-t, --tags <tags>: Comma-separated list of tags
Example:
node cli.js create "Complete project" -d "Finish the task manager project" -p 3 -u 2023-12-31 -t "work,coding,important"node cli.js list [options]Options:
-s, --status <status>: Filter by status (todo, in_progress, review, done)-p, --priority <priority>: Filter by priority (1-4)-o, --overdue: Show only overdue tasks
Examples:
# List all tasks
node cli.js list
# List only tasks with "todo" status
node cli.js list -s todo
# List high priority tasks
node cli.js list -p 3
# List overdue tasks
node cli.js list -onode cli.js status <task_id> <status>Available statuses:
todo: Task not startedin_progress: Task in progressreview: Task waiting for reviewdone: Task completed
Example:
node cli.js status abc123 in_progressnode cli.js priority <task_id> <priority>Available priorities:
1: LOW2: MEDIUM3: HIGH4: URGENT
Example:
node cli.js priority abc123 3node cli.js due <task_id> <due_date>Example:
node cli.js due abc123 2023-12-31node cli.js tag <task_id> <tag>Example:
node cli.js tag abc123 importantnode cli.js untag <task_id> <tag>Example:
node cli.js untag abc123 importantnode cli.js show <task_id>Example:
node cli.js show abc123node cli.js delete <task_id>Example:
node cli.js delete abc123node cli.js statsThis command displays:
- Total number of tasks
- Tasks by status
- Tasks by priority
- Number of overdue tasks
- Number of tasks completed in the last 7 days
The project includes a comprehensive test suite built with Jest. The tests cover all major components of the application:
- Task model tests
- TaskManager tests
- TaskStorage tests
- Integration tests
npm test
npm test
Tasks are stored in a JSON file named tasks.json in the project directory. This file is created automatically when you add your first task.