tui

package
v0.0.0-...-e7aa5da Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateAutoUpdateMenu = iota
	StateAutoUpdateLanguages
	StateAutoUpdateKeys
	StateAutoUpdateCheck       // Checking git
	StateAutoUpdateSummarizing // Generating AI summary
	StateAutoUpdateReview      // Reviewing AI Summary
	StateAutoUpdateInstalling
	StateAutoUpdateKeyInput
	StateAutoUpdateDone
	StateAutoUpdateHelp
)
View Source
const (
	StateBPMenu = iota
	StateBPSnippets
	StateBPLanguage // Select language for snippet
	StateBPTemplates
	StateBPArchList
	StateBPSuccess
	StateBPSaveTemplate  // Input for saving custom template
	StateBPSelectProject // Select folder to save as template
	StateBPLoadTemplate  // Input for naming new project from template
	StateBPInputPath     // Input for destination path
	StateBPShowResult    // Show what was generated
	StateBPHelp          // Help screen
)

Boilerplate States

View Source
const (
	StateBonusMenu = iota
	StateBonusTaskRunner
	StateBonusSmartFile
	StateBonusSnippets
	StateBonusProjectDash
	StateBonusAIAssistant
	StateBonusTimeMachine
	StateBonusHelp // Help Screen
)
View Source
const (
	StateDevServerPathInput = iota // New: Path selection
	StateDevServerDetecting
	StateDevServerReady
	StateDevServerRunning
	StateDevServerConfirmation // Confirmation dialog state
	StateDevServerStopping     // Server stopping state
	StateDevServerHelp
)
View Source
const (
	LangEnglish  = "en"
	LangSpanish  = "es"
	LangHindi    = "hi"
	LangFrench   = "fr"
	LangGerman   = "de"
	LangChinese  = "zh"
	LangJapanese = "ja"

	Backtick = "`"
)
View Source
const (
	ProjectToolsHelp = `` /* 1757-byte string literal not displayed */

	VenvWizardHelp = `` /* 2344-byte string literal not displayed */

	DevServerHelp = `` /* 1916-byte string literal not displayed */

	FileManagerHelp = `` /* 1436-byte string literal not displayed */

	EditorHelp = `` /* 1546-byte string literal not displayed */

	AIchatHelp = `` /* 1082-byte string literal not displayed */

	SettingsHelp = `` /* 1388-byte string literal not displayed */

	BoilerplateHelp = `` /* 1632-byte string literal not displayed */

	BonusFeaturesHelp = `` /* 1933-byte string literal not displayed */

	TaskRunnerHelp = `` /* 1519-byte string literal not displayed */

	AutoUpdateHelp = `` /* 1870-byte string literal not displayed */

	SmartFileHelp = `` /* 1452-byte string literal not displayed */

	SnippetLibraryHelp = `` /* 1423-byte string literal not displayed */

	AIAssistantHelp = `` /* 1620-byte string literal not displayed */

	TimeMachineHelp = `` /* 2161-byte string literal not displayed */

)

Help content for all features (without emojis)

View Source
const (
	StateMenu           = iota // Top level: "Project Creation & Management", etc.
	StateProjectList           // Spec: "My Projects" list with "+ New Project"
	StateSelectTemplate        // Wizard Step 1
	StateNameProject           // Wizard Step 2
	StateSelectPath            // New State
	StateCreating              // Wizard Step 3 (Processing)
	StateSuccess               // Completion Screen
	StateBackupInput           // New Backup State
	StateCleanupPrompt         // New: Ask to delete old logs
	StateHistoryList           // New: View History
	StateConfirmDelete         // New: Confirm Deletion
	StateProjectHelp           // Help screen

	StateVenvWizard  // Sub-feature 2 (Delegated to venvModel)
	StateDevServer   // Sub-feature 3 (Dev Server Launcher)
	StateBoilerplate // Sub-feature 4 (Boilerplate Generator)
	StateBonus       // Sub-feature 5 (Bonus Features)
)
View Source
const (
	StateDashboard = iota
	StateProject
	StateFileManager
	StateChat
	StateEditor
	StateAutoUpdate
	StateDocs
)

Global States

View Source
const (
	StateVenvList          = iota
	StateVenvActionMenu    // Activate, Sync, Delete, Clone
	StateVenvCloneInput    // Enter destination path
	StateVenvCreateInput   // Enter new venv path
	StateVenvSyncInput     // Enter path for requirements.txt (NEW)
	StateVenvScanInput     // Enter path to scan
	StateVenvDeleteConfirm // Confirm deletion
	StateVenvProcessing
	StateVenvCreating // Active logging state
	StateVenvSuccess  // Final success screen
	StateVenvHelp     // Educational screen
)

Variables

View Source
var (

	// Global App Border
	AppBorderStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(colorPurple).
					Padding(1, 2)

	// Wizard Card for inputs
	WizardCardStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(colorPurple).
					Padding(1, 2).
					Width(65).
					Align(lipgloss.Center)

	// Step text like "Step 1/3"
	StepStyle = lipgloss.NewStyle().
				Foreground(colorPink).
				Bold(true).
				MarginBottom(1)

	// Preview Window Header
	PreviewHeaderStyle = lipgloss.NewStyle().
						Background(colorCyan).
						Foreground(lipgloss.Color("#282a36")).
						Bold(true).
						Padding(0, 2)
)

