feat: console help and examples (SummerCMS v0.4.0)

golem:import-settings gets long help and examples, a description in
sentence case without a trailing period, and a warn-only
TestCommandsDocumented over bonfire.CheckDocs. A failed import is reported
once (bonfire.Reported). Requires SummerCMS v0.4.0; the command name and
its flag are unchanged.
This commit is contained in:
Jakub Zych
2026-10-21 17:54:21 +02:00
parent 544aa287f0
commit 37748aea68
5 changed files with 191 additions and 7 deletions

View File

@@ -103,13 +103,15 @@ The environment variable `GOLEM15_SSRF_ALLOWED_HOSTS`, a comma-separated host li
## CLI commands
| Command | Purpose |
|---------|---------|
| `golem:import-settings [--file <json>]` | Copy the AI models of a WinterCMS `golem_settings` row (or of a JSON file holding the settings value or the models list) into `golem15_golem_models`, in order, with each key encrypted. It refuses to run when the table already has rows, and reports a missing `system_settings` table or row without failing. |
| Command | Purpose | Example |
|---------|---------|---------|
| `golem:import-settings [--file <json>]` | Copy the AI models of a WinterCMS `golem_settings` row (or of a JSON file holding the settings value or the models list) into `golem15_golem_models`, in order, with each key encrypted. It refuses to run when the table already has rows, and reports a missing `system_settings` table or row without failing. Ends with `Imported N AI models.` | `bin/<app> golem:import-settings --file golem-settings.json` |
`bin/<app> help golem:import-settings` shows the long help and examples.
## Dependencies
- The SummerCMS framework, `git.golem15.com/golem15/summercms` (modules `backpack`, `bonfire`, `cabana`, `compass`, `fetchguard`, `lagoon`, `pact`, `party`).
- The SummerCMS framework v0.4.0, `git.golem15.com/golem15/summercms` (modules `backpack`, `bonfire`, `cabana`, `compass`, `fetchguard`, `lagoon`, `pact`, `party`).
- GORM and gormigrate, as pinned in `go.mod`.
- testcontainers-go for the Postgres-backed tests.
@@ -118,3 +120,5 @@ The environment variable `GOLEM15_SSRF_ALLOWED_HOSTS`, a comma-separated host li
```sh
go test ./... # starts Postgres with testcontainers (needs Docker)
```
`TestCommandsDocumented` (Docker-free) logs, without failing, each command whose help lacks a description, long help, examples or an option description (`bonfire.CheckDocs`).