init

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package init provides the project initialization subcommand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitProtocolCompletions added in v0.6.0

func GitProtocolCompletions() []cobra.Completion

GitProtocolCompletions returns cobra completions for the --git-protocol flag.

func GitProtocolNames added in v0.6.0

func GitProtocolNames() []string

GitProtocolNames returns valid protocol names for error messages.

func IsValidGitProtocol added in v0.6.0

func IsValidGitProtocol(s string) bool

IsValidGitProtocol checks if a string is a valid --git-protocol value.

func IsValidVCSProvider added in v0.6.0

func IsValidVCSProvider(s string) bool

IsValidVCSProvider checks if a string is a valid --vcs value.

func NewCmdProjectInit

func NewCmdProjectInit(f *cmdutil.Factory, runF func(context.Context, *ProjectInitOptions) error) *cobra.Command

NewCmdProjectInit creates the project init command.

func PresetCompletions added in v0.6.0

func PresetCompletions() []cobra.Completion

PresetCompletions builds cobra.Completion values from config.Presets() for shell completion of the --preset flag.

func Run added in v0.2.0

func Run(ctx context.Context, opts *ProjectInitOptions) error

Run executes the project init command logic.

func VCSCompletions added in v0.6.0

func VCSCompletions() []cobra.Completion

VCSCompletions returns cobra completions for the --vcs flag.

func VCSProviderNames added in v0.6.0

func VCSProviderNames() []string

VCSProviderNames returns valid provider names for error messages.

Types

type ProjectInitOptions

type ProjectInitOptions struct {
	IOStreams      *iostreams.IOStreams
	TUI            *tui.TUI
	Config         func() (config.Config, error)
	Logger         func() (*logger.Logger, error)
	ProjectManager func() (project.ProjectManager, error)

	Name        string // Positional arg: project name
	Preset      string // --preset flag: select a preset by name
	VCS         string // --vcs flag: github|gitlab|bitbucket
	GitProtocol string // --git-protocol flag: https|ssh
	NoGPG       bool   // --no-gpg flag: disable GPG forwarding
	Force       bool
	Yes         bool // Non-interactive mode
}

ProjectInitOptions contains the options for the project init command.

Jump to

Keyboard shortcuts

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