init

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvVarName

func EnvVarName(prefix, instanceName, suffix string) string

EnvVarName returns the env var name for a given service instance and suffix.

func GenerateConfig

func GenerateConfig(instances []serviceInstance) (string, error)

GenerateConfig produces the YAML config from collected service instances.

func RunInit

func RunInit(w io.Writer, steps []WizardStep, fw claude.FileWriter) error

RunInit orchestrates the init wizard by running each step in sequence. Follow-up hints from all steps are printed after the final "Done!" line.

Types

type AgentInstallPrompter added in v0.9.0

type AgentInstallPrompter interface {
	ConfirmAgentInstall() (bool, error)
}

AgentInstallPrompter abstracts TUI interactions for the agent install step.

type DevcontainerPrompter added in v0.9.0

type DevcontainerPrompter interface {
	ConfirmDevcontainer() (bool, error)
	ConfirmOverwriteDevcontainer() (bool, error)
	ConfirmProxy() (bool, error)
	SelectStacks(available []StackType) ([]StackType, error)
}

DevcontainerPrompter abstracts TUI interactions for the devcontainer step.

type LspInstaller added in v0.13.0

type LspInstaller interface {
	IsInstalled(binary string) bool
	Install(cmd string) error
	InstallPlugin(pluginID string) error
	EnsureMarketplace(repo string) error
}

LspInstaller abstracts checking/installing LSP binaries and Claude Code plugins.

type LspPlugin added in v0.13.0

type LspPlugin struct {
	Label       string // display name, e.g. "gopls (Go)"
	PluginID    string // e.g. "gopls@claude-code-lsps"
	Binary      string // binary name to check on PATH
	InstallCmd  string // auto-install command for the LSP binary (empty = manual only)
	InstallHint string // manual install hint for the LSP binary
}

LspPlugin describes an LSP server and its Claude Code plugin.

func LspRegistry added in v0.13.0

func LspRegistry() []LspPlugin

LspRegistry returns all available LSP plugins.

type LspPrompter added in v0.13.0

type LspPrompter interface {
	ConfirmLspSetup() (bool, error)
	SelectLspPlugins(available []LspPlugin) ([]LspPlugin, error)
}

LspPrompter abstracts TUI interactions for the LSP setup step.

type OSLspInstaller added in v0.13.0

type OSLspInstaller struct{}

OSLspInstaller implements LspInstaller using os/exec.

func (OSLspInstaller) EnsureMarketplace added in v0.13.0

func (OSLspInstaller) EnsureMarketplace(repo string) error

EnsureMarketplace adds a marketplace to Claude Code if not already present.

func (OSLspInstaller) Install added in v0.13.0

func (OSLspInstaller) Install(cmd string) error

Install runs the given install command for an LSP binary.

func (OSLspInstaller) InstallPlugin added in v0.13.0

func (OSLspInstaller) InstallPlugin(pluginID string) error

InstallPlugin installs a Claude Code plugin via the claude CLI.

func (OSLspInstaller) IsInstalled added in v0.13.0

func (OSLspInstaller) IsInstalled(binary string) bool

IsInstalled checks whether the given binary is on PATH.

type Prompter

Prompter is a composite interface embedding all step-specific prompter interfaces.

type ServiceType

type ServiceType struct {
	Label       string   // display name, e.g. "Jira"
	ConfigKey   string   // YAML top-level key, e.g. "jiras"
	DefaultURL  string   // empty means user must provide it
	URLRequired bool     // if true and DefaultURL is empty, prompt for URL
	ExtraFields []string // additional fields beyond name+description, e.g. "user", "org"
	EnvVars     []string // env var suffixes, e.g. ["KEY"] → JIRA_{NAME}_KEY
	EnvPrefix   string   // e.g. "JIRA"
}

ServiceType describes a configurable service with its YAML key, defaults, and env var pattern.

func ServiceRegistry

func ServiceRegistry() []ServiceType

ServiceRegistry returns all available services.

type ServicesPrompter added in v0.9.0

type ServicesPrompter interface {
	ConfirmOverwrite() (bool, error)
	ConfirmAddTrackers() (bool, error)
	SelectServices(available []ServiceType) ([]ServiceType, error)
	PromptInstance(svc ServiceType) (map[string]string, error)
}

ServicesPrompter abstracts TUI interactions for the services step.

type StackType added in v0.9.0

type StackType struct {
	Label      string // display name, e.g. "Go"
	FeatureKey string // devcontainer feature reference, e.g. "ghcr.io/devcontainers/features/go:1"
	Fixed      bool   // always included, cannot be deselected (shown as pre-checked)
}

StackType describes a language stack that can be added as a devcontainer feature.

func StackRegistry added in v0.9.0

func StackRegistry() []StackType

StackRegistry returns all available language stacks.

type WizardStep added in v0.9.0

type WizardStep interface {
	Name() string
	Run(w io.Writer, fw claude.FileWriter) (hints []string, err error)
}

WizardStep is a self-contained phase of the init wizard. Run returns optional follow-up hints (e.g. install instructions) to be printed after the wizard finishes, plus any error.

func NewAgentInstallStep added in v0.9.0

func NewAgentInstallStep(p AgentInstallPrompter) WizardStep

NewAgentInstallStep creates a WizardStep that optionally installs Claude Code integration.

func NewDevcontainerStep added in v0.9.0

func NewDevcontainerStep(p DevcontainerPrompter) WizardStep

NewDevcontainerStep creates a WizardStep that optionally generates .devcontainer/devcontainer.json.

func NewLspSetupStep added in v0.13.0

func NewLspSetupStep(p LspPrompter, installer LspInstaller) WizardStep

NewLspSetupStep creates a WizardStep that sets up LSP servers for Claude Code.

func NewServicesStep added in v0.9.0

func NewServicesStep(p ServicesPrompter) WizardStep

NewServicesStep creates a WizardStep that configures services and writes .humanconfig.yaml.

Jump to

Keyboard shortcuts

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