Expand description
Typed reports and the output contract shared by the text and JSON renderers.
The layers are separate on purpose:
- Builders (
build) are pure: they read the app, the registered models and the settings and return typed reports. They open no database connection and print nothing. - Renderers (
text,json) turn a report into a string. No renderer parses another renderer’s output.
Every report travels in an Envelope whose schema_version only
changes for breaking changes; new fields are additive. The JSON Schema
is docs/schemas/cli-report-v1.json.
Exit codes are 0 (success), 1 (failure, including a check that
found an error) and 2 (usage error); see EXIT_OK.
Modules§
- build
- Pure report builders. They read compiled metadata only: no database connection is opened and nothing is printed.
- channel
- Where JSON reports go, and the envelope of a command that failed before it could produce its report.
- json
- The JSON renderer.
- snapshot
- A bounded, versioned snapshot of an application’s metadata: the framework version, compiled features, database aliases with their backend kinds, registered models, documented routes and the OpenAPI document.
- text
- Text renderers. They reproduce the historical terminal output of
checkandroutesbyte for byte.
Structs§
- Check
Summary - Summary of a
checkrun (thedataof its envelope). - Diagnostic
- One finding.
- Envelope
- The versioned wrapper around every structured report.
- Field
Report - One column of a registered model.
- Migration
Report - One migration in a
showmigrationsreport. - Migration
Status Data - The
dataof ashowmigrationsenvelope: the same rows, in the same order, as the text output. - Model
Report - One registered model.
- Models
Data - The
dataof a models report, sorted by name then table. - Route
Report - One documented route.
- Routes
Data - The
dataof aroutesenvelope. Routes are the documented routes of the OpenAPI document (hidden endpoints are omitted), sorted by path then method.
Enums§
- Severity
- How serious a
Diagnosticis. - UrlSource
- Where the database URL of a live command came from. The URL itself is never reported.
Constants§
- EXIT_
FAILURE - Exit code of a failed command.
- EXIT_OK
- Exit code of a successful command.
- EXIT_
USAGE - Exit code of a usage error.
- REDACTED
- What a redacted value is replaced with.
- SCHEMA_
VERSION - Version of the JSON envelope. Bumped only for breaking changes.
Functions§
- redact_
field - Redact the value of a field called
key: all of it when the key looks secret, otherwise any credentials inside it (seeredact_text). - redact_
text - Redact every credential found in
text.