Getting Started

Cooklang is a lightweight, open-source format for writing and managing recipes in a structured, human-readable way. Your recipes are just text files, meaning you can store, edit, share and sync them across all your devices without being locked into a specific app or service.

How It Works

Cooklang recipes are plain text files that you can use on any device. You can write and manage them on a desktop, then access them on your phone when cooking. This flexibility makes it easy to grow your recipe collection over time. Recipes are stored in .cook files, and Cooklang tools help process these files for various use cases such as meal planning, shopping and cooking.

A Simple Example

Here's what a basic recipe looks like in Cooklang:

Crack the @eggs{3} into a #blender, then add the @plain flour{125%g},
@milk{250%ml} and @sea salt{1%pinch}, and blitz until smooth.

When processed using apps, this recipe will extract ingredients while keeping the instructions readable.

Android Screens

1. Setting Up on Desktop

To get the best experience with Cooklang on desktop, consider setting up:

Syntax Highlighting

If you prefer writing recipes in a text editor, enabling syntax highlighting for Cooklang makes editing easier. Many editors support custom syntax highlighting:

Sublime Screen

(Optional) Obsidian plugin

As an option you can manage your recipes along with your notes in Obsidian with Cooklang Editor plugin.

Desktop App for Syncing Recipes (optional, only for Android)

The Cook Desktop App is an agent for syncing your recipes across devices.

Download the desktop app from the official website.

Cook Desktop Screen

It will ask you to select folder where you store recipes and sign in/sign up.

2. Setting Up on Mobile

Getting started on mobile is simple:

  • Download the Cooklang App from the Google Play Store or Apple App Store.
  • Open the app, and sign in if you're using a sync service on Android or it will use iCloud on iOS. If you're using iOS app it will create a folder in iCloud drive called CooklangApp where it expects to see recipes. In the future version we will add support for Cook Desktop App as well and then you can use any folder on your computer.
  • Access your saved recipes, and generate shopping lists on the go.

3. Growing Your Recipe Collection

Once you're set up, it's time to expand your collection:

Build Your Recipe Collection

Start writing your own recipes or importing from existing sources. The best practice is to keep recipes organized by folders (e.g., breakfast/, dinner/, desserts/). You can use multiple nested folders if you have many recipes.

If you want to save a random recipe from a webpage in Cooklang format, simply add cook.md/ before the full URL in your browser's address bar (e.g., https://cook.md/https://bbcgoodfood.com/recipes/easy-pancakes/).

Cook.md Demo

Use the playground to test syntax interactively

If you have some problems and your recipe doesn't render as you want, you can checkout Playground.

Cooklang Parser Playground

Be part of the community

Find curated Cooklang recipes from the community, share your thoughts or ask for help. Some resources include:

Configure aisle.conf for Shopping Convenience

Add config/aisle.conf into your recipes folder to categorize ingredients by shopping aisle, making grocery shopping more efficient.

[produce]
potatoes

[dairy]
milk
butter

4. Command-Line Interface (CookCLI)

CookCLI is a powerful command-line tool that brings automation and advanced functionality to your recipe workflow. It follows UNIX philosophy - each command does one thing well and can be combined with other tools.

Installation

Download Pre-built Binaries (Recommended):

Download the latest release for your platform from GitHub Releases:

# macOS (Apple Silicon)
wget https://github.com/cooklang/cookcli/releases/latest/download/cook-aarch64-apple-darwin.tar.gz
tar -xzf cook-aarch64-apple-darwin.tar.gz
sudo mv cook /usr/local/bin/

# macOS (Intel)
wget https://github.com/cooklang/cookcli/releases/latest/download/cook-x86_64-apple-darwin.tar.gz
tar -xzf cook-x86_64-apple-darwin.tar.gz
sudo mv cook /usr/local/bin/

# Linux (x86_64)
wget https://github.com/cooklang/cookcli/releases/latest/download/cook-x86_64-unknown-linux-gnu.tar.gz
tar -xzf cook-x86_64-unknown-linux-gnu.tar.gz
sudo mv cook /usr/local/bin/

# Windows (x86_64)
# Download cook-x86_64-pc-windows-msvc.zip from releases page
# Extract and add to PATH

macOS (Homebrew):

brew install cookcli

Build from Source:

git clone https://github.com/cooklang/cookcli.git
cd cookcli
cargo build --release
sudo cp target/release/cook /usr/local/bin/

Core Commands

CookCLI provides a comprehensive set of commands for managing your recipes:

Recipe Management

  • cook recipe - Parse and display recipe files in various formats (human-readable, JSON, YAML)
  • cook doctor - Validate recipes and check for syntax errors
  • cook search - Search through recipes by ingredient or text
  • cook import - Import recipes from websites and convert to Cooklang

Meal Planning & Shopping

  • cook shopping-list - Generate shopping lists from multiple recipes with scaling support
  • cook pantry - Track your pantry inventory, find what's low on stock or expiring
    • pantry depleted - Show items that need restocking
    • pantry expiring - Find items expiring soon
    • pantry recipes - Discover what you can cook with available ingredients

Visualization & Sharing

  • cook server - Launch a web server to browse your recipe collection visually
  • cook report - Generate custom reports using templates (PDFs, summaries, meal plans)

Getting Started

  • cook seed - Initialize a directory with example recipes
  • cook update - Update CookCLI to the latest version

Quick Examples

# Start with sample recipes
cook seed

# View a recipe
cook recipe "Neapolitan Pizza.cook"

# Scale a recipe to serve 6
cook recipe "Pasta.cook:3"

# Create a shopping list for the week
cook shopping-list "Monday Dinner.cook" "Tuesday Lunch.cook:2"

# Check what's low in your pantry
cook pantry depleted

# Find recipes you can make right now
cook pantry recipes

# Search for all chicken recipes
cook search chicken

# Start the web interface
cook server

Integration with UNIX Tools

CookCLI outputs can be piped and processed with standard tools:

# Export recipe to JSON for processing
cook recipe "Pizza.cook" -f json | jq '.ingredients'

# Find top 5 most used ingredients
cook search --all | grep "@" | sort | uniq -c | sort -rn | head -5

# Create shopping list for all pasta recipes
cook shopping-list $(ls *Pasta*.cook)

Advanced Workflow Automation

Cooklang provides automation tools that can streamline your recipe management. Explore the full CLI documentation for more ideas. There's also a community alternative cooklang-chef.

What's Next?

  • Dive into the Cooklang ecosystem and experiment with writing recipes in Cooklang.
  • Check out the best practices guide.
  • Share ideas, ask for help, or contribute to Cooklang's development.
  • Open an issue in the Cooklang GitHub repository.
  • Participate in voting for the next feature.
  • Spread the word.
  • Subscribe to the newsletter or follow on social media.

Now you're all set! Start writing, cooking, and enjoying the simplicity of Cooklang. For more details, visit the official documentation.