opencal
npx skills add https://github.com/opencal-ai/opencal --skill opencal
Agent 安装分布
Skill 文档
OpenCal
OpenCal is a calorie & nutrition tracker with a beautiful iOS app. This skill lets your AI agent log meals, check progress, and update goals â so the user never has to open the app to track what they eat.
“I just had a burrito for lunch” â agent searches, scales, logs it â it shows up in the app instantly.
Setup
- Download OpenCal from the App Store
- Sign in and set your calorie/macro goals
- Go to Profile â API Keys â Generate
- Save the key permanently (add to your shell profile so it persists across sessions):
On bash, useecho 'export OPENCAL_API_KEY="sk_your-key-here"' >> ~/.zshrc source ~/.zshrc~/.bashrcinstead. The key must survive terminal restarts â a bareexportonly lasts one session.
When to use this skill
| User says | What to do |
|---|---|
| “I had a chicken sandwich for lunch” | Search food â scale nutrition â log it |
| “What did I eat today?” | Fetch today’s log and summarize |
| “How much protein do I have left?” | Fetch log totals and compare to goals |
| “I want to cut to 1800 calories” | Update their calorie goal |
| “That last entry was wrong, remove it” | Delete the log entry |
| “What’s in a banana?” | Search and show nutrition info (don’t log) |
Log a meal
The most common flow. User says something like “I had 200g chicken breast for lunch”:
1. Search for the food:
curl -s "${OPENCAL_BASE_URL:-https://api.opencal.ai}/api/v1/food/search?q=chicken+breast&limit=5" \
-H "Authorization: Bearer $OPENCAL_API_KEY" | jq '.results[] | {name, calories, protein, carbs, fat}'
Results are per 100g. Pick the best match.
2. Scale to the actual amount and log:
curl -s -X POST "${OPENCAL_BASE_URL:-https://api.opencal.ai}/api/v1/food/log" \
-H "Authorization: Bearer $OPENCAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Chicken Breast",
"amount": 200, "unit": "g",
"calories": 330, "protein": 62, "carbs": 0, "fat": 7.2,
"mealType": "lunch"
}'
Multiply all nutrition values by amount / 100. The entry appears in the app immediately.
Use mealType: breakfast, lunch, dinner, or snack.
Add "loggedAt": "2026-02-18T12:00:00Z" to backfill a past meal (defaults to now).
3. Confirm with the user: “Logged 200g chicken breast for lunch â 330 kcal, 62g protein.”
Check daily progress
curl -s "${OPENCAL_BASE_URL:-https://api.opencal.ai}/api/v1/food/log?date=2026-02-18" \
-H "Authorization: Bearer $OPENCAL_API_KEY" | jq '{totals, entries: [.entries[] | {name, calories, mealType}]}'
Omit ?date= for today. Returns each entry plus totals (calories, protein, carbs, fat).
Check and update goals
# Current goals
curl -s "${OPENCAL_BASE_URL:-https://api.opencal.ai}/api/v1/goals" \
-H "Authorization: Bearer $OPENCAL_API_KEY" | jq
# Update (only include fields to change)
curl -s -X PUT "${OPENCAL_BASE_URL:-https://api.opencal.ai}/api/v1/goals" \
-H "Authorization: Bearer $OPENCAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"calorieGoal": 1800, "proteinGrams": 160}'
Delete a log entry
Get the entry ID from the daily log, then:
curl -s -X DELETE "${OPENCAL_BASE_URL:-https://api.opencal.ai}/api/v1/food/log/{id}" \
-H "Authorization: Bearer $OPENCAL_API_KEY"
Smart search â finding the right product
The database is primarily English (USDA + generic foods). Follow this strategy:
- Search the product name as-is first. If the user says “Rinderhackfleisch mager”, search that.
- If zero results, translate to English and retry. “Rinderhackfleisch mager” â search “ground beef lean”. This covers most cases.
- If multiple results, pick the closest match. Compare fat %, brand, or description. Go with the best fit.
- If confidence is low, tell the user. Example: “I found 3 options for ground beef â went with 90% lean (170 kcal/100g). Here are the others if that’s not right: [list]. You can also correct it in the app.”
- Never hardcode nutrition values from memory. Always search first. The database has scaled, verified values.
- Try simpler/shorter terms if specific ones fail. “Rewe Kultur Heidelbeeren” â “blueberries”. “More Nutrition Protein Sahne” â “whey protein powder”.
The goal: use real DB entries whenever possible. The user can correct in the app if the match isn’t perfect â that’s better than made-up numbers.
Important notes
- Search results are per 100g â always scale before logging
- If the user doesn’t mention an amount, ask â don’t guess
- Always confirm what you logged so the user can correct mistakes
- Rate limit: 100 requests/min
Updating this skill
npx skills update
This pulls the latest version from the OpenCal skill repo. Run npx skills check to see if an update is available.