Theme
Python packageSupported stable generatorAvailable now

Infer a normalized generation model from OpenAPI and apply bundled or project-owned Jinja template packs.

python -m pip install codepotg
On this page

Codepotg.yaml configuration

CodepotG discovers one of these files in the current working directory:

If both exist, the command fails and asks for one explicit config. An explicit path can be passed with --config.

Root shape

allow

allow must be exactly true before generation can mutate the project or run commands.

Missing, false, or non-boolean values do not grant permission.

defaults

defaults is an optional object merged into every task before task-specific values are validated.

Task fields override defaults at the top level. Nested objects are not deep-merged unless their owning field explicitly implements that behavior.

tasks

tasks must be a non-empty mapping. The mapping key is the task name.

Required task fields

FieldTypeMeaning
inputpath stringOpenAPI JSON or YAML source
languagestringBundled or registered language adapter
outputpath stringTask output root

Relative paths resolve from the configuration directory.

Optional task fields

FieldTypeMeaning
templateDirpath stringProject-owned template pack
templatespath stringCompatibility alias for templateDir
cleanpath listPaths eligible for explicit refresh cleanup
beforecommand listCommands before rendering/writes
aftercommand listCommands after successful generation
envstring mapEnvironment values for task and commands
descriptionstringHuman-readable task purpose
frontendstringSelected authored frontend, or * where supported

Commands

A command can be a string:

or an object:

Command fields:

FieldMeaning
nameOptional display name
runRequired shell command
cwdOptional working directory relative to config
optionalContinue when this command fails
envCommand-specific environment values

Review commands as executable project code. Dry runs and --skip-before/--skip-after prevent their execution.

Frontend selection

The name must refer to explicitly authored frontend metadata in the normalized contract.

Use * only when the task intentionally exposes all authored frontends.

Multiple tasks

Run one task by name or all tasks in file order.

Legacy filename rejection

CodepotFile.yml and CodepotFile.yaml are reserved for the TypeScript runtime. CodepotG reports a clear configuration error rather than guessing which engine should run the file.