Documentation
¶
Overview ¶
Package wizard implements the interactive TUI setup wizard for ExitBox.
Index ¶
- Variables
- func ComputeExternalToolPackages(names []string) []string
- func ComputePackages(categories []string) []string
- func ComputeProfiles(roleNames []string, languages []string) []string
- func DetectExternalToolConfigs() map[string][]string
- type AgentOption
- type Binary
- type ExternalTool
- type ExternalToolConfig
- type Language
- type Model
- type Role
- type SetupResult
- type State
- type Step
- type ToolCategory
- type WorkspaceCreationResult
Constants ¶
This section is empty.
Variables ¶
var AllAgents = []AgentOption{
{Name: "claude", DisplayName: "Claude Code", Description: "Anthropic's AI coding assistant"},
{Name: "codex", DisplayName: "OpenAI Codex", Description: "OpenAI's coding CLI"},
{Name: "opencode", DisplayName: "OpenCode", Description: "Open-source AI code assistant"},
}
AllAgents defines the selectable agents.
var AllExternalTools = []ExternalTool{ { Name: "GitHub CLI", Description: "gh — GitHub from the command line", Packages: []string{"github-cli"}, Configs: []ExternalToolConfig{ {HostPath: ".config/gh", Description: "GitHub CLI auth"}, }, }, }
AllExternalTools defines the available external tools.
var AllLanguages = []Language{
{Name: "Go", Profile: "go"},
{Name: "Python", Profile: "python"},
{Name: "Node/JS", Profile: "node"},
{Name: "Rust", Profile: "rust"},
{Name: "Java", Profile: "java"},
{Name: "Ruby", Profile: "ruby"},
{Name: "PHP", Profile: "php"},
{Name: "C/C++", Profile: "c"},
{Name: "Flutter/Dart", Profile: "flutter"},
}
AllLanguages defines the available language choices.
var AllToolCategories = []ToolCategory{ {Name: "Build Tools", Packages: []string{"cmake", "samurai", "autoconf", "automake", "libtool"}}, {Name: "Shell Utils", Packages: []string{"rsync", "openssh-client", "mandoc", "gnupg", "file"}}, {Name: "Networking", Packages: []string{"iptables", "ipset", "iproute2", "bind-tools"}}, {Name: "Database", Packages: []string{"postgresql16-client", "mariadb-client", "sqlite", "redis"}}, {Name: "Kubernetes", Packages: []string{"kubectl", "helm", "k9s", "kustomize"}, Binaries: []Binary{ {Name: "kind", URLPattern: "https://kind.sigs.k8s.io/dl/latest/kind-linux-{arch}"}, {Name: "kubeseal", URLPattern: "https://github.com/bitnami-labs/sealed-secrets/releases/latest/download/kubeseal-linux-{arch}"}, }}, {Name: "DevOps", Packages: []string{"docker-cli", "docker-cli-compose", "opentofu"}}, {Name: "Web", Packages: []string{"nginx", "apache2-utils", "httpie"}}, {Name: "Security", Packages: []string{"nmap", "tcpdump", "netcat-openbsd"}}, }
AllToolCategories defines the available tool category choices.
var Roles = []Role{ { Name: "Frontend", Description: "Web frontend development", Profiles: []string{"node", "web", "build-tools"}, Languages: []string{"Node/JS"}, ToolCategories: []string{"Build Tools", "Web"}, }, { Name: "Backend", Description: "Server-side development", Profiles: []string{"python", "database", "build-tools"}, Languages: []string{"Python", "Go"}, ToolCategories: []string{"Build Tools", "Database"}, }, { Name: "Fullstack", Description: "Full-stack web development", Profiles: []string{"node", "python", "database", "web", "build-tools"}, Languages: []string{"Node/JS", "Python"}, ToolCategories: []string{"Build Tools", "Database", "Web"}, }, { Name: "DevOps", Description: "Infrastructure and operations", Profiles: []string{"devops", "node", "networking", "shell", "build-tools"}, Languages: []string{"Go", "Python", "Node/JS"}, ToolCategories: []string{"Build Tools", "Networking", "DevOps", "Shell Utils"}, }, { Name: "Kubernetes", Description: "Kubernetes development and operations", Profiles: []string{"kubernetes", "devops", "networking", "shell", "build-tools"}, Languages: []string{"Go", "Python"}, ToolCategories: []string{"Build Tools", "Networking", "Kubernetes", "DevOps", "Shell Utils"}, }, { Name: "Data Science", Description: "Data analysis and machine learning", Profiles: []string{"python", "datascience", "database"}, Languages: []string{"Python"}, ToolCategories: []string{"Database"}, }, { Name: "Mobile", Description: "Mobile application development", Profiles: []string{"flutter", "node"}, Languages: []string{"Flutter/Dart", "Node/JS"}, ToolCategories: []string{"Build Tools"}, }, { Name: "Embedded", Description: "Embedded systems and IoT", Profiles: []string{"c", "embedded", "build-tools"}, Languages: []string{"C/C++", "Rust"}, ToolCategories: []string{"Build Tools"}, }, { Name: "Security", Description: "Security research and tooling", Profiles: []string{"security", "networking", "shell"}, Languages: []string{"Python", "Go"}, ToolCategories: []string{"Networking", "Security", "Shell Utils"}, }, }
Roles defines the available developer roles.
Functions ¶
func ComputeExternalToolPackages ¶ added in v0.1.9
ComputeExternalToolPackages computes Alpine packages from selected external tools.
func ComputePackages ¶
ComputePackages computes Alpine packages from selected tool categories.
func ComputeProfiles ¶
ComputeProfiles computes the profile list from roles + language selections.
func DetectExternalToolConfigs ¶ added in v0.1.9
DetectExternalToolConfigs checks $HOME for known external tool config directories and returns a map of tool name → detected host paths.
Types ¶
type AgentOption ¶
AgentOption represents a selectable agent.
type Binary ¶
type Binary struct {
Name string // Binary name (installed to /usr/local/bin)
URLPattern string // Download URL with {arch} placeholder (amd64/arm64)
}
Binary represents a tool installed via direct download rather than apk.
func ComputeBinaries ¶
ComputeBinaries computes extra binary downloads from selected tool categories.
type ExternalTool ¶ added in v0.1.9
type ExternalTool struct {
Name string
Description string
Packages []string // Alpine APK packages
Configs []ExternalToolConfig // Host configs to detect (for UI hints)
}
ExternalTool represents an installable external tool with host config detection.
type ExternalToolConfig ¶ added in v0.1.9
type ExternalToolConfig struct {
HostPath string // relative to $HOME, e.g. ".config/gh"
Description string // shown when detected
}
ExternalToolConfig describes a host config directory that hints at tool usage.
type Language ¶
type Language struct {
Name string // Display name
Profile string // Maps to an exitbox profile name
}
Language represents a selectable programming language.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root bubbletea model for the wizard.
func NewModelFromConfig ¶ added in v0.1.1
NewModelFromConfig creates a wizard model pre-populated from existing config.
func NewWorkspaceModelFromConfig ¶ added in v0.1.1
NewWorkspaceModelFromConfig creates a blank wizard model for creating one workspace. It intentionally does not inherit role/language/settings selections.
type Role ¶
type Role struct {
Name string
Description string
Profiles []string // Default profiles to activate
Languages []string // Pre-checked language names in language step
ToolCategories []string // Pre-checked tool category names in tools step
}
Role represents a developer role with preset defaults.
type SetupResult ¶ added in v0.1.3
type SetupResult struct {
WorkspaceName string // the workspace that was created/edited
CopyFrom string // workspace to copy credentials from ("__host__" = import from host, "" = skip)
IsDefault bool // true if this workspace is the default
Agents []string // enabled agent names (e.g. ["claude", "codex"])
VaultEnabled bool // enable encrypted vault for secrets
VaultReadOnly bool // vault is read-only (agents cannot store new secrets)
VaultPassword string // vault encryption password (non-empty when VaultEnabled)
}
SetupResult holds post-wizard actions for the caller to execute.
type State ¶
type State struct {
Roles []string
Languages []string
ToolCategories []string
CustomPackages []string // user-selected extra Alpine packages
WorkspaceName string
MakeDefault bool
DefaultWorkspace string // set when d is toggled on workspace select screen
Agents []string
AutoUpdate bool
StatusBar bool
EnableFirewall bool
AutoResume bool
PassEnv bool
ReadOnly bool
OriginalDevelopment []string // non-nil when editing an existing workspace
DomainCategories []domainCategory // editable allowlist categories
CopyFrom string // workspace to copy credentials from (empty = none)
VaultEnabled bool // enable encrypted vault for secrets
VaultReadOnly bool // vault is read-only (agents cannot store new secrets)
VaultPassword string // vault encryption password (set during wizard init)
Keybindings map[string]string // configurable keybindings (e.g. "workspace_menu" -> "C-M-p")
ExternalTools []string // selected external tools (e.g. "GitHub CLI")
FullGitSupport bool // full git support (SSH agent + .gitconfig)
RTK bool // experimental: token-optimized CLI wrappers
}
State holds accumulated user selections across wizard steps.
type ToolCategory ¶
type ToolCategory struct {
Name string // Display name
Packages []string // Alpine packages in this category
Binaries []Binary // Extra binaries to download (not available via apk)
}
ToolCategory represents a selectable tool category.
type WorkspaceCreationResult ¶ added in v0.1.3
type WorkspaceCreationResult struct {
Workspace *config.Workspace
MakeDefault bool
CopyFrom string // workspace to copy credentials from (empty = none)
VaultEnabled bool // enable encrypted vault for secrets
VaultReadOnly bool // vault is read-only (agents cannot store new secrets)
VaultPassword string // vault encryption password (non-empty when VaultEnabled)
}
WorkspaceCreationResult holds the result of the workspace creation wizard.
func RunWorkspaceCreation ¶ added in v0.1.1
func RunWorkspaceCreation(existingCfg *config.Config, workspaceName string) (*WorkspaceCreationResult, error)
RunWorkspaceCreation runs the wizard from step 1 and returns a configured workspace.