github

package
v1.10.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package github provides GitHub-specific setup helpers including token resolution from configuration and environment, and authenticated HTTP client construction for use with the GitHub API.

Index

Constants

This section is empty.

Variables

View Source
var (
	GitHubHost = "github.com"
)

Functions

func ConfigureSSHKey

func ConfigureSSHKey(props *props.Props, cfg config.Containable, opts ...ConfigureSSHKeyOption) (string, string, error)

ConfigureSSHKey runs the interactive SSH key configuration flow.

func NewCmdInitGitHub

func NewCmdInitGitHub(p *props.Props) *cobra.Command

NewCmdInitGitHub creates the `init github` subcommand.

func RunGitHubInit

func RunGitHubInit(p *props.Props, cfg config.Containable) error

RunGitHubInit forcibly runs both login and SSH configuration regardless of current state. This is used by the explicit `init github` command.

func RunInitCmd

func RunInitCmd(p *props.Props, dir string) error

RunInitCmd executes the GitHub configuration and writes the results to the config file.

Types

type ConfigureSSHKeyOption

type ConfigureSSHKeyOption func(*configureSSHKeyConfig)

ConfigureSSHKeyOption is a functional option for ConfigureSSHKey.

func WithGenerateKeyOptions

func WithGenerateKeyOptions(opts ...GenerateKeyOption) ConfigureSSHKeyOption

WithGenerateKeyOptions passes options through to the key generation step.

func WithSSHKeyPathForm

func WithSSHKeyPathForm(creator func(*string) *huh.Form) ConfigureSSHKeyOption

WithSSHKeyPathForm overrides the SSH key path input form (for testing).

func WithSSHKeySelectForm

func WithSSHKeySelectForm(creator func(*string, []huh.Option[string]) *huh.Form) ConfigureSSHKeyOption

WithSSHKeySelectForm overrides the SSH key selection form (for testing).

type GenerateKeyOption

type GenerateKeyOption func(*generateKeyConfig)

GenerateKeyOption is a functional option for SSH key generation.

func WithPassphraseForm

func WithPassphraseForm(creator func(*string) *huh.Form) GenerateKeyOption

WithPassphraseForm overrides the passphrase input form (for testing).

func WithUploadConfirmForm

func WithUploadConfirmForm(creator func(*bool) *huh.Form) GenerateKeyOption

WithUploadConfirmForm overrides the upload confirmation form (for testing).

type GitHubInitialiser

type GitHubInitialiser struct {
	SkipLogin bool
	SkipKey   bool
}

GitHubInitialiser handles both GitHub authentication and SSH key configuration.

func NewGitHubInitialiser

func NewGitHubInitialiser(p *props.Props, skipLogin, skipKey bool) *GitHubInitialiser

NewGitHubInitialiser creates a new GitHubInitialiser and mounts its assets.

func (*GitHubInitialiser) Configure

func (g *GitHubInitialiser) Configure(props *props.Props, cfg config.Containable) error

Configure runs the interactive login and/or SSH configuration.

func (*GitHubInitialiser) IsConfigured

func (g *GitHubInitialiser) IsConfigured(cfg config.Containable) bool

IsConfigured returns true if unskipped components are already present in the config.

func (*GitHubInitialiser) Name

func (g *GitHubInitialiser) Name() string

Jump to

Keyboard shortcuts

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