avocavo
Version:
Avocavo CLI - Nutrition analysis made simple. Get accurate USDA nutrition data with secure authentication.
148 lines (110 loc) ⢠4.2 kB
Markdown
# š„ 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"
```