Pinocchio-specific companion to the generic Geppetto CLI bootstrap migration tutorial.
The generic migration guide now lives in Geppetto at geppetto/pkg/doc/tutorials/09-migrating-cli-commands-to-glazed-bootstrap-profile-resolution.md. Read that first.
If you are new to the settings lifecycle, read pinocchio/pkg/doc/topics/pinocchio-profile-resolution-and-runtime-switching.md alongside this tutorial.
That companion topic explains:
hidden base settings
stripped parsed-values base settings
BaseInferenceSettings vs FinalInferenceSettings
profile resolution without contaminating the baseline
ai-client
It also means cross-profile client settings such as ai-client.* are part of the same shared baseline surface when the verb mounts the full Geppetto sections.
This companion page covers only the Pinocchio-specific deltas you still need when the target command lives in the Pinocchio repo.
Pinocchio should now contribute only application wiring:
profilebootstrap.BootstrapConfig()profilebootstrap.MapPinocchioConfigFile(...)profilebootstrap.ResolveCLIEngineSettings(...)The generic bootstrap and inference-debug behavior is Geppetto-owned.
When a Pinocchio command needs to call Geppetto bootstrap helpers directly, pass:
profilebootstrap.BootstrapConfig()That wraps the Pinocchio app name, env prefix, config-file mapper, and shared section builders without re-exporting any debug helper behavior.
Pinocchio config files contain top-level keys like repositories, so the middleware chain still needs:
profilebootstrap.MapPinocchioConfigFile(...)If you omit that mapper, config parsing can fail or silently drift.
In Pinocchio commands, the simplest path is still:
resolved, err := profilebootstrap.ResolveCLIEngineSettings(ctx, parsed)
if err != nil {
return err
}
if resolved.Close != nil {
defer resolved.Close()
}
That keeps the command code concise while still using the Geppetto-owned bootstrap system under the hood.
Pinocchio should no longer define its own debug helper path. The command should mount:
geppettobootstrap.NewInferenceDebugSection()and should execute:
geppettobootstrap.HandleInferenceDebugOutput(...)The current debug surface is one flag:
--print-inference-settingsThat output now includes both settings and sources, with sensitive values masked as ***.
The Pinocchio JS command still has one subtle runtime rule that matters:
That prevents later JS-created engines from dropping config-derived values like API keys or base URLs.
Run these after migrating a Pinocchio verb:
go run ./cmd/pinocchio <verb> --help --long-helpgo run ./cmd/pinocchio <verb> --print-parsed-fieldsgo run ./cmd/pinocchio <verb> --print-inference-settingssettings: and sources:go test ./cmd/pinocchio/... -count=1go test ./pkg/cmds/profilebootstrap -count=1| Problem | Cause | Solution |
|---|---|---|
Config parsing chokes on repositories | The command skipped the Pinocchio config-file mapper | Use profilebootstrap.MapPinocchioConfigFile(...) |
The command still has --print-inference-settings-sources docs or flags | The migration copied older Pinocchio patterns | Replace them with geppettobootstrap.NewInferenceDebugSection() and the single --print-inference-settings path |
| JS-created engines miss API keys or base URLs | The runtime used raw profile data instead of merged defaults | Pass resolved.FinalInferenceSettings into the JS runtime as default settings |
geppetto/pkg/doc/tutorials/09-migrating-cli-commands-to-glazed-bootstrap-profile-resolution.md