A simple Node.js command-line todo application built with MongoDB and Mongoose.
- Add todos
- View all todos
- Mark todos as completed
- Delete todos
- Interactive menu mode
- Node.js 18+
- MongoDB running locally or in a remote MongoDB instance
- Clone the repository
- Open the project folder:
cd TODO-CLI - Install dependencies:
npm install
- Copy the example environment file:
copy .env.example .env
- Update the MongoDB connection string in
.envif needed:MONGO_URI=mongodb://localhost:27017/todo-cli
node bin/index.js add "Learn Node.js"node bin/index.js viewnode bin/index.js done <todo-id>node bin/index.js delete <todo-id>node bin/index.js menuIf you want to run the app as a global command:
npm linkThen you can run:
todo add "Learn Node.js"- Do not commit your real
.envfile. - Keep
.env.exampleas the public-safe template. - This project is intended to be shared publicly, so avoid storing secrets or personal local config in the repo.