core

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyticsFile

func AnalyticsFile() string

func DataDir

func DataDir() string

func HistoryFile

func HistoryFile() string

func HomeDir

func HomeDir() string

func LatestVersionFile

func LatestVersionFile() string

func LogFile

func LogFile() string

func RunInteractiveShell

func RunInteractiveShell(
	ctx context.Context,
	runner *interp.Runner,
	historyManager *history.HistoryManager,
	analyticsManager *analytics.AnalyticsManager,
	completionManager *completion.CompletionManager,
	coachManager *coach.CoachManager,
	logger *zap.Logger,
	stderrCapturer *StderrCapturer,
) error

Types

type DefaultUserPrompter

type DefaultUserPrompter struct{}

func (DefaultUserPrompter) Prompt

func (p DefaultUserPrompter) Prompt(
	prompt string,
	historyValues []string,
	explanation string,
	predictor gline.Predictor,
	explainer gline.Explainer,
	analytics gline.PredictionAnalytics,
	logger *zap.Logger,
	options gline.Options,
) (string, error)

type Paths

type Paths struct {
	HomeDir           string
	DataDir           string
	LogFile           string
	HistoryFile       string
	AnalyticsFile     string
	LatestVersionFile string
}

type ShellState

type ShellState struct {
	LastCommand  string
	LastExitCode int
	LastStderr   string
}

ShellState holds the state of the shell execution

type StderrCapturer

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

StderrCapturer wraps an io.Writer and captures the output into a buffer

func NewStderrCapturer

func NewStderrCapturer(original io.Writer) *StderrCapturer

func (*StderrCapturer) StartCapture

func (c *StderrCapturer) StartCapture()

func (*StderrCapturer) StopCapture

func (c *StderrCapturer) StopCapture() string

func (*StderrCapturer) Write

func (c *StderrCapturer) Write(p []byte) (n int, err error)

type UserPrompter

type UserPrompter interface {
	Prompt(
		prompt string,
		historyValues []string,
		explanation string,
		predictor gline.Predictor,
		explainer gline.Explainer,
		analytics gline.PredictionAnalytics,
		logger *zap.Logger,
		options gline.Options,
	) (string, error)
}

Jump to

Keyboard shortcuts

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