Documentation
¶
Overview ¶
Package authoringcli constructs fresh, privately wired authoring commands. It contains no project services and is not registered by either released main.
Index ¶
- Constants
- func CheckReleaseCompletion(root *cobra.Command, args []string) error
- func NewAuthorCommand(factories ...Factory) (*cobra.Command, error)
- func NewCommand[Request, Result any](spec Spec[Request, Result]) (*cobra.Command, error)
- func NewPluginKitRoot(factories ...Factory) (*cobra.Command, error)
- func NewReleaseAuthorCommand(factories ...Factory) (*cobra.Command, error)
- func NewReleasePluginKitRoot(factories ...Factory) (*cobra.Command, error)
- func PrepareReleaseUtilities(root *cobra.Command, completion bool)
- type Factory
- type Options
- type Runner
- type RunnerFunc
- type Spec
- type Streams
- type Support
Constants ¶
const RejectionKey = "authoringcli.v1-rejection"
RejectionKey identifies private, terminal compatibility errors, never jobs.
Variables ¶
This section is empty.
Functions ¶
func CheckReleaseCompletion ¶
CheckReleaseCompletion preflights Cobra 1.10's getCompletions error paths: command lookup, complete flag values, and the incomplete flag's identity. root is disposable: ParseFlags must never mutate the real completion tree. No command/Args/completion callback is executed and no raw error is exposed.
func NewAuthorCommand ¶
NewAuthorCommand is internal wiring only: the subtree remains hidden until the integrator explicitly opens the complete vertical-slice release gate. The returned mutable subtree is single-invocation. The installer root retains all existing persistent flags in their positions.
func NewCommand ¶
NewCommand returns a new command and new flag sets on every call. The returned mutable command is single-invocation. Required dependencies fail at construction, so missing services cannot become stubs.
func NewPluginKitRoot ¶
NewPluginKitRoot returns a mutable single-invocation root for future composition, not a replacement for v1 yet. Execute it through a Factory.
func NewReleaseAuthorCommand ¶
func NewReleasePluginKitRoot ¶
func PrepareReleaseUtilities ¶
PrepareReleaseUtilities uses Cobra's real tree. Hidden retirement shims are removed before generating scripts, including generators that walk all nodes.
Types ¶
type Factory ¶
Factory must construct a fresh single-invocation tree, including flag bindings and mutable captures, never return a cached Cobra command. Composition must execute through Factory.Execute, including for the enclosing installer root.
type Options ¶
Options is a value snapshot, never the installer's mutable options object. Target is the explicit comma-separated selection, not detected clients.
func AdaptFlags ¶
AdaptFlags must run before decoding inputs or invoking any service. Explicit false/empty/default-valued installer flags are still rejected. Unsupported inherited defaults are ignored; explicitly selected unsupported flags fail.
type Runner ¶
Runner is instantiated with each command's own request and result types. A command never needs an application-wide backend or another command's ports.
type RunnerFunc ¶
type Spec ¶
type Spec[Request, Result any] struct { Use, Short, Long string Hidden bool Args cobra.PositionalArgs Support Support Configure func(*cobra.Command) Decode func(*cobra.Command, Options, []string) (Request, error) Runner Runner[Request, Result] Render func(Streams, Options, Result, error) error }
Spec separates Cobra decoding, the in-process runner, and existing rendering. Configure must register command-local flags without capturing shared mutable variables; Decode reads their values from the supplied command. Render owns the human/JSON contract, including failure reports, and must never prompt in JSON mode. The factory preserves runner errors and their exitx annotations.