Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note-Taking CLI App

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.

Features

  • 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

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/note-taking-cli.git
  2. Navigate to the project directory:

    cd note-taking-cli
  3. Install the dependencies:

    npm install

Usage

Create a New Note

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"

List All Notes

To list all notes, use the all command:

note all

Find Notes

To find notes by a search term, use the find command followed by the search term:

note find "search term"

Remove a Note

To remove a note by its ID, use the remove command followed by the ID of the note:

note remove 1234567890

Remove All Notes

To remove all notes, use the clean command:

note clean

Development

Project Structure

  • 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).

Adding New Commands

To add new commands, edit the src/command.js file. Follow the existing structure to define new commands, options, and handlers.

Debugging

If you encounter issues, make sure to check the following:

  • The db.json file should exist in the root directory. If it doesn't, create an empty JSON file named db.json with the following content:

    {
      "notes": []
    }
  • Ensure you are using the correct Node.js version specified in the package.json file.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.

Acknowledgements

This project uses the following libraries:

  • yargs: For command-line argument parsing.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages