Configuration


Use a .gluerc file to set defaults and per-target overrides for code generation.

#Supported config files

Glue auto-detects these files next to your input file:

  • .gluerc (YAML)
  • .gluerc.yaml
  • .gluerc.yml
  • .gluerc.json

If no config file is found, Glue uses built-in defaults.

To use a specific config file:

shell

#How the config is structured

  • global: defaults applied to every generation entry.
  • gen: a list of per-input rules (mode, files) with optional output and overrides. files can be a single glob string or a list of glob strings.

#JSON schema

Glue ships a JSON schema for config files at glue/assets/config_schema.json. Use it with VS Code's YAML support to get autocomplete and validation in .gluerc.yaml files.

#Example

yaml

#Notes

  • Run glue gen to use an auto-discovered config file, or glue gen --config path/to/.gluerc.yaml to use one explicitly.
  • output supports {file_name} and {file_ext} placeholders.
  • watermark supports full, short, or none.
  • global.diagnostics.suppress_warnings suppresses source diagnostics for both glue check and glue gen. Currently supported warning codes: constant_case.
  • preserve_generated_identifiers keeps user-provided identifiers exactly as written, such as model names and fields. Glue may still normalize identifiers it synthesizes from values, such as enum variant constants.
  • python.data_model_library supports pydantic, dataclasses, attrs, or msgspec.
  • rust.serde_struct_derives controls serde derives and serde attributes on generated Rust structs, enums, union enums, and type alias newtypes.
  • rust.extra_derives appends additional Rust derive paths by generated shape: structs, enums, unions, or type_aliases.