Documentation
¶
Index ¶
- Constants
- Variables
- func AddIdentityCompletion(cmd *cobra.Command)
- func BuildConfigAndStacksInfo(cmd *cobra.Command, v *viper.Viper) schema.ConfigAndStacksInfo
- func ComponentsArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func CreateAuthManager(authConfig *schema.AuthConfig, cliConfigPath string) (auth.AuthManager, error)
- func GetAuthCmd() *cobra.Command
- func GetIdentityFromFlags(cmd *cobra.Command) string
- func IdentityArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ProviderArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- type AuthCommandProvider
- func (a *AuthCommandProvider) GetAliases() []internal.CommandAlias
- func (a *AuthCommandProvider) GetCommand() *cobra.Command
- func (a *AuthCommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
- func (a *AuthCommandProvider) GetFlagsBuilder() flags.Builder
- func (a *AuthCommandProvider) GetGroup() string
- func (a *AuthCommandProvider) GetName() string
- func (a *AuthCommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
- func (a *AuthCommandProvider) IsExperimental() bool
Constants ¶
const ( // IdentityFlagName is the name of the identity flag (from pkg/config/const.go). IdentityFlagName = cfg.IdentityFlagName // IdentityFlagSelectValue is the sentinel value for interactive selection (from pkg/config/const.go). IdentityFlagSelectValue = cfg.IdentityFlagSelectValue )
const ( // ConsoleLabelWidth is the width for label styling in console output. ConsoleLabelWidth = 18 // ConsoleOutputFormat is the format string for label-value pairs. ConsoleOutputFormat = "%s %s\n" )
const ( // FormatFlagName is the name of the format flag for env command. FormatFlagName = "format" // OutputFileFlagName is the name of the output-file flag for env command. OutputFileFlagName = "output-file" )
const (
// ListFormatFlagName is the name of the format flag for list command.
ListFormatFlagName = "format"
)
const (
// OutputFlagName is the name of the output flag for whoami command.
OutputFlagName = "output"
)
Variables ¶
var SupportedFormats = []string{"json", "bash", "dotenv", "env", "github"}
SupportedFormats lists the supported output formats for env command. JSON is handled separately in the command, all other formats are delegated to pkg/env.
Functions ¶
func AddIdentityCompletion ¶
AddIdentityCompletion registers shell completion for the identity flag if present on the command.
func BuildConfigAndStacksInfo ¶
BuildConfigAndStacksInfo parses global flags and builds ConfigAndStacksInfo. This ensures auth commands honor global flags like --base-path, --config, --config-path, and --profile. Wraps flags.BuildConfigAndStacksInfo for convenience.
func ComponentsArgCompletion ¶
func ComponentsArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ComponentsArgCompletion provides shell completion for component arguments. This delegates to the cmd package's ComponentsArgCompletion. Note: For auth commands, we use cobra.NoFileCompletions since auth doesn't deal with components.
func CreateAuthManager ¶
func CreateAuthManager(authConfig *schema.AuthConfig, cliConfigPath string) (auth.AuthManager, error)
CreateAuthManager creates a new auth manager with all required dependencies. Exported for use by command packages (e.g., terraform package).
func GetAuthCmd ¶
GetAuthCmd returns the auth command for subcommand registration.
func GetIdentityFromFlags ¶
GetIdentityFromFlags retrieves the identity flag value, handling the NoOptDefVal quirk. The identity flag uses NoOptDefVal="__SELECT__" which causes Viper to always return "__SELECT__" after parsing, even when the flag wasn't provided. This function checks the actual flag state to return the correct value.
Returns:
- Empty string if --identity was not provided (use config/env default).
- IdentityFlagSelectValue if --identity was provided without a value (user wants selection).
- The actual value if --identity=value was provided.
func IdentityArgCompletion ¶
func IdentityArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
IdentityArgCompletion provides shell completion for identity positional arguments. It returns a list of available identities from the Atmos configuration.
Honors --base-path, --config, --config-path, and --profile from the current command context so completion sees the same atmos config the command would actually run against.
func ProviderArgCompletion ¶
func ProviderArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ProviderArgCompletion provides shell completion for provider positional arguments. It returns a list of available providers from the Atmos configuration.
Honors --base-path, --config, --config-path, and --profile from the current command context so completion sees the same atmos config the command would actually run against.
Types ¶
type AuthCommandProvider ¶
type AuthCommandProvider struct{}
AuthCommandProvider implements the CommandProvider interface.
func (*AuthCommandProvider) GetAliases ¶
func (a *AuthCommandProvider) GetAliases() []internal.CommandAlias
GetAliases returns command aliases.
func (*AuthCommandProvider) GetCommand ¶
func (a *AuthCommandProvider) GetCommand() *cobra.Command
GetCommand returns the auth command.
func (*AuthCommandProvider) GetCompatibilityFlags ¶
func (a *AuthCommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
GetCompatibilityFlags returns compatibility flags for this command.
func (*AuthCommandProvider) GetFlagsBuilder ¶
func (a *AuthCommandProvider) GetFlagsBuilder() flags.Builder
GetFlagsBuilder returns the flags builder for this command.
func (*AuthCommandProvider) GetGroup ¶
func (a *AuthCommandProvider) GetGroup() string
GetGroup returns the command group for help organization.
func (*AuthCommandProvider) GetName ¶
func (a *AuthCommandProvider) GetName() string
GetName returns the command name.
func (*AuthCommandProvider) GetPositionalArgsBuilder ¶
func (a *AuthCommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
GetPositionalArgsBuilder returns the positional args builder for this command.
func (*AuthCommandProvider) IsExperimental ¶
func (a *AuthCommandProvider) IsExperimental() bool
IsExperimental returns whether this command is experimental. Auth commands are currently experimental as part of Pro Features.