Skip to Content

gofasta status

Runs a set of offline, filesystem-only health checks that answer the question an AI agent asks most often: “is this project in a clean, up-to-date state?” Output is a structured report — one row per check — with details that tell the agent (or human) exactly what’s out of sync and which command brings it back.

Usage

gofasta status [flags]

Run this command from the root directory of your Gofasta project. Inherits the global --json flag for machine-parseable output.

Checks

#CheckWhat it reports
1Wire driftIs app/di/wire_gen.go older than any .go file in app/di/?
2Swagger driftIs docs/swagger.json older than any controller?
3Pending migrations (offline)Count of .up.sql files in db/migrations/
4Uncommitted generated filesDoes git think wire_gen.go, swagger.json, or generated resolvers differ from HEAD?
5go.sum freshnessDoes go mod verify succeed?

Checks that don’t apply to the current project (no Wire, no Swagger, no git) are reported as "skip" rather than failing.

Statuses

StatusMeaning
okCheck passed
driftDerived artifact is out of sync — run the remediation command shown in the message
warnSomething to be aware of (e.g. pending migrations exist) but not necessarily broken
skipCheck doesn’t apply to this project

Any check with status drift causes a non-zero exit so CI and agents can branch on success/failure.

Examples

Default text output:

$ gofasta status wire drift in sync swagger drift docs/swagger.json is stale run `gofasta swagger` ! pending migrations 3 migration(s) present run `gofasta migrate up` to apply (offline check) uncommitted generated files generated files committed go.sum freshness modules verified 4 ok · 1 drift · 1 warnings · 0 skipped · swagger drift: controllers newer than swagger.json: user.controller.go

Structured JSON:

$ gofasta status --json | jq '.checks[] | select(.status == "drift") | .message' "docs/swagger.json is stale — run `gofasta swagger`"

Output shape (JSON)

{ "checks": [ { "name": "wire drift", "status": "ok", "message": "in sync" }, { "name": "swagger drift", "status": "drift", "message": "docs/swagger.json is stale — run `gofasta swagger`", "detail": ["controllers newer than swagger.json: user.controller.go"] } ], "ok": 1, "drift": 1, "warnings": 0, "skipped": 0 }

Fields are stable API.

Why this exists

After any round of code generation or manual edits, several derived artifacts (Wire, Swagger) can drift from their inputs without any warning — the code still compiles, but routes go missing or DTOs become stale in the API docs. gofasta status surfaces every drift in one command so agents checking their own work get a structured report instead of running five separate checks.

Last updated on