commands

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCommand

type BaseCommand struct {
	Name        string
	Description string
	Usage       string
	Examples    []string
	Aliases     []string
	Category    string
	Hidden      bool
	Shortcuts   []string
}

BaseCommand provides common functionality for all commands

func (*BaseCommand) GetAliases

func (c *BaseCommand) GetAliases() []string

func (*BaseCommand) GetCategory

func (c *BaseCommand) GetCategory() string

func (*BaseCommand) GetDescription

func (c *BaseCommand) GetDescription() string

func (*BaseCommand) GetExamples

func (c *BaseCommand) GetExamples() []string

func (*BaseCommand) GetName

func (c *BaseCommand) GetName() string

func (*BaseCommand) GetShortcuts

func (c *BaseCommand) GetShortcuts() []string

func (*BaseCommand) GetUsage

func (c *BaseCommand) GetUsage() string

func (*BaseCommand) IsHidden

func (c *BaseCommand) IsHidden() bool

type ClearCommand

type ClearCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewClearCommand

func NewClearCommand(controller *controllers.ChatController) *ClearCommand

func (*ClearCommand) Execute

func (c *ClearCommand) Execute(args []string) error

type Command

type Command interface {
	// Metadata
	GetName() string
	GetDescription() string
	GetUsage() string
	GetExamples() []string
	GetAliases() []string
	GetCategory() string
	IsHidden() bool
	GetShortcuts() []string

	// Execution
	Execute(args []string) error
}

Command represents a command that can be executed

type CommandFunc

type CommandFunc func(args []string) error

type CommandHandler

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

func NewCommandHandler

func NewCommandHandler(commandEventBus *events.CommandEventBus, notification types.Notification, registry *CommandRegistry) *CommandHandler

func (*CommandHandler) GetAvailableCommands

func (h *CommandHandler) GetAvailableCommands() []string

func (*CommandHandler) GetCommand

func (h *CommandHandler) GetCommand(name string) *CommandWrapper

GetCommand returns a command by name or alias

func (*CommandHandler) GetRegistry

func (h *CommandHandler) GetRegistry() *CommandRegistry

GetRegistry returns the command registry

func (*CommandHandler) HandleCommand

func (h *CommandHandler) HandleCommand(command string, args []string) error

func (*CommandHandler) RegisterAlias

func (h *CommandHandler) RegisterAlias(alias, command string)

RegisterAlias registers an alias (legacy method for backward compatibility)

func (*CommandHandler) RegisterCommand

func (h *CommandHandler) RegisterCommand(name string, fn CommandFunc)

RegisterCommand registers a command (legacy method for backward compatibility)

func (*CommandHandler) RegisterNewCommand

func (h *CommandHandler) RegisterNewCommand(cmd Command)

RegisterNewCommand registers a new command interface

type CommandRegistry

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

CommandRegistry manages command registration and metadata

func NewCommandRegistry

func NewCommandRegistry() *CommandRegistry

NewCommandRegistry creates a new command registry

func (*CommandRegistry) GetAliases

func (r *CommandRegistry) GetAliases(commandName string) []string

GetAliases returns all aliases for a command

func (*CommandRegistry) GetAllCommands

func (r *CommandRegistry) GetAllCommands() []*CommandWrapper

GetAllCommands returns all registered commands (excluding hidden)

func (*CommandRegistry) GetCategories

func (r *CommandRegistry) GetCategories() []string

GetCategories returns all category names

func (*CommandRegistry) GetCommand

func (r *CommandRegistry) GetCommand(name string) *CommandWrapper

GetCommand returns a command by name or alias

func (*CommandRegistry) GetCommandNames

func (r *CommandRegistry) GetCommandNames() []string

GetCommandNames returns all command names (including aliases)

func (*CommandRegistry) GetCommandsByCategory

func (r *CommandRegistry) GetCommandsByCategory() map[string][]*CommandWrapper

GetCommandsByCategory returns commands grouped by category

func (*CommandRegistry) RegisterNewCommand

func (r *CommandRegistry) RegisterNewCommand(cmd Command)

RegisterNewCommand adds a new command interface to the registry

func (*CommandRegistry) SearchCommands

func (r *CommandRegistry) SearchCommands(query string) []*CommandWrapper

SearchCommands finds commands matching the query in name or description

type CommandWrapper

type CommandWrapper struct {
	NewCommand Command // New command interface
}

CommandWrapper wraps both old and new command types

func (*CommandWrapper) Execute

func (w *CommandWrapper) Execute(args []string) error

func (*CommandWrapper) GetAliases

func (w *CommandWrapper) GetAliases() []string

func (*CommandWrapper) GetCategory

func (w *CommandWrapper) GetCategory() string

func (*CommandWrapper) GetDescription

func (w *CommandWrapper) GetDescription() string

func (*CommandWrapper) GetExamples

func (w *CommandWrapper) GetExamples() []string

func (*CommandWrapper) GetName

func (w *CommandWrapper) GetName() string

func (*CommandWrapper) GetUsage

func (w *CommandWrapper) GetUsage() string

