environment

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PROMPT = "gsh> "
)

Variables

This section is empty.

Functions

func AppendToAuthorizedCommands added in v0.23.0

func AppendToAuthorizedCommands(commandRegex string) error

AppendToAuthorizedCommands appends a command regex to the authorized_commands file

func GetAgentContextWindowTokens

func GetAgentContextWindowTokens(runner *interp.Runner, logger *zap.Logger) int

func GetAgentMacros added in v0.16.0

func GetAgentMacros(runner *interp.Runner, logger *zap.Logger) map[string]string

func GetApprovedBashCommandRegex added in v0.10.0

func GetApprovedBashCommandRegex(runner *interp.Runner, logger *zap.Logger) []string

func GetAuthorizedCommandsFileForTesting added in v0.23.0

func GetAuthorizedCommandsFileForTesting() string

func GetConfigDirForTesting added in v0.23.0

func GetConfigDirForTesting() string

Helper functions for testing

func GetContextNumHistoryConcise added in v0.9.0

func GetContextNumHistoryConcise(runner *interp.Runner, logger *zap.Logger) int

func GetContextNumHistoryVerbose added in v0.9.0

func GetContextNumHistoryVerbose(runner *interp.Runner, logger *zap.Logger) int

func GetContextTypesForAgent added in v0.9.0

func GetContextTypesForAgent(runner *interp.Runner, logger *zap.Logger) []string

func GetContextTypesForExplanation added in v0.9.0

func GetContextTypesForExplanation(runner *interp.Runner, logger *zap.Logger) []string

func GetContextTypesForPredictionWithPrefix added in v0.9.0

func GetContextTypesForPredictionWithPrefix(runner *interp.Runner, logger *zap.Logger) []string

func GetContextTypesForPredictionWithoutPrefix added in v0.9.0

func GetContextTypesForPredictionWithoutPrefix(runner *interp.Runner, logger *zap.Logger) []string

func GetHistoryContextLimit

func GetHistoryContextLimit(runner *interp.Runner, logger *zap.Logger) int

func GetHomeDir added in v0.9.2

func GetHomeDir(runner *interp.Runner) string

func GetLogLevel

func GetLogLevel(runner *interp.Runner) zap.AtomicLevel

func GetMinimumLines added in v0.4.0

func GetMinimumLines(runner *interp.Runner, logger *zap.Logger) int

func GetPwd

func GetPwd(runner *interp.Runner) string

func IsCommandAuthorized added in v0.23.0

func IsCommandAuthorized(command string) (bool, error)

IsCommandAuthorized checks if a command matches any of the authorized patterns

func IsCommandPatternAuthorized added in v0.23.0

func IsCommandPatternAuthorized(commandPattern string) (bool, error)

IsCommandPatternAuthorized checks if a specific command pattern already exists in the authorized_commands file This is used for pre-selecting permissions in the menu - only exact pattern matches should be pre-selected

func LoadAuthorizedCommandsFromFile added in v0.23.0

func LoadAuthorizedCommandsFromFile() ([]string, error)

LoadAuthorizedCommandsFromFile loads authorized command regex patterns from file

func ResetCacheForTesting added in v0.23.0

func ResetCacheForTesting()

ResetCacheForTesting resets the authorized commands cache for testing

func SetAuthorizedCommandsFileForTesting added in v0.23.0

func SetAuthorizedCommandsFileForTesting(file string)

func SetConfigDirForTesting added in v0.23.0

func SetConfigDirForTesting(dir string)

func ShouldCleanLogFile

func ShouldCleanLogFile(runner *interp.Runner) bool

func WriteAuthorizedCommandsToFile added in v0.23.0

func WriteAuthorizedCommandsToFile(patterns []string) error

WriteAuthorizedCommandsToFile writes a list of regex patterns to the authorized_commands file This replaces the entire file content and deduplicates entries

Types

This section is empty.

Jump to

Keyboard shortcuts

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