{"modulePath":"github.com/newstack-cloud/deploy-cli-sdk","version":"v0.10.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package precommand\n\nPackage 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.\n\n## Types\n\n```go\ntype CompleteMsg struct{}\n```\nCompleteMsg indicates the pre-command step finished successfully.\n\n```go\ntype ErrorMsg struct {\n\tErr error\n}\n```\nErrorMsg indicates the pre-command step failed.\n\n```go\ntype Model struct {\n\n\t// Err is set if the pre-command step failed. Check after the program exits.\n\tErr error\n\t// contains filtered or unexported fields\n}\n```\nModel is a bubbletea sub-model that runs a PreCommandStep and displays progress with a spinner.\n\n```go\nfunc NewModel(opts Options) *Model\n```\n\n```go\nfunc (m Model) Init() tea.Cmd\n```\n\n```go\nfunc (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)\n```\n\n```go\nfunc (m Model) View() string\n```\n\n```go\ntype Options struct {\n\tContext      context.Context\n\tStep         Step\n\tConfProvider *config.Provider\n\tCommandName  string\n\tStyles       *stylespkg.Styles\n\tHeadless     bool\n\tWriter       io.Writer\n}\n```\nOptions for creating a new pre-command step model.\n\n```go\ntype ProgressMsg struct {\n\tPhase  string\n\tDetail string\n}\n```\nProgressMsg represents a progress update from a Step.\n\n```go\ntype ProgressUpdateMsg struct {\n\tPhase  string\n\tDetail string\n}\n```\nProgressUpdateMsg carries a progress update from the step to the TUI.\n\n```go\ntype Step interface {\n\tRun(ctx context.Context, confProvider *config.Provider, commandName string, progress chan\u003c- ProgressMsg) error\n}\n```\nStep is executed before stage/deploy engine interactions. Implementations may modify the deploy config (e.g. injecting context variables).\n\n","path":"github.com/newstack-cloud/deploy-cli-sdk/tui/precommand","name":"precommand","synopsis":"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.","isRedistributable":true}
