cli

package
v0.17.14 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 42 Imported by: 0

Documentation

Overview

Package cli provides command-line interface definitions using Cobra, including all subcommands and their flag definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureInitialized

func EnsureInitialized(ctx context.Context, writer io.Writer) (string, error)

EnsureInitialized initializes stackit if not already initialized. Returns the repo root path. This is used by commands that need stackit to be initialized but want to auto-initialize for convenience.

func HandlePassthrough

func HandlePassthrough(args []string) bool

HandlePassthrough checks if the command should be passed through to git and executes it if so. Returns true if the command was handled (and the program should exit).

func HandlePassthroughWithResult

func HandlePassthroughWithResult(args []string, exit bool, out, errWriter io.Writer) (bool, error)

HandlePassthroughWithResult is like HandlePassthrough but returns an error instead of exiting if exit is false.

func NewDoctorUI

func NewDoctorUI(out output.Output, _ output.Logger) (*tui.Runner, doctor.Handler)

NewDoctorUI creates a runner and handler pair for doctor operations. The runner manages terminal state; the handler processes events. Caller must defer runner.Cleanup() to restore terminal on exit. Currently returns nil runner as there's no TUI component yet.

func NewRootCmd

func NewRootCmd(version, commit, date string) *cobra.Command

NewRootCmd creates the root cobra command

func NewUndoUI

func NewUndoUI(out output.Output, _ output.Logger) (*tui.Runner, undo.Handler)

NewUndoUI creates a runner and handler pair for undo operations. The runner manages terminal state; the handler processes events. Caller must defer runner.Cleanup() to restore terminal on exit. Currently returns nil runner as interactive prompts are handled inline.

Types

type InteractiveUndoHandler

type InteractiveUndoHandler struct {
	common.BaseHandler
}

InteractiveUndoHandler provides interactive TUI for undo operations

func NewInteractiveUndoHandler

func NewInteractiveUndoHandler(out output.Output) *InteractiveUndoHandler

NewInteractiveUndoHandler creates a new InteractiveUndoHandler

func (*InteractiveUndoHandler) Complete

func (h *InteractiveUndoHandler) Complete(_ bool, message string)

Complete is called when undo finishes

func (*InteractiveUndoHandler) IsInteractive

func (h *InteractiveUndoHandler) IsInteractive() bool

IsInteractive returns true for the interactive handler

func (*InteractiveUndoHandler) OnSnapshotList

func (h *InteractiveUndoHandler) OnSnapshotList(_ []engine.SnapshotInfo)

OnSnapshotList is called with available snapshots

func (*InteractiveUndoHandler) OnStep

func (h *InteractiveUndoHandler) OnStep(description string, status handler.StepStatus)

OnStep is called for each undo step

func (*InteractiveUndoHandler) PromptConfirm

func (h *InteractiveUndoHandler) PromptConfirm(message string, defaultYes bool) (bool, error)

PromptConfirm prompts user for confirmation

func (*InteractiveUndoHandler) SelectSnapshot

func (h *InteractiveUndoHandler) SelectSnapshot(snapshots []engine.SnapshotInfo) (string, error)

SelectSnapshot prompts user to select a snapshot

func (*InteractiveUndoHandler) Start

func (h *InteractiveUndoHandler) Start()

Start is called at the beginning of undo

type SimpleDoctorHandler

type SimpleDoctorHandler struct {
	common.BaseHandler
	// contains filtered or unexported fields
}

SimpleDoctorHandler provides streaming text output for doctor operations

func NewSimpleDoctorHandler

func NewSimpleDoctorHandler(out output.Output) *SimpleDoctorHandler

NewSimpleDoctorHandler creates a new SimpleDoctorHandler

func (*SimpleDoctorHandler) Complete

func (h *SimpleDoctorHandler) Complete(_, _, _ int)

Complete is called when doctor finishes

func (*SimpleDoctorHandler) OnCategory

func (h *SimpleDoctorHandler) OnCategory(category doctor.Category)

OnCategory is called when starting a new category of checks

func (*SimpleDoctorHandler) OnCheck

func (h *SimpleDoctorHandler) OnCheck(_ string, status doctor.CheckStatus, message string)

OnCheck is called for each individual check result

func (*SimpleDoctorHandler) Start

func (h *SimpleDoctorHandler) Start(fix bool)

Start is called at the beginning of doctor

type SimpleUndoHandler

type SimpleUndoHandler struct {
	common.BaseHandler
}

SimpleUndoHandler provides streaming text output for undo operations

func NewSimpleUndoHandler

func NewSimpleUndoHandler(out output.Output) *SimpleUndoHandler

NewSimpleUndoHandler creates a new SimpleUndoHandler

func (*SimpleUndoHandler) Complete

func (h *SimpleUndoHandler) Complete(_ bool, message string)

Complete is called when undo finishes

func (*SimpleUndoHandler) OnSnapshotList

func (h *SimpleUndoHandler) OnSnapshotList(_ []engine.SnapshotInfo)

OnSnapshotList is called with available snapshots

func (*SimpleUndoHandler) OnStep

func (h *SimpleUndoHandler) OnStep(description string, status handler.StepStatus)

OnStep is called for each undo step

func (*SimpleUndoHandler) PromptConfirm

func (h *SimpleUndoHandler) PromptConfirm(_ string, _ bool) (bool, error)

PromptConfirm is not supported in non-interactive mode

func (*SimpleUndoHandler) SelectSnapshot

func (h *SimpleUndoHandler) SelectSnapshot(_ []engine.SnapshotInfo) (string, error)

SelectSnapshot is not supported in non-interactive mode

func (*SimpleUndoHandler) Start

func (h *SimpleUndoHandler) Start()

Start is called at the beginning of undo

Directories

Path Synopsis
Package branch provides CLI commands for managing branches in a stack.
Package branch provides CLI commands for managing branches in a stack.
Package common provides shared helper functions for CLI commands.
Package common provides shared helper functions for CLI commands.
Package dashboard provides the interactive shippable work TUI.
Package dashboard provides the interactive shippable work TUI.
Package integrations provides commands for managing various integrations
Package integrations provides commands for managing various integrations
Package navigation provides CLI commands for navigating branches in a stack.
Package navigation provides CLI commands for navigating branches in a stack.
Package shell provides shell integration for stackit.
Package shell provides shell integration for stackit.
Package stack provides CLI commands for operating on entire stacks.
Package stack provides CLI commands for operating on entire stacks.
merge
Package merge provides CLI commands for merging stacked PRs.
Package merge provides CLI commands for merging stacked PRs.
Package worktree provides CLI commands for managing stackit-managed worktrees.
Package worktree provides CLI commands for managing stackit-managed worktrees.

Jump to

Keyboard shortcuts

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