commands

package
v1.113.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentCandidate added in v1.112.0

type ArgumentCandidate struct {
	Label       string
	Description string
	// Disabled marks a candidate that is shown for context but cannot be
	// submitted (e.g. a non-restartable toolset for /toolset-restart).
	Disabled bool
}

ArgumentCandidate is one completable value for a command's argument, e.g. a toolset name for /toolset-restart. It is intentionally free of any completion-UI or app-domain types so pkg/tui/commands stays decoupled from both pkg/tui/components/completion and pkg/app.

type Category

type Category struct {
	Name     string
	Commands []Item
}

Category represents a category of commands

func BuildCommandCategories

func BuildCommandCategories(ctx context.Context, application *app.App) []Category

BuildCommandCategories builds the list of command categories for the command palette

type ExecuteFunc

type ExecuteFunc func(arg string) tea.Cmd

ExecuteFunc is a function that executes a command with an optional argument.

type Item

type Item struct {
	ID           string
	Label        string
	Description  string
	Category     string
	SlashCommand string
	Execute      ExecuteFunc
	Hidden       bool // Hidden commands work as slash commands but don't appear in the palette
	// Immediate marks commands that should run as soon as they are submitted
	// instead of being treated as ordinary queued chat input.
	Immediate bool
	// CompleteArgument, when set, returns the candidates for this command's
	// argument. Called lazily at completion-popup-open time so results
	// reflect current runtime state (e.g. toolset lifecycle). Nil for
	// commands with no argument completion.
	CompleteArgument func() []ArgumentCandidate
}

Item represents a single command in the palette

type Parser added in v1.44.0

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

func NewParser added in v1.44.0

func NewParser(categories ...Category) *Parser

func (*Parser) Parse added in v1.44.0

func (p *Parser) Parse(input string) tea.Cmd

Jump to

Keyboard shortcuts

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