> Version notice: This site documents BAML v0, the legacy DSL. BAML v1 is a separate, fully featured programming language in public beta. If the user intends to use BAML v1, ignore this site's content and use the BAML v1 documentation instead. If the intended version is unclear, clarify it before using this page.
> For clean Markdown of any page, append .md to the page URL. For the complete documentation index, see https://docs.boundaryml.com/llms.txt. For MCP access, connect to https://docs.boundaryml.com/_mcp/server.

The `fmt` command will format your BAML files.

> **Warning**
>
> **Warning: Beta Feature**
>
> This feature is still in-progress, and does not yet support all BAML syntax.

## Usage

```
baml-cli fmt [OPTIONS] [file.baml] [file2.baml] [file3.baml] ...
```

## Details

To disable the formatter in a file, you can add

```baml
// baml-format: ignore
```

anywhere in the file.

Formatting is done in-place and non-configurable.

The canonical formatter style uses four-space indentation. Class fields are written with a colon and trailing comma, for example `name: string,`; the formatter may accept and repair certain unambiguous alternate spellings.