A simple command-line Todo application built with Node.js and Commander. Stores todos in a local 'todos.json' file.
- Node.js (v14+ recommended)
- npm
-
Clone or download this project into a folder.
-
Open terminal and navigate to the project folder:
bash cd /path/to/cli-todo
- Install dependencies:
bash npm install
- Make the script executable (macOS / Linux):
bash chmod +x index.js
- Link the package globally so you can run the 'todo' command from anywhere:
bash npm link
Now the 'todo' command should be available globally.
bash todo add "Learn Node.js"
Adds a new todo and saves it to 'todos.json'.
Example output:
✅ TODO Added: Learn Node.js
bash todo list
Shows all saved todos, with their index and status.
Example output:
📌 Your Todos:
- Learn Node.js
- [✓] Practice TypeScript
bash todo done 2
Marks todo number 2 as completed and saves the file.
Example output:
✅ Marked as done: Practice TypeScript
bash todo clear
Deletes all todos (empties 'todos.json').
Example output: 🗑️ All todos deleted successfully!
If you want, I can also create a short CONTRIBUTING.md or convert this README into a PDF.