📝

todo-cli

COMMAND-LINE TASK MANAGER · PYTHON 3

Python 3.10+ MIT License colorama
Features
🎨
Colour-coded Output
High → red · Medium → yellow · Low → cyan. Done tasks rendered in green.
Priority Sorting
Tasks automatically sorted high → medium → low on every list.
📅
Due Dates
Attach optional deadlines in YYYY-MM-DD format to any task.
💾
JSON Persistence
Tasks saved to todos.json — portable, human-readable, no DB needed.
🧩
Modular Design
3-layer architecture: CLI · business logic · storage. Easy to extend.
🔍
Full Help Docs
Every subcommand has --help. Argparse-powered with rich descriptions.
Interactive Demo
todo-cli — bash
# Welcome to todo-cli interactive demo
# Click a hint below or type a command and press Enter
 
$ todo
add (basic) add (high + due) add (low) list done 1 delete 2 --help
Example Output
todo add
$ todo add "deploy v2.0 to production" --priority high --due 2025-12-31
✔ Added: [2] deploy v2.0 to production [ HIGH ]

$ todo add "buy milk"
✔ Added: [1] buy milk [MEDIUM]

$ todo add "read Clean Code" --priority low --due 2025-04-15
✔ Added: [3] read Clean Code [ LOW ]
todo list
$ todo list

ID PRIORITY STATUS DUE DATE TITLE
────────────────────────────────────────────────────────────────────────
2 [ HIGH ] ○ pending 2025-12-31 deploy v2.0 to production
5 [ HIGH ] ○ pending fix critical bug #42
1 [MEDIUM] ○ pending buy milk
4 [MEDIUM] ○ pending 2025-03-14 weekly team sync
3 [ LOW ] ○ pending 2025-04-15 read Clean Code book

Total 5 · Pending 5 · Done 0
todo done · todo delete
$ todo done 1
✔ Done: [1] buy milk

$ todo list

ID PRIORITY STATUS DUE DATE TITLE
────────────────────────────────────────────────────────────────────────
2 [ HIGH ] ○ pending 2025-12-31 deploy v2.0 to production
1 [MEDIUM] ✔ done buy milk
3 [ LOW ] ○ pending 2025-04-15 read Clean Code book

Total 3 · Pending 2 · Done 1

$ todo delete 3
🗑 Deleted: [3] read Clean Code book
Error handling
$ todo done 99
✖ Task ID 99 not found.

$ todo add "sprint deadline" --priority urgent
✖ Unknown priority 'urgent'. Valid options: high, low, medium.

$ todo add "submit report" --due 31-12-2025
✖ Invalid date '31-12-2025'. Expected format: YYYY-MM-DD (e.g. 2025-12-31).
Project Structure
todo-cli/
├── main.py # CLI entry point · argparse · colour rendering
├── todo_manager.py # Business logic · add / list / done / delete
├── storage.py # I/O layer · load() / save() via JSON
├── todos.json # Auto-generated data file (git-ignored)
├── index.html # This demo page
└── README.md # Full documentation
Installation
# 1. Clone the repository
$ git clone https://github.com/your-username/todo-cli.git
$ cd todo-cli

# 2. Install the only dependency
$ pip install colorama

# 3. Make it executable (macOS / Linux)
$ chmod +x main.py
$ alias todo="python /path/to/todo-cli/main.py"

# 4. Start using it
$ todo add "hello world"