doctor

package
v1.233.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Package doctor registers project diagnostics without the normal executable configuration bootstrap.

Index

Constants

View Source
const ConfigFreeAnnotation = "atmos.tools/config-free"

ConfigFreeAnnotation marks a command that never loads atmos.yaml. Anything that would read the configuration on its behalf, such as the telemetry disclosure or the update check shown with help, must skip it so a malformed configuration cannot surface through those paths.

Variables

This section is empty.

Functions

func FailBeforeDispatch

func FailBeforeDispatch(args []string, err error) error

FailBeforeDispatch reports a failure that happens before doctor's command runs (for example an unusable --chdir) for the raw command-line args. Machine formats receive the usual operational_error report on stdout and exit with the usage status; other formats return err unchanged.

func InvocationIndex

func InvocationIndex(args []string, rootFlags *pflag.FlagSet) (int, bool)

InvocationIndex reports whether args invoke the doctor command and, when they do, the index of the "doctor" token. Callers use the index to treat the leading root flags and the command's own arguments separately, because an optional-value root flag such as --pager must never absorb the command name.

func IsConfigFree

func IsConfigFree(cmd *cobra.Command) bool

IsConfigFree reports whether cmd, or one of its parents, runs without loading atmos.yaml.

func IsInvocation

func IsInvocation(args []string, rootFlags *pflag.FlagSet) bool

IsInvocation reports whether args (the arguments after the program name) invoke the doctor command once leading root-level flags are skipped.

Flag arity is derived from the root command's persistent flags rather than a hand-maintained allowlist, so a newly added root flag cannot silently route `atmos <flag> doctor` through normal configuration loading, which would crash on exactly the malformed configuration that doctor exists to diagnose. Unknown leading flags are treated as value-less: doctor then reaches Cobra, which reports the unknown flag, instead of the configuration loader.

func NewCommand

func NewCommand() *cobra.Command

NewCommand constructs an isolated command for registration and tests.

Types

type CommandProvider

type CommandProvider struct{}

CommandProvider supplies the built-in doctor command.

func (*CommandProvider) GetAliases

func (*CommandProvider) GetAliases() []internal.CommandAlias

func (*CommandProvider) GetCommand

func (*CommandProvider) GetCommand() *cobra.Command

func (*CommandProvider) GetCompatibilityFlags

func (*CommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag

func (*CommandProvider) GetFlagsBuilder

func (*CommandProvider) GetFlagsBuilder() flags.Builder

func (*CommandProvider) GetGroup

func (*CommandProvider) GetGroup() string

func (*CommandProvider) GetName

func (*CommandProvider) GetName() string

func (*CommandProvider) GetPositionalArgsBuilder

func (*CommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder

func (*CommandProvider) IsExperimental

func (*CommandProvider) IsExperimental() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL