precommand

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package precommand provides a bubbletea sub-model that runs a PreCommandStep with a spinner and progress display, integrating into the deploy/stage TUI as an initial phase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleteMsg

type CompleteMsg struct{}

CompleteMsg indicates the pre-command step finished successfully.

type ErrorMsg

type ErrorMsg struct {
	Err error
}

ErrorMsg indicates the pre-command step failed.

type Model

type Model struct {

	// Err is set if the pre-command step failed. Check after the program exits.
	Err error
	// contains filtered or unexported fields
}

Model is a bubbletea sub-model that runs a PreCommandStep and displays progress with a spinner.

func NewModel

func NewModel(opts Options) *Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type Options

type Options struct {
	Step         Step
	ConfProvider *config.Provider
	CommandName  string
	Styles       *stylespkg.Styles
	Headless     bool
	Writer       io.Writer
}

Options for creating a new pre-command step model.

type ProgressMsg

type ProgressMsg struct {
	Phase  string
	Detail string
}

ProgressMsg represents a progress update from a Step.

type ProgressUpdateMsg

type ProgressUpdateMsg struct {
	Phase  string
	Detail string
}

ProgressUpdateMsg carries a progress update from the step to the TUI.

type Step

type Step interface {
	Run(ctx context.Context, confProvider *config.Provider, commandName string, progress chan<- ProgressMsg) error
}

Step is executed before stage/deploy engine interactions. Implementations may modify the deploy config (e.g. injecting context variables).

Jump to

Keyboard shortcuts

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