Documentation
¶
Overview ¶
Package cmdregistry is the seam between Stainless-generated CLI code in pkg/cmd and hand-written extension subpackages under pkg/cmd/extensions/.
Why this exists:
pkg/cmd is generated from the OpenAPI spec by Stainless and is rewritten on every regen. Extension subpackages that want to add hand-written top-level commands (for example, the webhook listen tunnel tool) cannot directly mutate pkg/cmd's command tree from their init() because doing so requires importing pkg/cmd, while pkg/cmd's bridge file (zz_extensions.go) needs to import them — that's a cycle. This package breaks the cycle: extensions Register here, and the bridge in pkg/cmd Drains here.
Usage from an extension subpackage:
func init() {
cmdregistry.Register(&cli.Command{Name: "my:tool", ...})
}
Usage from the bridge in pkg/cmd:
func init() {
cmd.Command.Commands = append(cmd.Command.Commands, cmdregistry.Drain()...)
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.