cli

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIURL           = "http://localhost:8000"
	ConfigKeyOutput         = "output"
	ConfigKeyContexts       = "contexts"
	ConfigKeyCurrentContext = "currentContext"
)

Variables

View Source
var OutputFormat string
View Source
var RootCmd = &cobra.Command{
	Use:   "superplane",
	Short: "SuperPlane command line interface",
	Long:  `SuperPlane CLI - Command line interface for the SuperPlane API`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if !Verbose {
			log.SetOutput(io.Discard)
		}
	},
}
View Source
var Verbose bool

Functions

func CheckWithMessage

func CheckWithMessage(err error, message string)

Checks if an error is present.

If it is present, it displays the provided message and exits with status 1.

func ContextSelector added in v0.9.0

func ContextSelector(context ConfigContext) string

func DefaultClient

func DefaultClient() *openapi_client.APIClient

func Exit

func Exit(code int)

func GetAPIToken

func GetAPIToken() string

func GetAPIURL

func GetAPIURL() string

func GetOutputFormat

func GetOutputFormat() string

func NewAPIClient

func NewAPIClient(config *ClientConfig) *openapi_client.APIClient

func NewCurrentContext added in v0.9.0

func NewCurrentContext(context ConfigContext) core.ConfigContext

func SaveContexts added in v0.9.0

func SaveContexts(contexts []ConfigContext) error

func WriteConfig added in v0.9.0

func WriteConfig() error

Types

type ClientConfig

type ClientConfig struct {
	BaseURL    string
	APIToken   string
	HTTPClient *http.Client
}

func NewClientConfig

func NewClientConfig() *ClientConfig

type ConfigContext added in v0.9.0

type ConfigContext struct {
	URL          string  `json:"url" yaml:"url"`
	Organization string  `json:"organization" yaml:"organization"`
	APIToken     string  `json:"apiToken" yaml:"apiToken"`
	Canvas       *string `json:"canvas,omitempty" yaml:"canvas,omitempty"`
}

func GetContexts added in v0.9.0

func GetContexts() []ConfigContext

func GetCurrentContext added in v0.9.0

func GetCurrentContext() (ConfigContext, bool)

func SaveCurrentContextBySelector added in v0.9.0

func SaveCurrentContextBySelector(selector string) (*ConfigContext, error)

func UpsertContext added in v0.9.0

func UpsertContext(context ConfigContext) (ConfigContext, error)

type ConnectCommand added in v0.9.0

type ConnectCommand struct{}

func (*ConnectCommand) Execute added in v0.9.0

func (c *ConnectCommand) Execute(ctx core.CommandContext) error

type ContextsCommand added in v0.9.0

type ContextsCommand struct{}

func (*ContextsCommand) Execute added in v0.9.0

func (c *ContextsCommand) Execute(ctx core.CommandContext) error

type CurrentContext added in v0.9.0

type CurrentContext struct {
	// contains filtered or unexported fields
}

* Implementation of the core.ConfigContext interface, * which uses the current context as the source for operations..

func (*CurrentContext) GetActiveCanvas added in v0.9.0

func (c *CurrentContext) GetActiveCanvas() string

func (*CurrentContext) SetActiveCanvas added in v0.9.0

func (c *CurrentContext) SetActiveCanvas(canvasID string) error

Directories

Path Synopsis
commands

Jump to

Keyboard shortcuts

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