Documentation
¶
Index ¶
- Variables
- func BuildReplacements(oldProj, newProj, oldClaude, newClaude string) []replacement
- func DiscoverSessionIDs(projectDir string) []string
- func EncodePath(path string) string
- func EnvVarName(prefix, instanceName, suffix string) string
- func GenerateConfig(instances []serviceInstance) (string, error)
- func RunInit(w io.Writer, steps []WizardStep, fw claude.FileWriter) error
- func StackToLspBinary() map[string]string
- type AgentInstallPrompter
- type ClaudeMigratePrompter
- type DevcontainerPrompter
- type LspInstaller
- type LspPlugin
- type LspPrompter
- type OSLspInstaller
- type OSPathLooker
- type PathLooker
- type Prerequisite
- type Prompter
- type ServiceType
- type ServicesPrompter
- type StackType
- type VaultPrompter
- type WizardState
- type WizardStep
- func NewAgentInstallStep(p AgentInstallPrompter) WizardStep
- func NewClaudeMigrateStep(p ClaudeMigratePrompter) WizardStep
- func NewDevcontainerStep(p DevcontainerPrompter, state *WizardState) WizardStep
- func NewLspSetupStep(p LspPrompter, installer LspInstaller, state *WizardState) WizardStep
- func NewPrerequisitesStep(looker PathLooker) WizardStep
- func NewProjectConfigStep(state *WizardState) WizardStep
- func NewServicesStep(p ServicesPrompter) WizardStep
- func NewVaultStep(p VaultPrompter, state *WizardState) WizardStep
Constants ¶
This section is empty.
Variables ¶
var DefaultProxyDomains = []string{
"*.github.com",
"api.openai.com",
"claude.ai",
"*.googleapis.com",
"*.githubusercontent.com",
"*.claude.com",
"*.anthropic.com",
}
DefaultProxyDomains provides a sensible allowlist for new projects.
Functions ¶
func BuildReplacements ¶
func BuildReplacements(oldProj, newProj, oldClaude, newClaude string) []replacement
BuildReplacements creates the replacement pairs sorted longest-first to prevent substring collisions during rewriting.
func DiscoverSessionIDs ¶
DiscoverSessionIDs reads JSONL filenames from a project directory to find session IDs.
func EncodePath ¶
EncodePath converts an absolute path to the Claude project key format. /home/user/src/foo → -home-user-src-foo
func EnvVarName ¶
EnvVarName returns the env var name for a given service instance and suffix.
func GenerateConfig ¶
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.
func StackToLspBinary ¶
StackToLspBinary maps devcontainer feature keys to LSP binary names from LspRegistry. Used to auto-select LSP plugins when language stacks are already chosen in the devcontainer step.
Types ¶
type AgentInstallPrompter ¶
AgentInstallPrompter abstracts TUI interactions for the agent install step.
type ClaudeMigratePrompter ¶
type ClaudeMigratePrompter interface {
ConfirmMigrateClaude() (bool, error)
PromptContainerPath(detected string) (string, error)
}
ClaudeMigratePrompter abstracts TUI interactions for the Claude migration step.
type DevcontainerPrompter ¶
type DevcontainerPrompter interface {
ConfirmDevcontainer() (bool, error)
ConfirmOverwriteDevcontainer() (bool, error)
ConfirmProxy() (bool, error)
ConfirmIntercept() (bool, error)
SelectStacks(available []StackType) ([]StackType, error)
}
DevcontainerPrompter abstracts TUI interactions for the devcontainer step.
type LspInstaller ¶
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 ¶
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.
type LspPrompter ¶
LspPrompter abstracts TUI interactions for the LSP setup step.
type OSLspInstaller ¶
type OSLspInstaller struct{}
OSLspInstaller implements LspInstaller using os/exec.
func (OSLspInstaller) EnsureMarketplace ¶
func (OSLspInstaller) EnsureMarketplace(repo string) error
EnsureMarketplace adds a marketplace to Claude Code if not already present.
func (OSLspInstaller) Install ¶
func (OSLspInstaller) Install(cmd string) error
Install runs the given install command for an LSP binary.
func (OSLspInstaller) InstallPlugin ¶
func (OSLspInstaller) InstallPlugin(pluginID string) error
InstallPlugin installs a Claude Code plugin via the claude CLI.
func (OSLspInstaller) IsInstalled ¶
func (OSLspInstaller) IsInstalled(binary string) bool
IsInstalled checks whether the given binary is on PATH.
type OSPathLooker ¶
type OSPathLooker struct{}
OSPathLooker implements PathLooker using the real os/exec.LookPath.
type PathLooker ¶
PathLooker abstracts exec.LookPath for testability.
type Prerequisite ¶
type Prerequisite struct {
Binary string // binary name to look up on PATH
Purpose string // short description of why it's needed
InstallURL string // URL with install instructions
}
Prerequisite describes a required external tool.
func PrerequisiteRegistry ¶
func PrerequisiteRegistry() []Prerequisite
PrerequisiteRegistry returns all required prerequisites for human.
type Prompter ¶
type Prompter interface {
ServicesPrompter
VaultPrompter
DevcontainerPrompter
ClaudeMigratePrompter
LspPrompter
AgentInstallPrompter
}
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 ¶
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 ¶
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 ¶
func StackRegistry() []StackType
StackRegistry returns all available language stacks.
type VaultPrompter ¶
type VaultPrompter interface {
SelectVaultProvider(available []string) (string, error)
PromptVaultAccount() (string, error)
}
VaultPrompter abstracts TUI interactions for the vault setup step.
type WizardState ¶
type WizardState struct {
SelectedStacks []StackType
ProxyEnabled bool
InterceptEnabled bool
VaultProvider string // e.g. "1password", empty if none
VaultAccount string // e.g. 1Password account name
}
WizardState holds data shared between wizard steps. It is passed by pointer so that earlier steps can populate fields that later steps consume.
type WizardStep ¶
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 ¶
func NewAgentInstallStep(p AgentInstallPrompter) WizardStep
NewAgentInstallStep creates a WizardStep that optionally installs Claude Code integration.
func NewClaudeMigrateStep ¶
func NewClaudeMigrateStep(p ClaudeMigratePrompter) WizardStep
NewClaudeMigrateStep creates a WizardStep that migrates Claude Code session data for use inside a devcontainer with a different project path.
func NewDevcontainerStep ¶
func NewDevcontainerStep(p DevcontainerPrompter, state *WizardState) WizardStep
NewDevcontainerStep creates a WizardStep that optionally generates .devcontainer/devcontainer.json.
func NewLspSetupStep ¶
func NewLspSetupStep(p LspPrompter, installer LspInstaller, state *WizardState) WizardStep
NewLspSetupStep creates a WizardStep that sets up LSP servers for Claude Code.
func NewPrerequisitesStep ¶
func NewPrerequisitesStep(looker PathLooker) WizardStep
NewPrerequisitesStep creates a WizardStep that checks for required external tools.
func NewProjectConfigStep ¶
func NewProjectConfigStep(state *WizardState) WizardStep
NewProjectConfigStep creates a WizardStep that ensures .humanconfig.yaml has a project: field, devcontainer: section, and proxy: section for agent readiness.
func NewServicesStep ¶
func NewServicesStep(p ServicesPrompter) WizardStep
NewServicesStep creates a WizardStep that configures services and writes .humanconfig.yaml.
func NewVaultStep ¶
func NewVaultStep(p VaultPrompter, state *WizardState) WizardStep
NewVaultStep creates a WizardStep that optionally configures a vault provider.