cli

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoot

func NewRoot(version string) *cobra.Command

func Rewrite

func Rewrite(args []string) []string

Rewrite maps a legacy command name onto its replacement. Everything else is returned untouched.

Types

type App

type App struct {
	Version string
	Global  Global
	Config  *config.Config
	Out     io.Writer
	// Err takes notes that are not the command's output; stderr when nil.
	Err io.Writer
	// ProjectOrg is the org named by a config file in the working directory.
	ProjectOrg string
	// ProjectProject is the project named by that same file.
	ProjectProject string
	// ProjectEnvironment is the environment named by that same file.
	ProjectEnvironment string
	// contains filtered or unexported fields
}

App is the state shared by every command in the tree.

func (*App) Org

func (a *App) Org(ctx context.Context) (string, error)

Org resolves the organization a command runs against. With nothing selected, an account that belongs to exactly one organization has nothing to choose, so pick it rather than demand a step.

func (*App) Portal

func (a *App) Portal() *portal.Client

func (*App) Renderer

func (a *App) Renderer() *render.Renderer

func (*App) Target added in v0.5.0

func (a *App) Target(ctx context.Context) (Target, error)

Target resolves the organization, project and environment a command that only reads runs against. An org with one reachable project has nothing to choose, and no environment chosen is the organization's default, never an error: when that default cannot be read it is development, said once on stderr. When org or project is missing, the returned Target still carries what was chosen: a project or environment that was asked for is not lost because no org resolved.

func (*App) TargetForApp added in v0.5.0

func (a *App) TargetForApp(ctx context.Context, name string) (Target, error)

TargetForApp is Target for a named app: with no organization or project to go on it looks for the app in every environment of every project the user can reach, narrowed by whatever was chosen (--org, --project, --environment). A name present in more than one place is ambiguous and returns an error naming each org/project/environment, so a bare command never guesses between two apps that share a name.

func (*App) TargetToChange added in v0.14.0

func (a *App) TargetToChange(ctx context.Context) (Target, error)

TargetToChange is Target for a command that creates or changes something: rather than act in a guessed development, it refuses and asks for --environment.

type ExitCode added in v0.14.0

type ExitCode int

ExitCode ends the process with that status. The command already said why on stderr, so there is nothing more to print.

func (ExitCode) Error added in v0.14.0

func (c ExitCode) Error() string

type Global

type Global struct {
	Org         string
	Project     string
	Environment string
	Output      string
	Yes         bool
	Verbose     bool
}

Global carries the flags every command may read.

type Target added in v0.5.0

type Target = deploy.Target

Target is the organization, project and environment a project-scoped command runs against.

Jump to

Keyboard shortcuts

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