23 lines
1.1 KiB
Markdown
23 lines
1.1 KiB
Markdown
# Composed consumer
|
|
|
|
This example composes application configuration, PromptKit configuration,
|
|
definition inspection, and one application-owned command:
|
|
|
|
```sh
|
|
go run . config scopes
|
|
go run . config validate --scope all --campaign spring --limit=0
|
|
go run . promptkit show prompt briefing --campaign spring --format yaml
|
|
go run . promptkit show profile spring --campaign spring
|
|
go run . session restore session-42 --campaign spring
|
|
```
|
|
|
|
The sources and session store are small in-memory fixtures. `--campaign` is a
|
|
typed selector shared by the app and PromptKit configuration scopes. Their
|
|
`ckconfig.Suite[*inspectionInput, *runCache]` uses `NewInput` to initialize each
|
|
selected scope's input separately and `NewState` to create one cache shared by
|
|
that invocation's acquisitions. Prompt/profile inspection prepares its input and
|
|
cache independently for its invocation, using the same application and engine
|
|
loader functions. See the
|
|
[consumer guide](https://gitea.maximumdirect.net/eric/CommandKit/src/branch/main/docs/consumers/guide.md)
|
|
and the suites' GoDoc for initialization timing and ownership.
|