Getting Started
Foodlang is a lightweight, open profile for writing recipes that both cooks and machines can understand. It has two layers (plus a normalized AST):
.food = fun human authoring format
.food.yaml = official ORF-compatible structured output
.food.json = normalized compiler AST
The cute .food format is for writing by hand; the official .food.yaml
format is an ordinary
Open Recipe Format-style YAML file
with optional X-Phases / X-foodlang blocks that add the automation metadata
needed to run a recipe. The compiler translates between them — see
The .food format.
Your recipes stay plain .food.yaml text files you own forever: store them,
edit them, diff them in Git, and sync them across devices without being locked
into any app.
Here's what a basic Foodlang recipe looks like:
recipe_name: Simple Latte
ingredients:
- coffee grounds:
amounts:
- amount: 18
unit: g
processing: [ground]
- milk:
amounts:
- amount: 220
unit: mL
steps:
- step: Grind the coffee and brew a double espresso.
- step: Steam the milk and pour it over the espresso.
X-foodlang:
version: 0.1
transformations:
- id: extract_espresso
type: extraction
inputs:
- { ingredient: coffee grounds, state: ground }
- { ingredient: water, state: hot }
outputs:
- { ingredient: espresso, state: brewed }
The top half is a perfectly normal recipe. The X-foodlang block adds the
transformation layer — coffee grounds + hot water -> espresso — that makes
the recipe executable.
The 3-minute taste of the whole ecosystem
The fastest way to feel what Foodlang is about.
1. Try the Playground — write a recipe and watch it compile to Schema.org, Cooklang, a robot action graph, PDDL, and more, entirely in your browser. No install. → Open the Playground
2. Install the CLI — validate, inspect, and compile .food.yaml files from
your terminal. → CLI: Getting Started
3. Read the Spec — the full format in one page. → Specification
Install & build
pnpm install
pnpm build
pnpm test
Validate a recipe
pnpm foodlang validate examples/simple-latte.food.yaml
Validation: PASS
Levels:
readable: pass
parseable: pass
structured_ingredients: pass
process_aware: pass
appliance_mappable: pass
robot_plannable: pass
industrial_mappable: partial
Compile to any target
pnpm foodlang compile examples/simple-latte.food.yaml --target schema-org
pnpm foodlang compile examples/simple-latte.food.yaml --target cooklang
pnpm foodlang compile examples/simple-latte.food.yaml --target robot-action-graph
Use the library
import { parseFoodRecipe, validateFoodRecipe } from "@foodlang/core";
import { compileToString } from "@foodlang/compiler";
const recipe = parseFoodRecipe(yamlString);
const result = validateFoodRecipe(recipe);
const jsonld = compileToString(recipe, "schema-org");
What's next?
- Learn the full format in the Specification.
- See every output format in Compiler Targets.
- Understand the honesty model in Validation Levels.
- Explore real recipes in Examples.