✕

Quickstart

Install BAML, give your coding agent the BAML skill, and run your first function. It takes a few minutes on macOS, Linux, or Windows.

Set it up with your agent

Copy one prompt into Claude Code, Codex, or Cursor, and it runs the steps below for you.

Set up BAML in this repo so I can write great agent first code. Install the toolchain (pick one for this machine): - Homebrew (macOS/Linux): brew install baml - curl (macOS/Linux): curl -fsSL https://pkg.boundaryml.com/install.sh | sh -s - Arch: yay -S baml-bin - Windows: irm https://pkg.boundaryml.com/install.ps1 | iex Then set up the project: - baml init - baml agent install - baml run main If this repo already has an app in another language, wire up the bridge so it can call BAML directly. Run baml bridge add <target> once, then baml bridge generate whenever the .baml files change. The add command prints the host package to install. Targets: - Python: python/pydantic - TypeScript: typescript/node - TS / Web: typescript/web - Go: go (also pass --sdk-import-path <MODULE>/baml_sdk) - Rust: rust - Java: java - Kotlin: java (the Gradle plugin adds the Kotlin layer) - C#: csharp - C++: cpp - Swift: swift - Pydantic v1: python/pydantic/v1 If the repo is on GitHub, add the BAML code quality action so every pull request is checked, format-checked, and tested, with a comment comparing its code quality to the base branch. Add .github/workflows/baml.yml with a job that runs actions/checkout@v5 and then BoundaryML/baml-action@v1 on pull_request, with pull-requests: write permission for the comment. Details: https://github.com/BoundaryML/baml-action After that, use the BAML skill and baml describe to write and edit .baml files.

Or run the commands yourself

  1. Install the toolchain

    Pick the line for your machine.

    # macOS or Linux, with Homebrew

    brew install baml

    # macOS or Linux, with the install script

    curl -fsSL https://pkg.boundaryml.com/install.sh | sh -s

    # Arch Linux

    yay -S baml-bin

    # Windows, in PowerShell

    irm https://pkg.boundaryml.com/install.ps1 | iex

    Check that it worked:

    baml --version

  2. Start a project

    Run this from the repository where you want BAML. Namespaces follow the folders, so an agent can find its way around with ls.

    baml init

  3. Give your agent the BAML skill

    This installs a BAML skill for Claude Code, Codex, and other coding agents, matched to your toolchain’s version. With it, your agent reads code with baml describe, runs functions with baml run, and runs tests with baml test.

    baml agent install

  4. Run something

    Any BAML function runs from the command line, with its parameters as flags.

    # the default entry point

    baml run main

    # any function

    baml run greet -- --name "world"

    # an expression, without a file

    baml run -e '"a,b,c".split(",")'

  5. Set up your editor

    This step is optional. Agents work through the CLI, and the playground runs in a browser.

    # VS Code

    baml ide install --code

    # Cursor

    baml ide install --cursor

    # another VS Code-based editor: writes a .vsix here to install

    baml ide install --path .

    # Zed, JetBrains, Neovim, or any LSP client

    baml lsp

    # no editor at all

    baml playground

Install the BAML code quality action

BoundaryML/baml-action checks, format-checks, and tests your project on each pull request, then comments with how its code quality compares to the base branch.

# .github/workflows/baml.yml
name: BAML
on: [pull_request]
permissions:
  contents: read
  pull-requests: write # for the code health comment
jobs:
  baml:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: BoundaryML/baml-action@v1
A baml-action comment on a pull request. One function, shipping_cost, got better: cognitive complexity went from 12 to 0, cyclomatic from 8 to 1, NPath from 36 to 1, and nesting from 3 to 0.

Run it in production

Boundary’s cloud traces every BAML call and adds dashboards, alerts, and experiments on top. It’s in early access, so get on a call with the founders and we’ll set it up with you.

Questions or feedback?

Join the BAML Discord. We're around to help you get set up, and we read every bit of feedback.

Handy links

Keeping BAML updated

The baml command is a version manager, so it rarely needs updating. Update it with your package manager (brew upgrade baml) or with baml self-update. If you change your project’s toolchain version, run baml agent install again when the CLI asks. If something doesn’t work, tell us on Discord.