Report

Generate custom reports from recipes using templates.

Note: The report command is currently a prototype feature.

Usage

cook report [OPTIONS] --template <TEMPLATE> <RECIPE>

Arguments

ArgumentDescription
<RECIPE>Recipe file to process. Supports scaling with :N syntax (e.g., recipe.cook:2).

Options

OptionDescription
-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 &#34;Neapolitan Pizza&#34;

# With scaling and all configs
cook report -t reports/cost.md.jinja &#34;Easy Pancakes:2&#34; \
  -d ./db -a ./config/aisle.conf -p ./config/pantry.conf

# Output to file
cook report -t card.jinja recipe.cook &gt; recipe-card.md

More template examples: cooklang-reports