doctor command
keel doctorNo arguments or flags. Must be run inside a Keel project.
What it checks
Section titled “What it checks”keel doctor runs a set of static checks in sequence:
1. keel.toml validity
Section titled “1. keel.toml validity”- Verifies the file exists.
- Parses it as valid TOML.
- If missing: emits a warning and skips addon/env checks.
- If malformed: emits an error and stops that check group.
2. application.properties (new runtime config contract)
Section titled “2. application.properties (new runtime config contract)”- If present, parses and validates it.
- Takes precedence over
keel.tomlfor env var checks. - If missing: emits a soft warning (non-blocking).
3. Addons installed in go.mod
Section titled “3. Addons installed in go.mod”For each [[addons]] entry in keel.toml:
- Searches for the addon’s module path in
go.mod. ✓if found,✗if missing (blocks with error).- Also warns if no addons are declared.
4. Addon version freshness
Section titled “4. Addon version freshness”For each official ss-keel-* addon declared in keel.toml:
- Fetches the latest version from GitHub in parallel.
- Compares against the installed version in
go.mod. ⚠if outdated: shows current → latest.✓if up to date.- Skips non-official or community addons.
- Timeout: 8 seconds total across all parallel checks.
5. Required env vars
Section titled “5. Required env vars”Reads variables from application.properties (if present) or from [[env]] entries in keel.toml:
- Checks
.envfirst, then OS environment. - Required vars with no value →
✗error. - Optional vars with placeholder values (e.g.
change-me,your-secret) →⚠warning.
6. OAuth configuration sanity
Section titled “6. OAuth configuration sanity”If the oauth addon is declared in keel.toml:
- Checks for at least one complete provider pair:
OAUTH_<PROVIDER>_CLIENT_ID+OAUTH_<PROVIDER>_CLIENT_SECRET. - Supported providers:
GOOGLE,GITHUB,GITLAB. - If none are configured →
⚠warning (the addon would mount zero routes at runtime).
7. Module and build readiness
Section titled “7. Module and build readiness”Runs two Go commands:
go mod tidy -diff # checks whether go.mod/go.sum are tidygo build ./... # verifies the project compiles- If
go.modorcmd/main.goare missing, this check is skipped with a warning. - If
go mod tidy -difffails →✗error;go buildis skipped. - If
go build ./...fails →✗error; output is shown (first 8 lines).
Output symbols
Section titled “Output symbols”| Symbol | Meaning |
|---|---|
✓ | Check passed |
✗ | Error — must fix |
⚠ | Warning — should fix |
Summary
Section titled “Summary”After all checks:
- All pass →
✓ project looks healthy - Warnings only →
⚠ project looks healthy, but review warnings before production - Any error →
✗ doctor found issues — fix them before running the application
The command exits with a non-zero code when there are errors.
Example output
Section titled “Example output” Keel Doctor — project health check
✓ keel.toml is valid ⚠ application.properties not found — generate it for the new runtime config contract ✓ addon "gorm" found in go.mod ✓ addon "jwt" found in go.mod ✓ addon "gorm" is up to date (v0.4.1) ✓ addon "jwt" is up to date (v0.3.0) ✓ required var DB_DSN is set ✓ required var JWT_SIGNING_KEY is set ⚠ sensitive var JWT_SIGNING_KEY uses an insecure placeholder (.env) — replace it before production ✓ go.mod/go.sum are tidy ✓ go build ./... passed
⚠ project looks healthy, but review warnings before production ℹ checks are static (keel.toml, go.mod, env vars, go build) — runtime connectivity to databases, Redis, or external services is not verifiedCommon errors
Section titled “Common errors”keel.toml is not valid TOML: ...addon "X" not found in go.mod — run: keel add Xrequired var X is not set — add it to .envgo.mod/go.sum are not tidy — run: go mod tidygo build ./... failed
Recommended usage
Section titled “Recommended usage”Run keel doctor after:
- installing or removing an addon (
keel add,keel addon remove) - editing
keel.tomlmanually - pulling changes from teammates
- before shipping to production
keel doctor