Shared Styles

View Source
var ChatCmd = &cobra.Command{
	Use:   "chat",
	Short: "Start AI chat session (TUI)",
	Run: func(cmd *cobra.Command, args []string) {
		RunChat()
	},
}
View Source
var EditorCmd = &cobra.Command{
	Use:   "editor [file]",
	Short: "Launch the built-in multi-language IDE",
	Args:  cobra.MaximumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		filename := ""
		if len(args) > 0 {
			filename = args[0]
		}
		RunEditor(filename)
	},
}

Functions

func RenderHelp

func RenderHelp(content string, width, height int) string

func RunChat

func RunChat()

func RunDashboard

func RunDashboard() string

func RunDevServer

func RunDevServer(path string)

func RunEditor

func RunEditor(filename string)

func RunFileManager

func RunFileManager(path string)

func RunProjectDashboard

func RunProjectDashboard()

func RunRoot

func RunRoot()

func RunSettings

func RunSettings()

Wrap for standalone run if needed, but we will call from dashboard

func RunTimeMachine

func RunTimeMachine(repoPath, filePath string) error

RunTimeMachine starts the Code Time Machine TUI

Types

type AIAssistantModel

type AIAssistantModel struct {
	// contains filtered or unexported fields
}

func NewAIAssistantModel

func NewAIAssistantModel() AIAssistantModel

func (AIAssistantModel) Init

func (m AIAssistantModel) Init() tea.Cmd

func (AIAssistantModel) Update

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

func (AIAssistantModel) View

func (m AIAssistantModel) View() string

type AutoUpdateModel

type AutoUpdateModel struct {
	// contains filtered or unexported fields
}

func NewAutoUpdateModel

func NewAutoUpdateModel() AutoUpdateModel

func (AutoUpdateModel) Init

func (m AutoUpdateModel) Init() tea.Cmd

func (AutoUpdateModel) Update

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

func (AutoUpdateModel) View

func (m AutoUpdateModel) View() string

type BackMsg

type BackMsg struct{}

type BoilerplateBackMsg

type BoilerplateBackMsg struct{}

type BoilerplateDashboardModel

type BoilerplateDashboardModel struct {
	// contains filtered or unexported fields
}

func NewBoilerplateDashboardModel

func NewBoilerplateDashboardModel(workspace string) BoilerplateDashboardModel

func (BoilerplateDashboardModel) Init

func (BoilerplateDashboardModel) Update

func (BoilerplateDashboardModel) View

type BonusBackMsg

type BonusBackMsg struct{}

type BonusDashboardModel

type BonusDashboardModel struct {
	// contains filtered or unexported fields
}

func NewBonusDashboardModel

func NewBonusDashboardModel(workspace string) BonusDashboardModel

func (BonusDashboardModel) Init

func (m BonusDashboardModel) Init() tea.Cmd

func (BonusDashboardModel) Update

func (BonusDashboardModel) View

func (m BonusDashboardModel) View() string

type ChatModel

type ChatModel struct {
	// contains filtered or unexported fields
}

func NewChatModel

func NewChatModel() ChatModel

func (ChatModel) Init

func (m ChatModel) Init() tea.Cmd

func (ChatModel) Update

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

func (ChatModel) View

func (m ChatModel) View() string

type DashboardModel

type DashboardModel struct {
	// contains filtered or unexported fields
}

func NewDashboard

func NewDashboard() DashboardModel

func (DashboardModel) Init

func (m DashboardModel) Init() tea.Cmd

func (DashboardModel) Update

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

func (DashboardModel) View

func (m DashboardModel) View() string

type DevServerBackMsg

type DevServerBackMsg struct{}

type DevServerDashboardModel

type DevServerDashboardModel struct {
	// contains filtered or unexported fields
}

func NewDevServerDashboardModel

func NewDevServerDashboardModel(projectPath string) DevServerDashboardModel

func (DevServerDashboardModel) Init

func (m DevServerDashboardModel) Init() tea.Cmd

func (DevServerDashboardModel) Update

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

func (DevServerDashboardModel) View

type DocsModel

type DocsModel struct {
	// contains filtered or unexported fields
}

func NewDocsModel

func NewDocsModel() DocsModel

func (DocsModel) Init

func (m DocsModel) Init() tea.Cmd

func (DocsModel) Update

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

func (DocsModel) View

func (m DocsModel) View() string

type FileManagerModel

type FileManagerModel struct {
	// contains filtered or unexported fields
}

func NewFileManagerModel

func NewFileManagerModel(startPath string) FileManagerModel

func (FileManagerModel) Init

func (m FileManagerModel) Init() tea.Cmd

func (FileManagerModel) Update

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

func (FileManagerModel) View

func (m FileManagerModel) View() string

type ProjectDashModel

type ProjectDashModel struct {
	// contains filtered or unexported fields
}

func NewProjectDashModel

func NewProjectDashModel(workspace string) ProjectDashModel

