Getting Started with CKL

What is CKL?

CKL (Culinary Knowledge Language) is a precise notation for writing cooking recipes. It captures three things that natural language recipes usually leave vague:

1. What you need — ingredients with exact quantities, equipment with sizes

2. What you do — actions in sequence with measurable temperatures and times

3. What must be true — safety requirements that are checked automatically

If you've ever followed a recipe that said "cook until done" and wondered what that meant, CKL exists to solve that problem.

Reading a CKL Recipe

Before you write anything, learn to read. Here's a simple recipe:

servings 2

ingredient "eggs" 4g
ingredient "butter" 10g
ingredient "salt" 1g

pan "nonstick pan" 20cm

heat pan to 120C
apply "butter" to pan
wait 1min
apply "eggs" to pan
wait 3min
apply "salt" to pan
rest 1min

Reading from top to bottom:

  • servings 2 — this recipe makes 2 portions
  • ingredient "eggs" 4g — you need 4g of eggs (each ingredient is declared with an exact amount)
  • pan "nonstick pan" 20cm — you need a 20cm nonstick pan (equipment is declared before use)
  • heat pan to 120C — set the pan to 120°C
  • apply "butter" to pan — add the butter to the pan
  • wait 1min — wait 1 minute
  • rest 1min — let the dish rest for 1 minute

Every line is either a declaration (what you need) or an action (what you do). There are no vague words.

Setting Up the Project

To write and validate your own CKL recipes, set up the toolchain:

# Clone the repository
git clone https://github.com/aedeny/the-cook-book.git
cd the-cook-book

# Install dependencies
pnpm install

# Build the toolchain
pnpm build

Writing Your First Recipe

Create a file called my-recipe.ckl.md in the recipes/ directory:

servings 4

ingredient "chicken breast" 500g
ingredient "olive oil" 30ml
ingredient "salt" 5g

pan "skillet" 30cm

heat pan to 180C
apply "olive oil" to pan
apply "chicken breast" to pan
wait 6min
until internal_temp >= 74C
rest 5min

Notice the line until internal_temp >= 74C. This is a safety rule — chicken must reach 74°C internal temperature before it's safe to eat. If you wrote until internal_temp >= 60C, the validator would catch it as an error.

Validating Your Recipe

# Check syntax and safety rules
ckl check my-recipe.ckl.md

# Check best practices
ckl lint my-recipe.ckl.md

# View the recipe structure
ckl ast my-recipe.ckl.md

If the recipe is valid, you'll see no errors. If something is wrong — an undeclared ingredient, an unsafe temperature, equipment used before being declared — you'll get a clear error message with the line number.

Generating the Site

Once your recipes are valid, generate the interactive site:

ckl docs

This creates HTML pages in the site/ directory with step-by-step instructions, timers for timed steps, links between recipes and techniques, and ingredient cross-references.

Next Steps