> ## Documentation Index
> Fetch the complete documentation index at: https://buildcharts.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate

> What buildcharts generate does and the files it produces.

`buildcharts generate` is the core step that turns repository metadata into an executable Docker Buildx Bake plan.

## What it reads

During generation, BuildCharts reads:

* `build.yml`
* `charts/buildcharts/Chart.yaml`
* `charts/buildcharts/Chart.lock` if it exists

## What it validates

Before writing output, BuildCharts validates:

* There is exactly one `build` target
* Every target `type` matches a chart alias from `Chart.yaml`

When `Chart.lock` exists and `--ignore-lock` is not set, `buildcharts generate` checks:

* Missing lock entries
* Version mismatches between `Chart.yaml` and `Chart.lock`
* Orphaned lock entries
* Registry digest mismatches during pull

If the lock file is out of sync, BuildCharts stops and tells you to refresh it. See [Lock files](/core-features/lock-files).

## What it does

1. Removes the previous `.buildcharts` folder.
2. Pulls chart artifacts into `.buildcharts`.
3. Runs configured plugins.
4. Writes `.buildcharts/docker-bake.hcl`.

<Tip>
  `build.yml` currently targets Docker Bake HCL through a dedicated generator. Since the interface is intentionally minimal, future work may add more generators. You can also clone the project and build your own.
</Tip>

## Usage

The generated Bake file lives here:

```text theme={"theme":{"light":"plastic","dark":"plastic"}}
.buildcharts/docker-bake.hcl
```

Run it with:

```bash theme={"theme":{"light":"plastic","dark":"plastic"}}
buildcharts generate
docker buildx bake --file .buildcharts/docker-bake.hcl
```

## Related pages

* [Command-line interface](/cli)
* [Lock files](/core-features/lock-files)
* [Metadata (`build.yml`)](/core-features/metadata)
