✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: March 19, 2026
  • 6 min read

Cook Language: Unlocking Advanced Bot Development on UBOS

The Cook language is a lightweight, AI‑driven scripting language that lets developers orchestrate large‑language‑model (LLM) agents with loop, composition, and resolver operators, all while running in configurable sandbox modes.

Introduction to the Cook Language

First announced earlier this year, the Cook language was built to fill a gap in the AI‑automation ecosystem: a concise, human‑readable syntax that can describe multi‑step LLM workflows without writing boilerplate code. It targets developers, programmers, and tech enthusiasts who want to prototype AI‑centric pipelines quickly, whether they are building a chatbot, an automated code reviewer, or a data‑extraction bot.

Because Cook is designed to be platform‑agnostic, it integrates seamlessly with modern AI platforms such as UBOS platform overview, allowing you to leverage existing infrastructure for model hosting, logging, and deployment.

Core Primitives and Syntax Overview

At its heart, Cook parses three categories of tokens:

  • Work token – the primary prompt that an LLM agent executes.
  • Loop operators – directives that repeat or evaluate the work token.
  • Composition operators – mechanisms for running parallel branches and merging results.

A minimal Cook script looks like this:

cook "Generate a product description" x3 review

In the example above, the cook keyword introduces the script, the quoted string is the work prompt, x3 repeats the work three times, and review adds a quality‑gate after each iteration.

Loop and Composition Operators Explained

Loop Operators

Loop operators let you repeat a work step or insert a review gate. The most common loops are:

Operator Purpose Example
xN Run the work prompt N times sequentially. cook "Add dark mode" x3
review Insert a quality‑gate that decides whether to continue or iterate. cook "Add dark mode" review
ralph Wrap a Cook script with an outer gate that advances a task list. cook "Work on next task" \ ralph

A typical loop chain might look like cook "Add dark mode" review x3, which means: run the work prompt, review the output, and repeat the whole cycle three times.

Composition Operators

Composition operators enable parallel exploration of multiple solutions. The language provides three main composition primitives:

  • vN / race N – launch N identical cooks in isolated git worktrees.
  • vs – run two distinct cooks side‑by‑side.
  • pick / merge / compare – resolvers that decide which result to keep.

Example of a parallel run with a resolver:

cook "Implement auth with JWT" v3 "least code wins"

Here, three independent attempts are made, and the pick resolver (the default) selects the implementation with the smallest code footprint.

Configuration Setup and Sandbox Modes

Before you can run a Cook script, you need a configuration scaffold. The command cook init creates a set of files in the project root:

  • COOK.md – human‑readable project instructions.
  • .cook/config.json – default agents, models, and sandbox preferences.
  • .cook/Dockerfile – Docker definition for isolated execution.
  • .cook/logs/ – session logs (git‑ignored).

A minimal .cook/config.json might look like:

{
  "agent": "claude",
  "sandbox": "agent",
  "steps": {
    "work": { "agent": "codex", "model": "gpt-5-codex" },
    "review": { "agent": "claude", "model": "opus" }
  },
  "env": ["CLAUDE_CODE_OAUTH_TOKEN"]
}

Two sandbox modes are supported:

  • Agent sandbox (default) – each LLM runs in its own OS‑level sandbox; no Docker required.
  • Docker sandbox – the entire Cook session runs inside a Docker container with restricted network access, ideal for compliance‑heavy environments.

If you need a fully managed environment, the Enterprise AI platform by UBOS offers Docker‑based sandboxing out of the box, plus monitoring and version control.

Resolver Definitions and Usage

After parallel branches finish, a resolver determines how to combine the results. UBOS provides three built‑in resolvers:

  1. pick – selects a single winner based on a user‑defined criterion (e.g., “least code wins”).
  2. merge – synthesizes all branches into a fresh implementation, useful for aggregating features.
  3. compare – writes a side‑by‑side comparison document without merging.

Example using the merge resolver with a custom criterion:

cook "Build landing page" v2 merge "best UI/UX"

The above script runs two independent builds, then merges them into a single page that scores highest on the “best UI/UX” metric.

Real‑World Example: Building an AI‑Powered Telegram Bot with Cook and UBOS

To illustrate the power of Cook, let’s create a simple Telegram bot that answers user questions using OpenAI’s ChatGPT. The workflow consists of three steps: fetch the message, generate a response, and send the reply.

First, we scaffold the project with cook init, then edit .cook/config.json to point the work step at the OpenAI ChatGPT integration and the review step at a custom quality‑gate that checks for profanity.

cook "Read incoming Telegram message" \
     review "Check for profanity" \
     x1 \
     "Generate answer with ChatGPT" \
     review "Validate answer length < 200 tokens" \
     v2 pick "most relevant"

The script does the following:

  • Reads a message via the Telegram integration on UBOS.
  • Runs a profanity filter (custom review step).
  • Calls the ChatGPT model (via the OpenAI integration).
  • Validates the answer length.
  • Executes two parallel generation attempts and picks the most relevant response.

Deploying this script is a one‑click operation from the Web app editor on UBOS. The editor automatically creates the Docker sandbox, injects the required API keys, and exposes the bot as a public endpoint.

Accelerate Development with UBOS Template Marketplace

If you prefer a head‑start, UBOS offers ready‑made Cook templates. For instance, the GPT-Powered Telegram Bot template already contains the loop and resolver logic demonstrated above. You can clone it, adjust the prompts, and launch in minutes.

Other useful templates for Cook‑centric projects include:

Cook language diagram

Conclusion & Call to Action

The Cook language brings a fresh, declarative approach to orchestrating LLM agents, making it easier for developers to prototype, test, and ship AI‑driven features. By leveraging UBOS’s pricing plans, you can start for free, scale with the UBOS partner program, and access the full suite of integrations and templates.

Ready to try Cook? Visit the UBOS homepage, spin up a sandbox, and experiment with the UBOS templates for quick start. Your next AI‑powered product could be just a Cook script away.

For the original announcement and technical deep‑dive, see the official Cook language news release.


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.