setup

package
v0.0.0-...-dfbe3fe Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SetupCmd = &cobra.Command{
	Use:   "setup",
	Short: "Initialize the default config file",
	Args:  cobra.NoArgs,
	RunE: func(cmd *cobra.Command, args []string) error {
		path, err := Run(Options{
			Force:   force,
			Prompts: terminalPrompts{},
		})
		if err != nil {
			return err
		}
		fmt.Fprintf(cmd.OutOrStdout(), "Config written to %s\n", path)
		return nil
	},
}

SetupCmd initializes the default config file.

Functions

func Run

func Run(opts Options) (string, error)

func SetConfigTemplate

func SetConfigTemplate(bs []byte)

Types

type Options

type Options struct {
	Force      bool
	TargetPath string
	Prompts    Prompts
}

type Prompts

type Prompts interface {
	ReadLine(prompt string) (string, error)
	ReadPassword(prompt string) (string, error)
}

Jump to

Keyboard shortcuts

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