Report Command
February 25, 2026 ยท View on GitHub
Generate custom reports from recipes using templates.
Note: The report command is currently a prototype feature.
Usage
cook report [OPTIONS] --template <TEMPLATE> <RECIPE>
Arguments
| Argument | Description |
|---|---|
<RECIPE> | Recipe file to process. Supports scaling with :N syntax (e.g., recipe.cook:2). |
Options
| Option | Description |
|---|---|
-t, --template <FILE> | Path to the Jinja2 template file (required) |
-d, --datastore <DIR> | Path to datastore directory with additional recipe data (nutrition, costs) |
-a, --aisle <FILE> | Path to aisle configuration file |
-p, --pantry <FILE> | Path to pantry configuration file |
-b, --base-path <PATH> | Base path for resolving recipe references (default: current directory) |
Template Variables
Templates receive recipe data including:
{{ metadata.servings }}
{% for ingredient in ingredients %}
{{ ingredient.name }}: {{ ingredient.quantity }}
{% endfor %}
{% for section in sections %}
{% for content in section %}
{{ content }}
{% endfor %}
{% endfor %}
Aisle and pantry helpers are available when configs are provided:
{# Group by aisle #}
{% for aisle, items in aisled(ingredients) | items %}
{{ aisle }}: {% for i in items %}{{ i.name }}{% endfor %}
{% endfor %}
{# Exclude pantry items #}
{% for aisle, items in aisled(excluding_pantry(ingredients)) | items %}
{{ aisle }}: {% for i in items %}{{ i.name }}{% endfor %}
{% endfor %}
Examples
# Generate a recipe card
cook report -t reports/recipe-card.md.jinja "Neapolitan Pizza"
# With scaling and all configs
cook report -t reports/cost.md.jinja "Easy Pancakes:2" \
-d ./db -a ./config/aisle.conf -p ./config/pantry.conf
# Output to file
cook report -t card.jinja recipe.cook > recipe-card.md
More template examples: cooklang-reports