This is a simple command-line interface (CLI) application for managing notes. You can create, list, find, remove, and clean notes directly from your terminal.
- Create a new note with optional tags
- List all notes
- Find notes by a search term
- Remove a note by its ID
- Remove all notes
-
Clone the repository:
git clone https://github.com/yourusername/note-taking-cli.git
-
Navigate to the project directory:
cd note-taking-cli -
Install the dependencies:
npm install
To create a new note, use the new command followed by the content of the note. Optionally, you can add tags using the -t or --tags option.
note new "This is my note" -t "tag1,tag2"To list all notes, use the all command:
note allTo find notes by a search term, use the find command followed by the search term:
note find "search term"To remove a note by its ID, use the remove command followed by the ID of the note:
note remove 1234567890To remove all notes, use the clean command:
note clean- index.js: The entry point for the CLI application.
- src/command.js: Handles command definitions and parsing.
- src/db.js: Handles reading from and writing to the database (a JSON file).
- src/notes.js: Contains the core functions for managing notes (create, read, update, delete).
To add new commands, edit the src/command.js file. Follow the existing structure to define new commands, options, and handlers.
If you encounter issues, make sure to check the following:
-
The
db.jsonfile should exist in the root directory. If it doesn't, create an empty JSON file nameddb.jsonwith the following content:{ "notes": [] } -
Ensure you are using the correct Node.js version specified in the
package.jsonfile.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
This project uses the following libraries:
- yargs: For command-line argument parsing.