A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/terramate-io/terramate@v0.14.4/ui/tui below:

tui package - github.com/terramate-io/terramate/ui/tui - Go Packages

Package tui provides the Terminal User Interface (TUI) of the CLI.

ErrSetup is the error returned when the CLI fails to setup its initial values.

View Source
const KongContext contextStr = "kong.context"

KongContext is the context key for the Kong context.

KongError is the context key for the Kong error.

This section is empty.

ConfigureLogging configures Terramate global logging.

CLI is the Terramate command-line interface opaque type. The default flag spec is [input.Spec] and handler is DefaultAfterConfigHandler.

NewCLI creates a new CLI instance. The opts options modify the default CLI behavior.

Config returns the CLI Terramate configuration.

DidKongExit returns true if Kong intends to exit.

Engine returns the CLI Terramate engine.

Exec executes the CLI with the given arguments.

InitAnalytics initializes the analytics record.

InputSpec returns the CLI flags spec.

Printers returns the CLI printers.

Version returns the CLI Terramate version.

WorkingDir returns the CLI working directory.

type FlagSpec struct {
	DisableCheckpoint          bool `hidden:"true" optional:"true" default:"false" help:"Disable checkpoint checks for updates."`
	DisableCheckpointSignature bool `hidden:"true" optional:"true" default:"false" help:"Disable checkpoint signature."`
	CPUProfiling               bool `hidden:"true" optional:"true" default:"false" help:"Create a CPU profile file when running"`

	Create struct {
		Path        string   `arg:"" optional:"" name:"path" predictor:"file" help:"Path of the new stack."`
		ID          string   `help:"Set the ID of the stack, defaults to an UUIDv4 string."`
		Name        string   `help:"Set the name of the stack, defaults to the basename of <path>"`
		Description string   `help:"Set the description of the stack, defaults to <name>"`
		Import      []string `help:"Add 'import' block to the configuration of the new stack."`
		After       []string `help:"Add 'after' attribute to the configuration of the new stack."`
		Before      []string `help:"Add 'before' attribute to the configuration of the new stack."`
		Wants       []string `help:"Add 'wants' attribute to the configuration of the new stack."`
		WantedBy    []string `help:"Add 'wanted_by' attribute to the configuration of the new stack."`

		Watch          []string `help:"Add 'watch' attribute to the configuration of the new stack."`
		IgnoreExisting bool     `help:"Skip creation without error when the stack already exist."`
		AllTerraform   bool     `help:"Import existing Terraform Root Modules as stacks."`
		AllTerragrunt  bool     `help:"Import existing Terragrunt Modules as stacks."`
		EnsureStackIDs bool     `name:"ensure-stack-ids" help:"Set the ID of existing stacks that do not set an ID to a new UUIDv4."`
		NoGenerate     bool     `help:"Do not run code generation after creating the new stack."`
	} `cmd:"" help:"Create or import stacks."`

	Fmt struct {
		Files            []string `arg:"" optional:"true" predictor:"file" help:"List of files to be formatted."`
		Check            bool     `hidden:"" help:"Lists unformatted files but do not change them. (Exits with 0 if all is formatted, 1 otherwise)"`
		DetailedExitCode bool     `help:"Return a detailed exit code: 0 nothing changed, 1 an error happened, 2 changes were made."`
	} `cmd:"" help:"Format configuration files."`

	List struct {
		Why bool `help:"Shows the reason why the stack has changed."`

		Target   string `help:"Select the deployment target of the filtered stacks."`
		RunOrder bool   `default:"false" help:"Sort listed stacks by order of execution"`
		
	} `cmd:"" help:"List stacks."`

	Run struct {
		
	} `cmd:"" help:"Run command in the stacks"`

	Generate struct {
		Parallel         int  `env:"TM_ARG_GENERATE_PARALLEL" short:"j" optional:"true" help:"Set the parallelism of code generation"`
		DetailedExitCode bool `default:"false" help:"Return a detailed exit code: 0 nothing changed, 1 an error happened, 2 changes were made."`
	} `cmd:"" help:"Run Code Generation in stacks."`

	Script struct {
		List struct{} `cmd:"" help:"List scripts."`
		Tree struct{} `cmd:"" help:"Dump a tree of scripts."`
		Info struct {
			Cmds []string `arg:"" optional:"true" passthrough:"" help:"Script to show info for."`
		} `cmd:"" help:"Show detailed information about a script"`
		Run struct {
			
		} `cmd:"" help:"Run a Terramate Script in stacks."`
	} `cmd:"" help:"Use Terramate Scripts"`

	Debug struct {
		Show struct {
			Metadata        struct{} `cmd:"" help:"Show metadata available in stacks."`
			Globals         struct{} `cmd:"" help:"Show globals available in stacks."`
			GenerateOrigins struct {
			} `cmd:"" help:"Show details about generated code in stacks."`
			RuntimeEnv struct{} `cmd:"" help:"Show available run-time environment variables (ENV) in stacks."`
		} `cmd:"" help:"Show configuration details of stacks."`
	} `cmd:"" help:"Debug Terramate configuration."`

	Cloud struct {
		Login struct {
			Google bool `optional:"true" help:"authenticate with google credentials"`
			Github bool `optional:"true" help:"authenticate with github credentials"`
			SSO    bool `optional:"true" help:"authenticate with SSO credentials"`
		} `cmd:"" help:"Sign in to Terramate Cloud."`
		Info  struct{} `cmd:"" help:"Show your current Terramate Cloud login status."`
		Drift struct {
			Show struct {
				Target string `help:"Show stacks from the given deployment target."`
			} `cmd:"" help:"Show the current drift of a stack."`
		} `cmd:"" help:"Interact with Terramate Cloud Drift Detection."`
	} `cmd:"" help:"Interact with Terramate Cloud"`

	Trigger struct {
		Stack        string `arg:"" optional:"true" name:"stack" predictor:"file" help:"The stacks path."`
		Recursive    bool   `default:"false" help:"Recursively triggers all child stacks of the given path"`
		Change       bool   `default:"false" help:"Trigger stacks as changed"`
		IgnoreChange bool   `default:"false" help:"Trigger stacks to be ignored by change detection"`
		Reason       string `default:"" name:"reason" help:"Set a reason for triggering the stack."`
		
	} `cmd:"" hidden:""  help:"Mark a stack as changed so it will be triggered in Change Detection. (DEPRECATED)"`

	Experimental struct {
		Clone struct {
			SrcDir          string `arg:"" name:"srcdir" predictor:"file" help:"Path of the stack being cloned."`
			DestDir         string `arg:"" name:"destdir" predictor:"file" help:"Path of the new stack."`
			SkipChildStacks bool   `default:"false" help:"Do not clone nested child stacks."`
			NoGenerate      bool   `help:"Do not run code generation after cloning the stacks."`
		} `cmd:"" help:"Clone a stack."`

		Trigger struct {
			Stack        string `arg:"" optional:"true" name:"stack" predictor:"file" help:"The stacks path."`
			Recursive    bool   `default:"false" help:"Recursively triggers all child stacks of the given path"`
			Change       bool   `default:"false" help:"Trigger stacks as changed"`
			IgnoreChange bool   `default:"false" help:"Trigger stacks to be ignored by change detection"`
			Reason       string `default:"" name:"reason" help:"Set a reason for triggering the stack."`
			
		} `cmd:"" hidden:"" help:"Mark a stack as changed so it will be triggered in Change Detection. (DEPRECATED)"`

		RunGraph struct {
			Outfile string `short:"o" predictor:"file" default:"" help:"Output .dot file"`
			Label   string `short:"l" default:"stack.name" help:"Label used in graph nodes (it could be either \"stack.name\" or \"stack.dir\""`
		} `cmd:"" help:"Generate a graph of the execution order"`

		Vendor struct {
			Download struct {
				Dir       string `short:"d" predictor:"file" default:"" help:"dir to vendor downloaded project"`
				Source    string `arg:"" name:"source" help:"Terraform module source URL, must be Git/Github and should not contain a reference"`
				Reference string `arg:"" name:"ref" help:"Reference of the Terraform module to vendor"`
			} `cmd:"" help:"Downloads a Terraform module and stores it on the project vendor dir"`
		} `cmd:"" help:"Manages vendored Terraform modules"`

		Eval struct {
			Global map[string]string `short:"g" help:"set/override globals. eg.: --global name=<expr>"`
			AsJSON bool              `help:"Outputs the result as a JSON value"`
			Exprs  []string          `arg:"" help:"expressions to be evaluated" name:"expr" passthrough:""`
		} `cmd:"" help:"Eval expression"`

		PartialEval struct {
			Global map[string]string `short:"g" help:"set/override globals. eg.: --global name=<expr>"`
			Exprs  []string          `arg:"" help:"expressions to be partially evaluated" name:"expr" passthrough:""`
		} `cmd:"" help:"Partial evaluate the expressions"`

		GetConfigValue struct {
			Global map[string]string `short:"g" help:"set/override globals. eg.: --global name=<expr>"`
			AsJSON bool              `help:"Outputs the result as a JSON value"`
			Vars   []string          `arg:"" help:"variable to be retrieved" name:"var" passthrough:""`
		} `cmd:"" help:"Get configuration value"`

		Cloud struct {
			Login struct{} `cmd:"" help:"login for cloud.terramate.io  (DEPRECATED)"`
			Info  struct{} `cmd:"" help:"cloud information status (DEPRECATED)"`
			Drift struct {
				Show struct {
				} `cmd:"" help:"show drifts  (DEPRECATED)"`
			} `cmd:"" help:"manage cloud drifts  (DEPRECATED)"`
		} `cmd:"" hidden:"" help:"Terramate Cloud commands (DEPRECATED)"`
	} `cmd:"" help:"Use experimental features."`

	InstallCompletions kongplete.InstallCompletions `cmd:"" help:"Install shell completions."`

	Version struct{} `cmd:"" help:"Show Terramate version"`
	
}

FlagSpec defines the default Terramate flags and commands.

type Handler

Handler is a function that handles the CLI configuration.

Option is a function that modifies the CLI behavior.

WithCompactHelp is an option to modify the helper compact option.

WithDescription is an option to modify the project description.

func WithExpandSubcommandsInHelp
func WithExpandSubcommandsInHelp() Option

WithExpandSubcommandsInHelp is an option to expand the subcommands in the help. By default they are not shown.

WithHCLOptions is an option to set the HCL options for the CLI.

WithHelpPrinter allows for customizing the help output.

WithName is an option modify the project name.

func WithSpecHandler

WithSpecHandler is an option to set the flag spec and handler for the CLI.

WithStderr is an option to modify the CLI stderr channel.

WithStdin is an option to modify the CLI stdin channel.

WithStdout is an option to modify the CLI stdout channel.

WithVersion is an option to modify the CLI version. Default is `terramate.Version()`.

type RootFlagHandlers

RootFlagHandlers is a function signature for root flag handlers.

func DefaultRootFlagHandlers

DefaultRootFlagHandlers returns the CLI default flag handlers for global flags that can be used alone (without a command). For example: terramate --version


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4