func (ProjectDashModel) Init

func (m ProjectDashModel) Init() tea.Cmd

func (ProjectDashModel) Update

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

func (ProjectDashModel) View

func (m ProjectDashModel) View() string

type ProjectDashboardModel

type ProjectDashboardModel struct {
	// contains filtered or unexported fields
}

func NewProjectDashboardModel

func NewProjectDashboardModel() ProjectDashboardModel

func (ProjectDashboardModel) Init

func (m ProjectDashboardModel) Init() tea.Cmd

func (ProjectDashboardModel) Update

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

func (ProjectDashboardModel) View

func (m ProjectDashboardModel) View() string

type RootModel

type RootModel struct {
	// contains filtered or unexported fields
}

func NewRootModel

func NewRootModel() RootModel

func (RootModel) Init

func (m RootModel) Init() tea.Cmd

func (RootModel) Update

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

func (RootModel) View

func (m RootModel) View() string

type SettingsModel

type SettingsModel struct {
	// contains filtered or unexported fields
}

func NewSettingsModel

func NewSettingsModel() SettingsModel

func (SettingsModel) Init

func (m SettingsModel) Init() tea.Cmd

func (SettingsModel) Update

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

func (SettingsModel) View

func (m SettingsModel) View() string

type SmartFileModel

type SmartFileModel struct {
	// contains filtered or unexported fields
}

func NewSmartFileModel

func NewSmartFileModel(workspace string) SmartFileModel

func (SmartFileModel) Init

func (m SmartFileModel) Init() tea.Cmd

func (SmartFileModel) Update

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

func (SmartFileModel) View

func (m SmartFileModel) View() string

type SnippetsModel

type SnippetsModel struct {
	// contains filtered or unexported fields
}

func NewSnippetsModel

func NewSnippetsModel() SnippetsModel

func (SnippetsModel) Init

func (m SnippetsModel) Init() tea.Cmd

func (SnippetsModel) Update

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

func (SnippetsModel) View

func (m SnippetsModel) View() string

type StandaloneWrapper

type StandaloneWrapper struct {
	// contains filtered or unexported fields
}

StandaloneWrapper wraps a model to handle BackMsg/Quit This allows models designed for nested use (returning BackMsg) to work standalone (Quitting on BackMsg)

func Wrap

func Wrap(m tea.Model) StandaloneWrapper

func (StandaloneWrapper) Init

func (m StandaloneWrapper) Init() tea.Cmd

func (StandaloneWrapper) Update

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

func (StandaloneWrapper) View

func (m StandaloneWrapper) View() string

type SubFeatureBackMsg

type SubFeatureBackMsg struct{} // Intermediate navigation to parent menu

type SwitchViewMsg

type SwitchViewMsg struct {
	TargetState int
	Args        interface{} // Generic args (e.g., initial path)
}

Messages

type TaskRunnerModel

type TaskRunnerModel struct {
	// contains filtered or unexported fields
}

func NewTaskRunnerModel

func NewTaskRunnerModel(workspace string) TaskRunnerModel

func (TaskRunnerModel) Init

func (m TaskRunnerModel) Init() tea.Cmd

func (TaskRunnerModel) Update

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

func (TaskRunnerModel) View

func (m TaskRunnerModel) View() string

type TimeMachineModel

type TimeMachineModel struct {
	// contains filtered or unexported fields
}

func NewTimeMachineModel

func NewTimeMachineModel(repoPath, filePath string) (*TimeMachineModel, error)

func (*TimeMachineModel) Init

func (m *TimeMachineModel) Init() tea.Cmd

Init initializes the model

func (*TimeMachineModel) Update

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

Update handles messages and updates the model

func (*TimeMachineModel) View

func (m *TimeMachineModel) View() string

View renders the UI

type UpdateCheckMsg

type UpdateCheckMsg struct {
	// contains filtered or unexported fields
}

UpdateCheckMsg contains the result of checking for updates

type UpdateCompleteMsg

type UpdateCompleteMsg struct {
	// contains filtered or unexported fields
}

UpdateCompleteMsg indicates the update completed

type UpdaterModel

type UpdaterModel struct {
	// contains filtered or unexported fields
}

UpdaterModel represents the update checker UI state

func NewUpdaterModel

func NewUpdaterModel() UpdaterModel

NewUpdaterModel creates a new updater model

func (UpdaterModel) Init

func (m UpdaterModel) Init() tea.Cmd

Init initializes the updater model

func (UpdaterModel) Update

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

Update handles messages

func (UpdaterModel) View

func (m UpdaterModel) View() string

View renders the updater UI

type VenvBackMsg

type VenvBackMsg struct{}

Feature-specific Back Messages for nested navigation

type VenvDashboardModel

type VenvDashboardModel struct {
	// contains filtered or unexported fields
}

func NewVenvDashboardModel

func NewVenvDashboardModel() VenvDashboardModel

func (VenvDashboardModel) Init

func (m VenvDashboardModel) Init() tea.Cmd

func (VenvDashboardModel) Update

func (VenvDashboardModel) View

func (m VenvDashboardModel) View() string

Jump to

Keyboard shortcuts

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