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 — the recipes on it, and the ingredients to buy, as HA To-do lists; tick ingredients off in either place
- Export to HA's Shopping List — one button copies the ingredients into any HA to-do list
- 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 | Recipes on the shopping list, with delete support |
todo.cookcli_shopping_ingredients |
Todo | Ingredients to buy for those recipes (pantry already subtracted); ticking one off ticks it off in CookCLI |
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_listCopy the ingredients still to buy into another to-do list — for example Home Assistant's own Shopping List. Ingredients already ticked off in CookCLI, and ones already on the target list and not yet bought, are left out, so running it twice doesn't add everything twice. Optional ingredients are only included once you've chosen them in CookCLI.
service: cookcli.export_shopping_list
data:
entity_id: todo.shopping_list
include_quantities: true # "pasta (400 g)" rather than "pasta"A dashboard button for it:
type: button
name: Send to shopping list
icon: mdi:cart-arrow-right
tap_action:
action: perform-action
perform_action: cookcli.export_shopping_list
data:
entity_id: todo.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(builds the ingredient list)POST /api/shopping_list/check,POST /api/shopping_list/uncheckPOST /api/shopping_list/addPOST /api/shopping_list/removePOST /api/shopping_list/clearGET /api/search?q=term