func (*CommandWrapper) IsHidden

func (w *CommandWrapper) IsHidden() bool

type ConfigCommand

type ConfigCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewConfigCommand

func NewConfigCommand(configManager *helpers.ConfigManager, commandEventBus *events.CommandEventBus, guiCommon types.Gui, notification *controllers.ChatController) *ConfigCommand

func (*ConfigCommand) Execute

func (c *ConfigCommand) Execute(args []string) error

type ContextCommand

type ContextCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewContextCommand

func NewContextCommand(controller *controllers.LLMContextController) *ContextCommand

func (*ContextCommand) Execute

func (c *ContextCommand) Execute(args []string) error

type DebugCommand

type DebugCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewDebugCommand

func NewDebugCommand(controller *controllers.DebugController, notification *controllers.ChatController) *DebugCommand

func (*DebugCommand) Execute

func (c *DebugCommand) Execute(args []string) error

type DebugControllerInterface

type DebugControllerInterface interface {
	AddDebugMessage(message string)
	ClearDebugMessages()
	GetDebugMessages() []string
	IsDebugMode() bool
	SetDebugMode(enabled bool)
}

DebugControllerInterface interface for debug functionality

type ExitCommand

type ExitCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewExitCommand

func NewExitCommand(commandEventBus *events.CommandEventBus) *ExitCommand

func (*ExitCommand) Execute

func (c *ExitCommand) Execute(args []string) error

type HelpCommand

type HelpCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewHelpCommand

func NewHelpCommand(helpController controllers.HelpControllerInterface) *HelpCommand

func (*HelpCommand) Execute

func (c *HelpCommand) Execute(args []string) error

type StatusCommand

type StatusCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewStatusCommand

func NewStatusCommand(notification types.Notification, genieService genie.Genie) *StatusCommand

func (*StatusCommand) Execute

func (c *StatusCommand) Execute(args []string) error

type ThemeCommand

type ThemeCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewThemeCommand

func NewThemeCommand(configManager *helpers.ConfigManager, commandEventBus *events.CommandEventBus, notification *controllers.ChatController) *ThemeCommand

func (*ThemeCommand) Execute

func (c *ThemeCommand) Execute(args []string) error

type UpdateCommand added in v0.1.6

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

UpdateCommand handles update-related operations in the TUI

func NewUpdateCommand added in v0.1.6

func NewUpdateCommand(notification types.Notification) *UpdateCommand

NewUpdateCommand creates a new update command

func (*UpdateCommand) AutoComplete added in v0.1.6

func (c *UpdateCommand) AutoComplete(args []string) []string

AutoComplete provides autocompletion suggestions

func (*UpdateCommand) Execute added in v0.1.6

func (c *UpdateCommand) Execute(args []string) error

Execute executes the update command

func (*UpdateCommand) GetAliases added in v0.1.6

func (c *UpdateCommand) GetAliases() []string

GetAliases returns command aliases

func (*UpdateCommand) GetCategory added in v0.1.6

func (c *UpdateCommand) GetCategory() string

GetCategory returns the command category

func (*UpdateCommand) GetDescription added in v0.1.6

func (c *UpdateCommand) GetDescription() string

GetDescription returns the command description

func (*UpdateCommand) GetExamples added in v0.1.6

func (c *UpdateCommand) GetExamples() []string

GetExamples returns command examples

func (*UpdateCommand) GetName added in v0.1.6

func (c *UpdateCommand) GetName() string

GetName returns the command name

func (*UpdateCommand) GetShortcuts added in v0.1.6

func (c *UpdateCommand) GetShortcuts() []string

GetShortcuts returns keyboard shortcuts for the command

func (*UpdateCommand) GetSubcommandDescription added in v0.1.6

func (c *UpdateCommand) GetSubcommandDescription(subcommand string) string

GetSubcommandDescription returns description for a subcommand

func (*UpdateCommand) GetSubcommands added in v0.1.6

func (c *UpdateCommand) GetSubcommands() []string

GetSubcommands returns available subcommands

func (*UpdateCommand) GetUsage added in v0.1.6

func (c *UpdateCommand) GetUsage() string

GetUsage returns the command usage

func (*UpdateCommand) IsHidden added in v0.1.6

func (c *UpdateCommand) IsHidden() bool

IsHidden returns whether the command is hidden

func (*UpdateCommand) SupportsAutoComplete added in v0.1.6

func (c *UpdateCommand) SupportsAutoComplete() bool

SupportsAutoComplete returns true if the command supports autocompletion

type WriteCommand

type WriteCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewWriteCommand

func NewWriteCommand(controller *controllers.WriteController) *WriteCommand

func (*WriteCommand) Execute

func (c *WriteCommand) Execute(args []string) error

type YankCommand

type YankCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

func NewYankCommand

func NewYankCommand(chatState *state.ChatState, clipboardHelper *helpers.Clipboard, notification *controllers.ChatController) *YankCommand

func (*YankCommand) Execute

func (c *YankCommand) Execute(args []string) error

Jump to

Keyboard shortcuts

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