UNPKG

avocavo

Version:

Avocavo CLI - Nutrition analysis made simple. Get accurate USDA nutrition data with secure authentication.

148 lines (110 loc) • 4.2 kB
# šŸ„‘ Avocavo CLI > Nutrition analysis made simple. Get accurate USDA nutrition data with secure authentication. ## šŸš€ Quick Start ```bash # Install globally npm install -g avocavo # Login to your account avocavo login # Analyze a single ingredient avocavo ingredient "1 cup rice" # Analyze a recipe avocavo recipe -i "2 eggs" "1 cup flour" "1 cup milk" # Get help avocavo --help ``` ## ✨ Features - šŸ” **Secure Authentication** - Uses system keychain for credential storage - šŸ„— **USDA Database** - Access to comprehensive nutrition data - 🧮 **Batch Analysis** - Analyze multiple ingredients at once - šŸ“Š **Rich Output** - Beautiful tables and JSON formats - šŸ”’ **SSL Security** - All connections use verified HTTPS ## šŸ“¦ Installation ```bash npm install -g avocavo ``` **Requirements:** - Node.js >= 16.0.0 - npm >= 7.0.0 ## šŸ” Authentication 1. **Sign up** at [nutrition.avocavo.app](https://nutrition.avocavo.app) 2. **Login** via CLI: ```bash avocavo login ``` 3. Your credentials are stored securely in your system keychain ## šŸ“– Commands ### `avocavo login` Authenticate with your Avocavo account via secure OAuth. ### `avocavo ingredient <ingredient>` Analyze a single ingredient: ```bash avocavo ingredient "1 cup brown rice" avocavo ingredient "200g chicken breast" avocavo ingredient "1 cup rice" -v # Include USDA verification URL ``` ### `avocavo recipe [options]` Analyze multiple ingredients as a recipe: ```bash avocavo recipe -i "2 eggs" "1 cup flour" "1/2 cup milk" avocavo recipe -i "2 cups flour" "1 cup milk" -s 8 # 8 servings avocavo recipe -f ingredients.txt -s 4 # From file, 4 servings ``` ### `avocavo batch [options]` Analyze multiple ingredients efficiently: ```bash avocavo batch -i "1 cup rice" "2 tbsp oil" "4 oz chicken" avocavo batch -f ingredients.txt ``` ### `avocavo keys` Manage API keys: ```bash avocavo keys list # List all API keys avocavo keys create # Create new API key avocavo keys create -n "Production" # Create with custom name avocavo keys switch # Switch active API key avocavo keys delete # Delete an API key ``` ### `avocavo status` Show login status and account information. ### `avocavo health` Check API health and status. ### `avocavo logout` Remove stored credentials. ## šŸ”’ Security - **SSL Verification**: All API calls use verified HTTPS connections - **Secure Storage**: Credentials stored in system keychain (not plaintext) - **OAuth Flow**: Secure browser-based authentication - **No Hardcoded Secrets**: All sensitive data handled securely ## šŸ“Š Output Formats ### Table Format (default) ``` ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ Nutrient │ Amount │ Unit │ Per 100g │ % DV │ ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤ │ Calories │ 365 │ kcal │ 365 │ 18.3% │ │ Protein │ 7.1 │ g │ 7.1 │ 14.2% │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ``` ### JSON Format ```bash avocavo ingredient "1 cup rice" --json ``` ## šŸ†˜ Support - **Documentation**: [nutrition.avocavo.app/docs](https://nutrition.avocavo.app/docs) - **Issues**: [GitHub Issues](https://github.com/avocavo/avocavo-cli/issues) - **Email**: api-support@avocavo.com ## šŸ“„ License MIT License - see [LICENSE](LICENSE) file for details. --- **šŸ”„ Migrating from avocavo-nutrition-cli?** The old package has been deprecated due to security vulnerabilities. Migration is simple: ```bash # Remove old package npm uninstall -g avocavo-nutrition-cli # Install new secure package npm install -g avocavo # Same commands work! avocavo login avocavo ingredient "1 cup rice" ```