{"id":24788821,"url":"https://github.com/programming-sai/grocery-cli","last_synced_at":"2026-04-18T19:31:45.064Z","repository":{"id":273054841,"uuid":"918524007","full_name":"Programming-Sai/Grocery-CLI","owner":"Programming-Sai","description":"A command-line tool for managing your grocery list, featuring an interactive Beginner Mode and a somewhat powerful Dev Mode for advanced users.","archived":false,"fork":false,"pushed_at":"2025-01-18T15:55:46.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T17:15:00.405Z","etag":null,"topics":["bash","cli","grocery"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Programming-Sai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-18T06:29:52.000Z","updated_at":"2025-01-18T15:55:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb2745d0-aef9-45b3-b587-171aec55e40e","html_url":"https://github.com/Programming-Sai/Grocery-CLI","commit_stats":null,"previous_names":["programming-sai/grocery-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FGrocery-CLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FGrocery-CLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FGrocery-CLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FGrocery-CLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Programming-Sai","download_url":"https://codeload.github.com/Programming-Sai/Grocery-CLI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245267570,"owners_count":20587459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cli","grocery"],"created_at":"2025-01-29T17:15:11.269Z","updated_at":"2025-10-18T20:24:56.113Z","avatar_url":"https://github.com/Programming-Sai.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grocery-CLI\n\nA command-line tool for managing your grocery list, featuring an interactive Beginner Mode and a somewhat powerful Dev Mode for advanced users.\n\nHere's a simplified setup guide tailored for a shell script:\n\n---\n\n## Setup Instructions\n\nTo get started with the **Grocery-CLI**, follow these simple steps:\n\n### 1. **Download the Script**\n\n- Clone the repository.\n\n  ```\n  git clone https://github.com/Programming-Sai/Grocery-CLI.git\n  ```\n\n- Navigate into it.\n\n  ```bash\n    cd Grocery-CLI\n  ```\n\n### 2. **Make the Script Executable**\n\nBefore running the script, you need to give it executable permissions.\n\nIn your terminal, navigate to the directory where the `grocery_easy.sh` or `grocery_dev.sh` file is located, then run:\n\n```\nchmod +x grocery_easy.sh\n\n# OR\n\nchmod +x grocery_dev.sh\n```\n\n### 3. **Run the Script**\n\nOnce the script is executable, you can run it directly in your terminal:\n\n```\n./grocery_easy.sh\n\n# OR\n\n./grocery_dev.sh \u003ccommand\u003e [options]\n\n```\n\nThe script will start, and you will be guided through the available commands.\n\n---\n\n## Easy Section (Non-Dev Mode)\n\n![Welcome Screen](./img/welcome.png)\n\nThe **Easy Section** is designed for users who prefer a simple and intuitive interface to manage their grocery list. It guides you step-by-step through the process of adding, displaying, searching, and deleting items from your list, all without needing any prior technical knowledge. Here's how it works:\n\n\u003e [!NOTE]\n\u003e Make sure to select an Option from the welcome screen in order to use the functions.\n\n### Available funcitons\n\n- **add**: Adds a new item to your grocery list. You will be prompted to enter the name, price, and quantity of the item.\n  - Example: `add`\n- **display**: Shows all items in your grocery list in a formatted table.\n  - Example: `display`\n- **search**: Search for an item by its name. You will be asked to enter a search term, and the tool will display matching items.\n  - Example: `search \u003citem_name\u003e`\n- **delete**: Deletes an item from the list. After searching for an item, you'll be asked to confirm deletion.\n\n  - Example: `delete \u003citem_name\u003e`\n\n- **total**: Displays the total cost of all items in your grocery list.\n\n  - Example: `total`\n\n- **clear**: Clears all items from the grocery list after confirming the action.\n  - Example: `clear`\n\n### Example Usage\n\n1. **Adding an Item**\n\n   ```\n   add\n\n   Please enter the name of the Item: Apples\n   Please enter the price of the Item: 1.99\n   Please enter the quantity of the Item: 2\n   Are these what you want to add to the grocery list? (y/n) y\n   Item Added Successfully\n   ```\n\n2. **Displaying Items**\n\n   ```\n   display\n\n   Item Name      Item Quantity    Item Price\n   --------------------------------------------\n   Apples         2                1.99\n   ```\n\n3. **Searching for an Item**\n\n   ```\n   search Apples\n\n   Item Name      Item Quantity    Item Price\n   --------------------------------------------\n   Apples         2                1.99\n   ```\n\n4. **Deleting an Item**\n\n   ```\n   delete Apples\n\n   Are you sure you want to remove this item from the grocery list? (y/n) y\n   Item successfully deleted.\n   ```\n\n5. **Getting the Total**\n\n   ```\n   total\n\n   Total: 1.99\n   ```\n\n6. **Clearing the List**\n\n   ```\n   clear\n\n   Are you sure you want to clear the storage? (y/n) y\n   Storage Cleared\n   ```\n\nThis section makes it easy for non-dev users to quickly start managing their grocery lists without getting into the complexities of the more advanced features.\n\n---\n\n## Dev Mode\n\nDev Mode allows you to run the grocery tool in a more advanced, command-line style, similar to how version control tools like Git are used. It provides a more flexible and hands-on experience, where users interact directly with commands and options, enabling efficient management of tasks like adding, displaying, and deleting items in the grocery list. This mode is suited for users who are familiar with command-line interfaces and prefer a more granular control over their operations.\n\n### Commands in Dev Mode\n\nThe following commands are available in Dev mode:\n\n#### 1. **add** `\u003citem_name\u003e` `\u003citem_price\u003e` `\u003citem_quantity\u003e`\n\n- Adds a new item to the grocery list.\n- **Parameters**:\n  - `item_name`: The name of the grocery item (e.g., \"Apples\").\n  - `item_price`: The price per unit of the item (e.g., \"2.5\").\n  - `item_quantity`: The number of items being added to the list (can be a positive integer or `-1` for undefined quantity).\n- Example:\n  ```bash\n  ./grocery_dev.sh add \"Apples\" 2.5 10\n  ```\n\n#### 2. **display**\n\n- Displays the list of all items currently in the grocery list with their quantities and prices.\n\n#### 3. **search** `\u003citem_name\u003e`\n\n- Searches for an item by its name and displays its details (if it exists in the list).\n- Example:\n  ```bash\n  ./grocery_dev.sh search \"Apples\"\n  ```\n\n#### 4. **delete** `\u003citem_name\u003e`\n\n- Deletes an item from the grocery list based on the specified name.\n- Example:\n  ```bash\n  ./grocery_dev.sh delete \"Apples\"\n  ```\n\n#### 5. **total**\n\n- Displays the total cost of all items in the grocery list.\n- Example:\n  ```bash\n  ./grocery_dev.sh total\n  ```\n\n#### 6. **clear**\n\n- Clears all items from the grocery list. This command removes all records from the list, so be careful when using it.\n- Example:\n  ```bash\n  ./grocery_dev.sh clear\n  ```\n\n#### 7. **--help** or **-h**\n\n- Displays a help message detailing the usage of the Dev mode commands.\n- Example:\n  ```bash\n  ./grocery_dev.sh --help\n  ```\n\n### Debugging and Error Handling\n\nDev Mode will show detailed messages when errors occur or invalid inputs are provided, helping you identify and fix issues quickly.\n\nFor example:\n\n- If you enter a non-numeric value for price or quantity, you'll get a helpful error message indicating the issue.\n- Missing or incorrect arguments will result in a usage guide being displayed, showing the correct format for the command.\n\n### Example Usage in Dev Mode\n\n1. **Adding Items**:\n\n   ```bash\n   ./grocery_dev.sh add \"Tomatoes\" 3.5 10\n   ```\n\n2. **Displaying Items**:\n\n   ```bash\n   ./grocery_dev.sh display\n   ```\n\n3. **Calculating Total**:\n\n   ```bash\n   ./grocery_dev.sh total\n   ```\n\n4. **Searching for an Item**:\n\n   ```bash\n   ./grocery_dev.sh search \"Tomatoes\"\n   ```\n\n5. **Deleting an Item**:\n\n   ```bash\n   ./grocery_dev.sh delete \"Tomatoes\"\n   ```\n\n6. **Clearing the List**:\n\n   ```bash\n   ./grocery_dev.sh clear\n   ```\n\n7. **Help Command**:\n   ```bash\n   ./grocery_dev.sh --help\n   ```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramming-sai%2Fgrocery-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogramming-sai%2Fgrocery-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramming-sai%2Fgrocery-cli/lists"}