Documentation
¶
Overview ¶
Package commands composes only the implemented standard authoring slice.
Index ¶
- Constants
- Variables
- func CompletionInvocation(root *cobra.Command, args []string) bool
- func IsAuthorInvocation(args []string, root *cobra.Command) bool
- func IsEnabled() bool
- func IsRelease() bool
- func NewVersionCommand() (*cobra.Command, error)
- func OutputFormat(root *cobra.Command, args []string) string
- type App
- type Invocation
- type ReleaseOptions
- type RootBuilder
Constants ¶
const ReleaseMode = "release-cli-contract-v1"
Variables ¶
var Enabled string
Enabled is deliberately build-time only. Release builds retain the v1 surface. Internal checkpoint builds set -X <this-package>.Enabled=vertical-slice-v1.
var Revision = "unversioned"
Functions ¶
func IsAuthorInvocation ¶
IsAuthorInvocation uses Cobra selection on an invocation-owned, unconfigured root. Find observes flag definitions without parsing or executing any command. Callers must supply a fresh root, just as they do for Execute.
func NewVersionCommand ¶
Types ¶
type App ¶
type App struct {
Projects project.Service
Revision string
// ClientRegistry is the set of client adapters this binary reports
// compatibility against. The main that builds the App decides it; without
// one the compat report has nothing to ask about the clients it names.
ClientRegistry *clients.Registry
// PublicContract opts into the private Phase 6 contract; mains retain their existing mode.
PublicContract bool
Release *ReleaseOptions
MCPRuntime bool
Bootstrap bool
BootstrapRunner authorbootstrap.Runner
JSONMaintenance bool
}
func (App) Execute ¶
func (a App) Execute(ctx context.Context, args []string, streams authoringcli.Streams, build RootBuilder) error
Execute renders once, after Factory.Execute handles every Cobra lifecycle exit. All state, including the enclosing root/options, is invocation-owned. Raw Cobra errors and buffered help/parser output never enter machine-readable reports.
func (App) ReleaseSelection ¶
func (a App) ReleaseSelection(args []string, build RootBuilder) (root *cobra.Command, author, noEffect bool, err error)
ReleaseSelection builds the same complete tree used by Execute, with inert captures. Installer construction is dependency-free until a genuine job wins.
type Invocation ¶
func (Invocation) Bool ¶
func (in Invocation) Bool(name string) bool
Bool observes pflag's final boolean value. Invalid input never implies intent; compatibility still rejects the invocation based on explicit flag presence.
type ReleaseOptions ¶
type ReleaseOptions struct {
Product, Version string
Reject func(Invocation) error
}
ReleaseOptions is explicit private composition, never environment discovery. Reject receives observations from the shared parser and may only reject.
type RootBuilder ¶
type RootBuilder func(...authoringcli.Factory) (*cobra.Command, error)