wizard

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package wizard implements the interactive TUI setup wizard for ExitBox.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

View Source
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: "DevOps", Packages: []string{"docker-cli", "docker-cli-compose", "kubectl", "helm", "opentofu"}, Binaries: []Binary{
		{Name: "kind", URLPattern: "https://kind.sigs.k8s.io/dl/latest/kind-linux-{arch}"},
	}},
	{Name: "Web", Packages: []string{"nginx", "apache2-utils", "httpie"}},
	{Name: "Security", Packages: []string{"nmap", "tcpdump", "netcat-openbsd"}},
}

AllToolCategories defines the available tool category choices.

View Source
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:           "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 ComputePackages

func ComputePackages(categories []string) []string

ComputePackages computes Alpine packages from selected tool categories.

func ComputeProfiles

func ComputeProfiles(roleNames []string, languages []string) []string

ComputeProfiles computes the profile list from roles + language selections.

func Run

func Run() error

Run executes the setup wizard TUI and writes config files on completion. Returns nil on success, error if cancelled or write fails.

Types

type AgentOption

type AgentOption struct {
	Name        string
	DisplayName string
	Description string
}

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

func ComputeBinaries(categories []string) []Binary

ComputeBinaries computes extra binary downloads from selected tool categories.

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 NewModel

func NewModel() Model

NewModel creates a new wizard model.

func (Model) Cancelled

func (m Model) Cancelled() bool

Cancelled returns true if the user cancelled the wizard.

func (Model) Confirmed

func (m Model) Confirmed() bool

Confirmed returns true if the user confirmed their selections.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Result

func (m Model) Result() State

Result returns the final wizard state.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

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.

func GetRole

func GetRole(name string) *Role

GetRole returns the role by name, or nil.

type State

type State struct {
	Roles          []string
	Languages      []string
	ToolCategories []string
	Agents         []string
}

State holds accumulated user selections across wizard steps.

type Step

type Step int

Step identifies the current wizard step.

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.

Jump to

Keyboard shortcuts

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