zsh

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllowedCommands

func GetAllowedCommands() []string

GetAllowedCommands returns a list of all allowed commands (for documentation/config)

func GetBlockedCommands

func GetBlockedCommands() []string

GetBlockedCommands returns a list of all blocked commands (for documentation/config)

func LooksLikeCommandLine added in v0.21.10

func LooksLikeCommandLine(input string) bool

LooksLikeCommandLine reports whether input reads as a shell command rather than a sentence that happens to start with a command's name ("make sure the tests pass", "find the bug", "go on"). Typed without a "!" prefix, input only runs as a command when this holds: a bare word, a question, a tool without a real subcommand, or arguments with nothing shell-like about them all go to the assistant.

Types

type CommandInfo

type CommandInfo struct {
	Name       string      // Command name
	Type       CommandType // external, builtin, alias, function
	Path       string      // For external commands, the full path
	Value      string      // For aliases, the expanded value
	SubCommand string      // For commands with subcommands, the detected subcommand
}

CommandInfo contains information about a detected command

func IsCommand

func IsCommand(input string) (bool, *CommandInfo, error)

IsCommand checks if the given input starts with a valid zsh command that is safe for auto-execution in the sprout context. Returns (isCommand, commandInfo, error).

type CommandType

type CommandType string

CommandType represents the type of zsh command

const (
	CommandTypeExternal CommandType = "external"
	CommandTypeBuiltin  CommandType = "builtin"
	CommandTypeAlias    CommandType = "alias"
	CommandTypeFunction CommandType = "function"
)

Jump to

Keyboard shortcuts

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