cli

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package cli implements the command-line interface for envprof.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff added in v0.0.9

func Diff(options *Options) *cobra.Command

Diff returns the cobra command for diffing profiles.

func EnvProf added in v0.0.9

func EnvProf(options *Options) (*envprof.EnvProf, error)

EnvProf returns the envprof instance, resolving only the file path.

func Exec added in v0.0.6

func Exec(options *Options) *cobra.Command

Exec returns the cobra command for executing a command with the active environment.

func Execute

func Execute(version string) error

Execute runs the root command for the envprof CLI application.

func Export

func Export(options *Options) *cobra.Command

Export defines the command for exporting a profile's variables.

func List

func List(options *Options) *cobra.Command

List returns the cobra command for listing profiles and their variables.

func LoadEnvProf added in v0.0.9

func LoadEnvProf(options *Options) (*envprof.EnvProf, error)

LoadEnvProf returns the loaded envprof instance.

func LoadPlan added in v0.0.9

func LoadPlan(options *Options) (profiles.Profiles, string, step.Steps, error)

LoadPlan returns the plan for the specified profile.

func LoadProfile added in v0.0.9

func LoadProfile(options *Options) (environment.Environment, error)

LoadProfile returns the loaded and resolved profile.

func LoadProfiles added in v0.0.9

func LoadProfiles(options *Options) (profiles.Profiles, error)

LoadProfiles returns the existing profiles.

func Merge added in v0.0.10

func Merge(profile, environment env.Env, isolate, path bool, envs []string) env.Env

Merge merges the profile and environment based on isolation settings.

func Path added in v0.0.9

func Path(options *Options) *cobra.Command

Path returns the cobra command for displaying the path to the configuration file used.

func Profiles added in v0.0.8

func Profiles(options *Options) *cobra.Command

Profiles returns the cobra command for listing profiles.

func Shell added in v0.0.1

func Shell(options *Options) *cobra.Command

Shell returns the cobra command for entering a scoped shell with the active environment.

func UnknownSubcommandAction added in v0.0.8

func UnknownSubcommandAction(cmd *cobra.Command, args []string) error

UnknownSubcommandAction handles unknown cobra subcommands. Implements cobra.Command.RunE to provide helpful error messages and suggestions when an unknown subcommand is used. Required when TraverseChildren is true, as this disables cobra's built-in suggestion system. See: - https://github.com/spf13/cobra/issues/981 - https://github.com/containerd/nerdctl/blob/242e6fc6e861b61b878bd7df8bf25e95674c036d/cmd/nerdctl/main.go#L401-L418

func Write added in v0.0.6

func Write(options *Options) *cobra.Command

Write defines the command for writing profile variables to one or multiple dotenv files.

Types

type Options added in v0.0.8

type Options struct {
	// EnvProf is the list of candidate profile files to load.
	EnvProf []string
	// Profile is the selected profile.
	Profile string
	// Verbose enables verbose output.
	Verbose bool
	// Overlay contains the profiles to overlay on top of the current profile.
	Overlay []string
}

Options represents the root level configuration for the CLI application.

Jump to

Keyboard shortcuts

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