cmd

package
v0.0.0-...-2b706d3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AliasMap = map[string]*AliasInfo{
	"activity":  {CommandFactory: platform.NewActivityCommand, CanonicalName: "platform activity", ParentName: "platform"},
	"create":    {CommandFactory: project.NewCreateCommand, CanonicalName: "project create", ParentName: "project"},
	"delete":    {CommandFactory: app.NewDeleteCommand, CanonicalName: "app delete", ParentName: "app"},
	"deploy":    {CommandFactory: platform.NewDeployCommand, CanonicalName: "platform deploy", ParentName: "platform"},
	"init":      {CommandFactory: project.NewInitCommand, CanonicalName: "project init", ParentName: "project"},
	"install":   {CommandFactory: app.NewAddCommand, CanonicalName: "app install", ParentName: "app"},
	"list":      {CommandFactory: auth.NewListCommand, CanonicalName: "auth list", ParentName: "auth"},
	"login":     {CommandFactory: auth.NewLoginCommand, CanonicalName: "auth login", ParentName: "auth"},
	"logout":    {CommandFactory: auth.NewLogoutCommand, CanonicalName: "auth logout", ParentName: "auth"},
	"run":       {CommandFactory: platform.NewRunCommand, CanonicalName: "platform run", ParentName: "platform"},
	"samples":   {CommandFactory: project.NewSamplesCommand, CanonicalName: "project samples", ParentName: "project"},
	"uninstall": {CommandFactory: app.NewUninstallCommand, CanonicalName: "app uninstall", ParentName: "app"},
}

Functions

func ExecuteContext

func ExecuteContext(ctx context.Context, rootCmd *cobra.Command, clients *shared.ClientFactory)

ExecuteContext sets up a cancellable context for use with IOStreams' interrupt channel. It listens for process interrupts and sends to IOStreams' GetInterruptChannel() for use in in communicating process interrupts elsewhere in the code.

func Init

Init bootstraps the CLI process. Put things that do not rely on specific arguments or flags passed to the CLI in here. If you need flag/argument values, InitConfig below.

func InitConfig

func InitConfig(ctx context.Context, clients *shared.ClientFactory, rootCmd *cobra.Command) error

InitConfig reads in config files and ENV variables if set and sets up the CLI for functioning. Executes _before_ any Pre* methods from the root or child commands, but after Cobra parses flags and command arguments. Put global CLI initialization routines that rely on flag and argument parsing in here please! TODO: consider using arguments for this function for certain dependencies, like working directory and other OS-specific strings, that OnInitialize above can provide during actual execution, but that we can override with test values for easier testing.

func NewRootCommand

func NewRootCommand(clients *shared.ClientFactory, updateNotification *update.UpdateNotification) *cobra.Command

Types

type AliasInfo

type AliasInfo struct {
	CanonicalName  string
	CommandName    string
	ParentName     string
	CommandFactory func(*shared.ClientFactory) *cobra.Command
}

func (*AliasInfo) SetCommandName

func (a *AliasInfo) SetCommandName(name string)

Jump to

Keyboard shortcuts

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