Documentation
¶
Overview ¶
Package clictx carries the global per-invocation state (flags, cancellable context) attached to every cobra command, so subcommand packages can read it without importing the root cli package and creating an import cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Flags ¶
type Flags struct {
AuthOverride string
WebAppOverride string
OrgOverride string
Output string
NoPager bool
}
Flags are the values of the persistent flags declared on the root command.
func Get ¶
Get returns the Flags attached by Attach. Returns a zero Flags struct if nothing is attached, so callers don't need to nil-check.
func (*Flags) HasOrgFlag ¶
HasOrgFlag reports whether --org was explicitly set on the command line. Used by callers that need to know the difference between "user said --org=foo" and "fell back to active org" — for example, langsync's project-config override should only kick in when --org is NOT set.
func (*Flags) ResolveAuth ¶
ResolveAuth returns the auth-service base URL: --auth-url > config.auth.
func (*Flags) ResolveOrg ¶
ResolveOrg returns the org id+slug for this invocation. The --org flag (slug or id) wins over the persisted active org. When --org is set we can't tell whether it's a slug or id without a round trip, so both are returned identical and the caller resolves as needed.