Help us shape the future of Go! Take the 2026 Go Developer Survey

commands

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package commands provides the command-line interface for suve.

app.go is this package's subject: the application itself, and the command tree it assembles. Version cannot be renamed, since goreleaser's ldflags name it. Hence core.

Index

Constants

This section is empty.

Variables

View Source
var App = MakeApp()

App is the main CLI application.

View Source
var Version = "dev"

Version is set by goreleaser via ldflags.

Functions

func IsShellCompletion added in v1.9.0

func IsShellCompletion(args []string) bool

IsShellCompletion reports whether args contain the hidden --generate-shell-completion flag that urfave/cli passes on every shell TAB.

func MakeApp

func MakeApp() *cli.Command

MakeApp creates a new CLI application instance, resolving the flat `param` / `secret` aliases from the current environment.

func MakeAppWithDetect added in v0.8.0

func MakeAppWithDetect(det detect.Result) *cli.Command

MakeAppWithDetect builds the app with an explicit provider-detection result. It is the injectable seam behind MakeApp: production passes the env-resolved result, while tests (and any caller needing determinism) pass a fixed one.

func RegisterLaunchMode added in v1.10.0

func RegisterLaunchMode(m LaunchMode)

RegisterLaunchMode registers the mode's flag on the root command, each provider group, each group's param/secret subgroups, and each stage command with its param/secret subgroups. It WRAPS (never replaces) each command's Before hook, so it chains with the hooks already installed (enableDebug on the root, and any mode registered earlier). The launch is skipped during shell completion: urfave/cli runs Before hooks before the completion handler, so honoring the flag there would launch the UI instead of completing (#749).

func RegisterTUIDescription added in v1.9.0

func RegisterTUIDescription()

RegisterTUIDescription rewrites the root usage to advertise the TUI. It must run BEFORE registerGUIDescription so the two compose to "CLI/GUI/TUI" in the GUI build: this turns "CLI" into "CLI/TUI", then the GUI rewrite turns the leading "CLI" into "CLI/GUI", yielding "CLI/GUI/TUI". In the default build the GUI rewrite is a no-op, leaving "CLI/TUI".

func RegisterTUIFlag added in v1.9.0

func RegisterTUIFlag()

RegisterTUIFlag registers the --tui launch flag through RegisterLaunchMode (the registration `suve --gui` shares). On --tui the hook resolves the provider + scope and short-circuits into the TUI, so it is registered here in the untagged commands package (unlike --gui there is no tagged stub split). Call it from main after registerGUIFlag so the --tui wrapper sits outermost.

Types

type LaunchMode added in v1.10.0

type LaunchMode struct {
	// Flag is the launch flag name ("tui" or "gui").
	//
	//declscope:ignore overexported // cmd/suve/gui.go sets it behind production || dev
	Flag string
	// RootUsage is the root flag's usage text.
	//
	//declscope:ignore overexported // cmd/suve/gui.go sets it behind production || dev
	RootUsage string
	// GroupUsage is the usage text on each provider group and service subgroup.
	//
	//declscope:ignore overexported // cmd/suve/gui.go sets it behind production || dev
	GroupUsage string
	// Bare launches from the root flag (`suve --<flag>`). It resolves the
	// provider from the environment itself.
	//
	//declscope:ignore overexported // cmd/suve/gui.go sets it behind production || dev
	Bare func(ctx context.Context) (context.Context, error)
	// Launch launches from a provider group or service subgroup. scope carries
	// the provider and the scope flags given on that command (not yet hydrated
	// from the environment; see detect.HydrateScope). service is "param" or
	// "secret" for a service subgroup, or "" for a group.
	//
	//declscope:ignore overexported // cmd/suve/gui.go sets it behind production || dev
	Launch func(ctx context.Context, scope provider.Scope, service string) (context.Context, error)
}

LaunchMode describes a UI that the CLI launches from a flag: `suve tui` via --tui and `suve gui` via --gui. RegisterLaunchMode attaches the flag the same way for both, so the provider groups, the service subgroups, and the launch scope stay in step.

Directories

Path Synopsis
aws
Package aws provides the "suve aws" command group: the explicit, always-present home for the AWS backends (Parameter Store, Secrets Manager, and staging for both).
Package aws provides the "suve aws" command group: the explicit, always-present home for the AWS backends (Parameter Store, Secrets Manager, and staging for both).
internal
Package internal holds the AWS store and staging-scope wiring that the aws param, secret and stage command packages share.
Package internal holds the AWS store and staging-scope wiring that the aws param, secret and stage command packages share.
param
Package param provides CLI commands for AWS SSM Parameter Store.
Package param provides CLI commands for AWS SSM Parameter Store.
secret
Package secret provides CLI commands for AWS Secrets Manager.
Package secret provides CLI commands for AWS Secrets Manager.
Package azure provides CLI commands for Microsoft Azure, exposed as the "suve azure secret <op>" (Key Vault) and "suve azure param <op>" (App Configuration) command groups.
Package azure provides CLI commands for Microsoft Azure, exposed as the "suve azure secret <op>" (Key Vault) and "suve azure param <op>" (App Configuration) command groups.
internal
Package internal holds the Azure scope context, stores and staging-scope wiring that the azure param (App Configuration), secret (Key Vault) and stage command packages share.
Package internal holds the Azure scope context, stores and staging-scope wiring that the azure param (App Configuration), secret (Key Vault) and stage command packages share.
param
Package param provides CLI commands for Azure App Configuration, exposed as the "suve azure param <op>" command group.
Package param provides CLI commands for Azure App Configuration, exposed as the "suve azure param <op>" command group.
secret
Package secret provides CLI commands for Azure Key Vault secrets, exposed as the "suve azure secret <op>" command group.
Package secret provides CLI commands for Azure Key Vault secrets, exposed as the "suve azure secret <op>" command group.
Package gcloud provides CLI commands for Google Cloud Secret Manager, exposed as the "suve gcloud secret <op>" command group plus the "suve gcloud stage <op>" staging workflow.
Package gcloud provides CLI commands for Google Cloud Secret Manager, exposed as the "suve gcloud secret <op>" command group plus the "suve gcloud stage <op>" staging workflow.
internal
Package internal holds the Google Cloud project context, store and staging-scope wiring that the gcloud command group, its secret package and its stage commands share.
Package internal holds the Google Cloud project context, store and staging-scope wiring that the gcloud command group, its secret package and its stage commands share.
secret
Package secret provides CLI commands for Google Cloud Secret Manager, exposed as the "suve gcloud secret <op>" command group.
Package secret provides CLI commands for Google Cloud Secret Manager, exposed as the "suve gcloud secret <op>" command group.
Package generic provides the provider-neutral command scaffolding shared by every provider: show, log, diff, list, tag and untag.
Package generic provides the provider-neutral command scaffolding shared by every provider: show, log, diff, list, tag and untag.
Package internal provides shared utilities for CLI commands.
Package internal provides shared utilities for CLI commands.
apptest
Package apptest provides helpers for constructing the CLI app with a deterministic provider-detection result, so command tests do not depend on the ambient environment (which decides the top-level param/secret aliases).
Package apptest provides helpers for constructing the CLI app with a deterministic provider-detection result, so command tests do not depend on the ambient environment (which decides the top-level param/secret aliases).

Jump to

Keyboard shortcuts

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