Documentation
¶
Index ¶
- Constants
- func CreateGlobalFlagSet() *pflag.FlagSet
- func NewRootCmd(staticHelp bool, middlewareChain []*actions.MiddlewareRegistration, ...) *cobra.Command
- func ParseGlobalFlags(args []string, opts *internal.GlobalCommandOptions) error
- func WithBrowserOverride(ctx context.Context, fn browseUrl) context.Context
- type ArmClientInitializer
- type Asker
- type BuildResult
- type CmdAnnotations
- type CmdCalledAs
- type CobraBuilder
- type CredentialProviderFn
- type ExecuteResult
- type PackageResult
- type RestoreResult
Constants ¶
const TelemetryCommandFlag = "telemetry"
const TelemetryUploadCommandFlag = "upload"
Variables ¶
This section is empty.
Functions ¶
func CreateGlobalFlagSet ¶
CreateGlobalFlagSet creates a new flag set with all global flags defined. This is the single source of truth for global flag definitions.
When adding or modifying flags here, also update the reserved flag registry in internal/reserved_flags.go. The SDK package (pkg/azdext) derives its reserved flag indexes from that registry automatically.
func NewRootCmd ¶
func NewRootCmd( staticHelp bool, middlewareChain []*actions.MiddlewareRegistration, rootContainer *ioc.NestedContainer, ) *cobra.Command
Creates the root Cobra command for AZD. staticHelp - False, except for running for doc generation middlewareChain - nil, except for running unit tests rootContainer - The IoC container to use for registering and resolving dependencies. If nil is provided, a new container empty will be created.
func ParseGlobalFlags ¶
func ParseGlobalFlags(args []string, opts *internal.GlobalCommandOptions) error
ParseGlobalFlags parses global flags from the provided arguments and populates the GlobalCommandOptions. Uses ParseErrorsAllowlist to gracefully ignore unknown flags (like extension-specific flags). This function is designed to be called BEFORE Cobra command tree construction to enable early access to global flag values for auto-install and other pre-execution logic.
Agent Detection: If --no-prompt is not explicitly set and an AI coding agent (like Claude Code, GitHub Copilot CLI, Cursor, etc.) is detected as the caller, NoPrompt is automatically enabled.
Types ¶
type ArmClientInitializer ¶
type ArmClientInitializer[T comparable] func( subscriptionId string, credentials azcore.TokenCredential, armClientOptions *arm.ClientOptions, ) (T, error)
ArmClientInitializer is a function definition for all Azure SDK ARM Client
type BuildResult ¶
type BuildResult struct {
Timestamp time.Time `json:"timestamp"`
Services map[string]*project.ServiceBuildResult `json:"services"`
}
type CmdCalledAs ¶
type CmdCalledAs string
CmdCalledAs provides access to the cmd.CalledAs() value through dependency injection
type CobraBuilder ¶
type CobraBuilder struct {
// contains filtered or unexported fields
}
CobraBuilder manages the construction of the cobra command tree from nested ActionDescriptors
func NewCobraBuilder ¶
func NewCobraBuilder(container *ioc.NestedContainer) *CobraBuilder
Creates a new instance of the Cobra builder
func (*CobraBuilder) BuildCommand ¶
func (cb *CobraBuilder) BuildCommand(descriptor *actions.ActionDescriptor) (*cobra.Command, error)
Builds a cobra Command for the specified action descriptor
type CredentialProviderFn ¶
type CredentialProviderFn func(context.Context, *auth.CredentialForCurrentUserOptions) (azcore.TokenCredential, error)
type ExecuteResult ¶ added in v1.23.15
type ExecuteResult struct {
// Err is the error returned by the command execution, if any.
Err error
// IsLightspeed is true when the executed command was marked as Lightspeed.
// Callers should skip non-essential post-execution work (update checks, banners)
// for lightspeed commands so the process can exit quickly.
IsLightspeed bool
// LatestVersion receives the result of the background update check.
// Nil when the update check was not started (lightspeed commands).
// When the check is skipped via AZD_SKIP_UPDATE_CHECK, the returned channel
// is closed without a value.
LatestVersion <-chan *update.VersionInfo
}
ExecuteResult holds the outcome of ExecuteWithAutoInstall, including metadata about the executed command that callers may need for post-execution decisions (e.g., whether to wait for the background update check).
func ExecuteWithAutoInstall ¶
func ExecuteWithAutoInstall(ctx context.Context, rootContainer *ioc.NestedContainer) *ExecuteResult
ExecuteWithAutoInstall executes the command and handles auto-installation of extensions for unknown commands.
type PackageResult ¶
type PackageResult struct {
Timestamp time.Time `json:"timestamp"`
Services map[string]*project.ServicePackageResult `json:"services"`
}
type RestoreResult ¶
type RestoreResult struct {
Timestamp time.Time `json:"timestamp"`
Services map[string]*project.ServiceRestoreResult `json:"services"`
}
Source Files
¶
- auth.go
- auth_login.go
- auth_logout.go
- auth_status.go
- auth_token.go
- auto_install.go
- build.go
- cmd_help.go
- cobra_builder.go
- completion.go
- config.go
- container.go
- copilot.go
- deps.go
- down.go
- env.go
- env_remove.go
- extension.go
- extensions.go
- hooks.go
- infra.go
- infra_create.go
- infra_delete.go
- infra_generate.go
- init.go
- mcp.go
- monitor.go
- package.go
- pipeline.go
- restore.go
- root.go
- telemetry.go
- templates.go
- up.go
- update.go
- util.go
- version.go
- vs_server.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package actions contains the application logic that handles azd CLI commands.
|
Package actions contains the application logic that handles azd CLI commands. |