init

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 8 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, prompter Prompter, fw claude.FileWriter) error

RunInit orchestrates the init wizard.

Types

type Prompter

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

Prompter abstracts TUI interactions for testability.

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.

Jump to

Keyboard shortcuts

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