cli

package
v0.76.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: MIT Imports: 39 Imported by: 18

Documentation

Overview

Package cli configures the Terragrunt CLI app and its commands.

Index

Constants

View Source
const (

	// The status returned when making a request to the caching provider.
	// It is needed to prevent further loading of providers by terraform, and at the same time make sure that the request was processed successfully.
	CacheProviderHTTPStatusCode = http.StatusLocked

	// Authentication type on the Terragrunt Provider Cache server.
	APIKeyAuth = "x-api-key"
)
View Source
const AppHelpTemplate = `` /* 1084-byte string literal not displayed */

AppHelpTemplate is the main CLI help template.

View Source
const (
	AppName = "terragrunt"
)
View Source
const AppVersionTemplate = `{{ .App.Name }} version {{ .App.Version }}
`
View Source
const CommandHelpTemplate = `` /* 1183-byte string literal not displayed */

CommandHelpTemplate is the command CLI help template.

Variables

This section is empty.

Functions

func ExitErrHandler added in v0.68.0

func ExitErrHandler(_ *cli.Context, err error) error

ExitErrHandler is an empty function that overrides the default behavior.

func OSExiter added in v0.66.7

func OSExiter(exitCode int)

OSExiter is an empty function that overrides the default behavior.

func WrapWithTelemetry added in v0.66.7

func WrapWithTelemetry(opts *options.TerragruntOptions) func(ctx *cli.Context, action cli.ActionFunc) error

WrapWithTelemetry wraps CLI command execution with setting of telemetry context and labels, if telemetry is disabled, just runAction the command.

Types

type App added in v0.56.4

type App struct {
	*cli.App
	// contains filtered or unexported fields
}

func NewApp added in v0.48.7

func NewApp(opts *options.TerragruntOptions) *App

NewApp creates the Terragrunt CLI App.

func (*App) Run added in v0.56.4

func (app *App) Run(args []string) error

func (*App) RunContext added in v0.56.4

func (app *App) RunContext(ctx context.Context, args []string) error

type ProviderCache added in v0.57.9

type ProviderCache struct {
	*cache.Server
	// contains filtered or unexported fields
}

func InitProviderCacheServer added in v0.56.4

func InitProviderCacheServer(opts *options.TerragruntOptions) (*ProviderCache, error)

func (*ProviderCache) TerraformCommandHook added in v0.57.9

func (cache *ProviderCache) TerraformCommandHook(
	ctx context.Context,
	opts *options.TerragruntOptions,
	args cli.Args,
) (*util.CmdOutput, error)

TerraformCommandHook warms up the providers cache, creates `.terraform.lock.hcl` and runs the `tofu/terraform init` command with using this cache. Used as a hook function that is called after running the target tofu/terraform command. For example, if the target command is `tofu plan`, it will be intercepted before it is run in the `/shell` package, then control will be passed to this function to init the working directory using cached providers.

Directories

Path Synopsis
Package commands represents CLI commands.
Package commands represents CLI commands.
Package flags provides tools that are used by all commands to create deprecation flags with strict controls.
Package flags provides tools that are used by all commands to create deprecation flags with strict controls.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