This is a simple command-line interface (CLI) program built with for managing contacts. It allows you to perform basic operations on a file containing contact information such as ID, name, phone number, and email.
- View All Contacts: Retrieve a list of all contacts stored in the file.
- Get Contact by ID: Find a specific contact using their unique identifier.
- Delete Contact by ID: Remove a contact from the list based on their ID.
- Add New Contact: Append a new contact to the file with a generated ID.
- The runtime environment for executing the CLI program.
- Commander: A framework for building command-line applications, providing a clean and structured way to define commands and options.
- uuid: Used for generating unique IDs for each contact.
- fs/promises: File system module for handling file operations asynchronously.
- Install Dependencies:
npm install
- Run the CLI:
node src/index.js --<command> [options]
- list: Display all contacts.
node src/index.js --action list
- get: Get contact by ID.
node src/index.js --action get --id <contactId>
- remove: Delete contact by ID.
node src/index.js --action remove --id <contactId>
- add: Add a new contact.
node src/index.js --action add --name <name> --email <email> --phone <phone_number>
- List all contacts:
node src/index.js --action list
- Get contact by ID:
node src/index.js --action get --id 05olLMgyVQdWRwgKfg5J6
- Remove contact by ID:
node src/index.js --action remove --id qdggE76Jtbfd9eWJHrssH
- Add a new contact:
node src/index.js --action add --name "John Doe" --email "john.doe@example.com" --phone "+1234567890"
Caption for Screenshot 1 (listContacts)
Caption for Screenshot 2 (getContactById)
Caption for Screenshot 3 (addContact)
Caption for Screenshot 4 (removeContact)
If you encounter any issues or have suggestions, please open an issue.
This project is licensed under the MIT License.
I welcome feedback and suggestions from users to improve the application's functionality and user experience.