exec

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCommandVerb

func GetCommandVerb(command string) string

GetCommandVerb extracts the kubectl verb from a command string

func GetResourceTypes

func GetResourceTypes() []string

GetResourceTypes returns a list of common resource types

func IsDestructive

func IsDestructive(command string) bool

IsDestructive checks if a command is destructive (requires confirmation)

Types

type ExecuteResult

type ExecuteResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
	Duration time.Duration
	Error    error
}

ExecuteResult contains the result of a kubectl execution

type Executor

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

Executor executes kubectl commands

func NewExecutor

func NewExecutor() (*Executor, error)

NewExecutor creates a new kubectl executor

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context, args []string) *ExecuteResult

Execute runs a kubectl command

func (*Executor) ExecuteStreaming added in v1.1.0

func (e *Executor) ExecuteStreaming(ctx context.Context, command string, paneID int) tea.Cmd

ExecuteStreaming runs a command and streams output via tea messages

func (*Executor) ExecuteString

func (e *Executor) ExecuteString(ctx context.Context, command string) *ExecuteResult

ExecuteString runs a command from a string. Commands starting with "!" are executed directly in the shell, all others are treated as kubectl commands.

type PaneCompleteMsg added in v1.1.0

type PaneCompleteMsg struct {
	PaneID   int
	ExitCode int
	Error    error
}

PaneCompleteMsg indicates a pane command has completed

type PaneOutputMsg added in v1.1.0

type PaneOutputMsg struct {
	PaneID  int
	Output  string
	NextCmd tea.Cmd // Call this to continue streaming
}

PaneOutputMsg represents a chunk of output for a command pane It includes a NextCmd that should be called to continue streaming

type Parser

type Parser struct{}

Parser parses kubectl commands

func NewParser

func NewParser() *Parser

NewParser creates a new command parser

func (*Parser) Parse

func (p *Parser) Parse(command string) *types.ParsedCommand

Parse parses a kubectl command string

Jump to

Keyboard shortcuts

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