Project settings
gofastr.settings.yml is the one committed file that configures the
gofastr tools for a project. It sits at the project root, beside go.mod,
and holds one top-level section per reader:
version: 1 codegen: # gofastr generate and gofastr build output: gen generators: - name: sdk output: sdk endpoints: # custom entity routes with typed handlers - name: refund_order entity: orders method: POST path: "{id}/refund" handler: entities/refunds.go#RefundOrder contracts: # gofastr verify performance: warn rules: GOFASTR1003: exempt: ["cmd/**"] isolation: # the running app and gofastr dev enabled: true mode: worktree unmounted: # written by gofastr unmount and gofastr remount - source: "github.com/DonaldMurillo/gofastr/battery/auth" version: "v0.92.0" path: "unmounted/battery/auth" date: "2026-10-19"
| Section | Read by | Reference |
|---|---|---|
codegen | gofastr generate, gofastr build, gofastr generate --watch | Codegen |
endpoints | gofastr generate, gofastr build, gofastr generate --watch, gofastr pack; gofastr generate app writes it from an app spec | Custom endpoints |
contracts | gofastr verify, gofastr build, gofastr dev, the MCP contracts tools | Contracts |
isolation | framework/isolation: App.Start, gofastr dev, generated main.go | Worktree isolation |
unmounted | gofastr unmount, gofastr remount, gofastr verify, gofastr upgrade, gofastr audit deps | Unmounting a package |
Every section is optional. gofastr init writes the file with an
isolation section.
How the file is found
Each reader looks for gofastr.settings.yml in the directory it starts
from and in each parent up to the project root: the first directory that
holds go.work, go.mod or .git. It never looks past that root. A
settings file can name a command that gofastr generate runs, so one
planted in a shared parent (a workspace directory, /tmp, $HOME) must
never apply to the project below it. With no root marker anywhere above
the start directory, only the start directory is searched.
gofastr generate --config=<file> and gofastr verify --config <file>
name a settings file directly instead.
What is an error
- A top-level key other than
version,codegen,endpoints,contracts,isolationorunmounted. - A
versionother than1. - A file the settings file replaced, found where the reader looks for
settings:
gofastr.codegen.yml,gofastr.contracts.ymlorgofastr.isolation.yml(or their.yamlspellings). The reader of that section refuses to run and names the section to move the content into, so a relaxation or a disabled setting never drops away unnoticed.
The app spec (gofastr.yml) describes the app, not the tools. A codegen:,
contracts: or isolation: key in it is an error that points here.
The unmounted section
gofastr unmount and gofastr remount own this section and rewrite it
whole; the rest of the file keeps its bytes and comments. Its generated
header is replaced with the section for both LF and CRLF line endings,
and removed with the last entry. Each entry has
exactly four string fields:
source: the import path the copy came from.version: the gofastr release copied, ordevfor a copy of a local checkout. Letters, digits,.,-and+only.path: the copy's directory, slash-separated and relative to the settings file. It may not climb out with..or sit inside avendordirectory.date: the day of the copy,YYYY-MM-DD.
An unknown key, a missing field, a value outside those shapes or a path
listed twice is an error. One source may have several entries, one per
copy (generate package copies a chrome package once per binary).
Removing the last entry removes the section, and the file too when
nothing else is left in it. The section's key must be a plain
unmounted: at the start of a line, and the file a real file, not a
symlink: the commands refuse to rewrite anything else.
Moving from the separate files
Each old file already had the section shape, so the move is a copy:
- Copy the
codegen:block ofgofastr.codegen.yml, thecontracts:block ofgofastr.contracts.ymland theisolation:block ofgofastr.isolation.ymlintogofastr.settings.yml. A contracts file written without thecontracts:wrapper needs one added and its body indented under it. - Move any
codegen:,contracts:orisolation:section out ofgofastr.yml. - Delete the old files.
gofastr upgrade reports each old file it finds.
Common mistakes
- Putting
gofastr.settings.ymlin a subdirectory of a module and running the tool from the module root. The lookup walks up from the start directory, never down: keep the file besidego.mod. - Copying a contracts file that had no
contracts:wrapper (its keys, such asrules:, at the top level) straight into the settings file. Those keys are unknown sections there; indent them undercontracts:. - Keeping a
codegen:orisolation:section ingofastr.yml. The app spec refuses it; move it into the settings file.