A simple command-line task manager built with TypeScript and Node.js.
You can add, update, delete, list, and mark tasks directly from your terminal — all stored in a local db.json file.
- 📋 Add, update, delete, and list tasks
- ✅ Mark tasks as
doneorin-progress - 🔎 Filter tasks by status (
todo,done,in-progress) - 💾 Data stored locally in a simple JSON database
- 🧱 Built with clean, modular TypeScript classes
-
Clone this repository:
git clone https://github.com/yourusername/task-cli.git cd task-cli -
Install dependencies:
npm install- (Optional) Link it globally to use as a command:
npm linkRun the CLI with npm start or (if linked) just task-cli.
npm start add "Buy groceries"
# or
task-cli add "Buy groceries"task-cli listtask-cli list done
task-cli list todo
task-cli list in-progresstask-cli update 1 "Buy groceries and cook dinner"task-cli delete 1task-cli mark-done 2
task-cli mark-in-progress 3
src/
├── file-manager.ts # Handles reading/writing db.json
├── task-manager.ts # Core logic for managing tasks
├── index.ts # CLI entry point (parses commands)
├── types.ts # Type definitions
db.json # Local data storage (auto-created)-
Responsible for reading and writing to
db.json. Ensures the file exists and initializes it with a default schema if missing. -
Handles all business logic:
- Generating unique task IDs
- Creating, updating, and deleting tasks
- Filtering by status
- Marking tasks as done or in progress
-
Acts as the CLI entry point.
Parses commands and delegates them to
TaskManager.
| Command | Description | Example |
|---|---|---|
add <desc> |
Add a new task | task-cli add "Clean house" |
update <id> <desc> |
Update a task description | task-cli update 2 "Clean house thoroughly" |
delete <id> |
Delete a task | task-cli delete 2 |
mark-done <id> |
Mark a task as done | task-cli mark-done 2 |
mark-in-progress <id> |
Mark a task as in progress | task-cli mark-in-progress 2 |
list [status] |
List all tasks or filtered by status | task-cli list done |
$ task-cli add "Finish README"
[task added]: { id: 1, description: "Finish README", status: "todo", createdAt: "..." }
$ task-cli mark-in-progress 1
[task updated]: { id: 1, description: "Finish README", status: "in-progress", updatedAt: "..." }
$ task-cli mark-done 1
[task updated]: { id: 1, description: "Finish README", status: "done", updatedAt: "..." }
$ task-cli list done
[done tasks]: [ { id: 1, description: "Finish README", status: "done" } ]
- Node.js (v18+)
- TypeScript
- fs, path (for local persistence)
- tsx for running TypeScript directly
MIT License © 2025 Jonathan Atia