Generator

Scaffold plain Go from a declaration

When you want a head start, generate the code. It writes plain Go to disk — you own it, read it, and edit it. One shot: nothing to keep regenerating against.

code generationSDKscustomer CLIblueprints

Code generation

gofastr generate turns a declaration into Go on disk. Config-driven generators write under gen/; every run is reproducible, and --dry-run shows you the plan first.

5 lines
# preview without writinggofastr generate --config gofastr.codegen.yml --dry-run --json# write the generated Gogofastr generate --config gofastr.codegen.yml
/docs/codegen →

SDKs

Generate a client for your API: a standalone Go module and a JS/TS ESM client. The app can host them behind a live docs page for your customers.

1 lines
gofastr generate sdk --target=go,js --out=gen/sdk
/docs/sdk →

Customer CLI

Generate a branded terminal client for your API, with scoped API-token auth. Your customers get a real CLI; you own the generated code under cmd/.

4 lines
gofastr generate cli --binary=meridian --only=customers,invoices# customers sign in with a scoped token, read from stdinecho "$TOKEN" | ./meridian login --url https://app.example.com --with-token
/docs/app-cli →

Blueprints

A gofastr.yml is a bundle of entities and screens. gofastr generate --from=gofastr.yml writes the app as plain package main to your module root — a one-shot scaffold you then own, not a tree you keep regenerating.

gofastr.yml
10 lines
entities:  - name: plans    crud: true    fields:      - name: name        type: string        required: true      - name: slug        type: string        unique: true
/docs/blueprints →