Code Generators

Every generator produces a single, self-contained file your agent can drop into the project. No dependency resolution. No configuration. Just working code that the compiler can verify against your implementation.

Design Principles

  • Single file — One fully contained, fully functional file per generator. Drop it in and go.
  • Minimal dependencies — Uses native framework dependencies. No extra libraries to manage.
  • Readable output — Generated code you'd be proud to commit. Indistinguishable from hand-written.

Available Generators

T TypeScript

GeneratorKeyDescription
TypeScripttypescriptFull client SDK with type definitions, API client, and error types

S Scala (Play Framework)

GeneratorKeyDescription
Play Modelbryzek_play_modelCase classes, enums, and JSON serialization
Play Clientbryzek_play_clientType-safe HTTP client with models
Play Controllerbryzek_play_controllerAbstract controller traits for server implementation
Play Routesbryzek_play_routesPlay routes file entries for each operation
Play Mock Modelbryzek_play_mock_modelFactory methods for generating test data
Play Mock Clientbryzek_play_mock_clientMock client for testing without HTTP

E Elm

GeneratorKeyDescription
Elmelm_v2Fully typed models, decoders, encoders, and HTTP operations

PostgreSQL

GeneratorKeyDescription
Scala DAOpsql_scalaScala DAO classes with type-safe queries and CRUD operations
DDLpsql_ddlPostgreSQL table definitions, indexes, and constraints

Using Generators in .api/config

Reference generators by their key in your .api/config file, mapping each to the output directory where generated files should be written:

myorg:
  - generators:
      typescript: ./src/generated
    applications:
      my-api:

  - generators:
      bryzek_play_model: generated/app/apibuilder
      bryzek_play_client: generated/app/apibuilder
      bryzek_play_mock_client: generated/test/apibuilder
      bryzek_play_controller: generated/app/apibuilder
      bryzek_play_routes: conf
    applications:
      my-api:

Ready to generate code?

Getting Started