A Home Assistant custom component for CookCLI — the command-line tool for managing Cooklang recipes.
Browse recipes, track your pantry, manage shopping lists, and plan meals — all from your Home Assistant dashboard.
- Meal Plan Calendar —
.menufiles mapped to HA calendar events with per-meal times - Shopping List — synced as an HA Todo entity
- Pantry Alerts — sensors for expiring and depleted items
- Recipe Stats — total recipe and menu counts
- Services — search recipes, add to shopping list from automations
- Home Assistant 2024.1+
- CookCLI server running (
cook server ./recipes)
- Open HACS in Home Assistant
- Click the three dots menu → Custom repositories
- Add
https://github.com/cooklang/homeassistant-cookclias an Integration - Search for "CookCLI" and install
- Restart Home Assistant
Copy custom_components/cookcli/ to your Home Assistant config/custom_components/ directory and restart.
- Go to Settings → Devices & Services → Add Integration
- Search for CookCLI
- Enter your CookCLI server URL (default:
http://localhost:9080) - Optionally set an active menu plan file for calendar integration
| Entity | Type | Description |
|---|---|---|
sensor.cookcli_recipes |
Sensor | Total recipe count (menu count as attribute) |
sensor.cookcli_pantry_expiring |
Sensor | Number of items expiring within 7 days |
sensor.cookcli_pantry_depleted |
Sensor | Number of low-stock items |
todo.cookcli_shopping_list |
Todo | Shopping list with delete support |
calendar.cookcli_meal_plan |
Calendar | Meal plan from active .menu file |
The calendar entity reads .menu files. Sections with dates in parentheses are mapped to calendar days:
---
servings: 2
---
== Monday (2026-03-09) ==
Breakfast (08:00): \
- @./Breakfast/Easy Pancakes{10%servings}
Dinner: \
- @./Neapolitan Pizza{}
== Wednesday (2026-03-11) ==
Lunch (12:30): \
- @./Sicilian-style Scottadito Lamb Chops{}
Snack: \
- @crackers{1%box} with @hummus{1%cup}
== Extras ==
- @soy sauce{1%tbsp}
- Section dates extracted via regex from
== Name (YYYY-MM-DD) == - Meal times extracted from headers like
Breakfast (08:30): - Default times when not specified: Breakfast 07:00, Lunch 12:00, Dinner 18:00, Snack 15:00
- Sections without dates (like
== Extras ==) are ignored for calendar but included in shopping lists
Search recipes by keyword. Returns results as a response variable.
service: cookcli.search_recipe
data:
query: "pasta"Add a recipe to the shopping list with optional scaling.
service: cookcli.add_recipe_to_shopping_list
data:
recipe: "Neapolitan Pizza.cook"
scale: 2Remove all items from the shopping list.
service: cookcli.clear_shopping_listMorning meal notification:
automation:
- alias: "Morning Meal Brief"
trigger:
- platform: time
at: "07:00:00"
action:
- service: notify.mobile_app
data:
title: "Today's Meals"
message: "Check your CookCLI meal plan"Pantry expiration alert:
automation:
- alias: "Pantry Expiration Warning"
trigger:
- platform: numeric_state
entity_id: sensor.cookcli_pantry_expiring
above: 0
action:
- service: notify.mobile_app
data:
title: "Pantry Alert"
message: >
{{ state_attr('sensor.cookcli_pantry_expiring', 'items') | length }}
items expiring soonThe integration polls CookCLI's REST API every 5 minutes via a DataUpdateCoordinator. The CookCLI server needs these API endpoints (available in CookCLI 0.25+):
GET /api/statsGET /api/menusGET /api/menus/{path}GET /api/pantry/expiring?days=NGET /api/pantry/depletedGET /api/shopping_list/itemsPOST /api/shopping_list/addPOST /api/shopping_list/removePOST /api/shopping_list/clearGET /api/search?q=term