slash

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	GetConfig() *config.Config
	GetAgent() *agent.Agent
	GetCost() float64
	GetTokensIn() int
	GetTokensOut() int
	SetModel(model string)
	SetPermissionMode(mode string)
	SendPrompt(prompt string) // Send a prompt to the agent
}

App is the interface that the TUI model implements

type CommandDef

type CommandDef struct {
	Name        string
	Aliases     []string
	Description string
	HasArgs     bool
}

CommandDef defines a slash command with metadata

func AllCommands

func AllCommands() []CommandDef

AllCommands returns all available slash commands

func MatchCommands

func MatchCommands(prefix string) []CommandDef

MatchCommands returns commands that fuzzy-match a prefix (for autocomplete)

type Handler

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

Handler processes slash commands

func NewHandler

func NewHandler(app App) *Handler

func (*Handler) Handle

func (h *Handler) Handle(input string) Result

func (*Handler) HandleSkillInvocation

func (h *Handler) HandleSkillInvocation(cmd string, args []string) (Result, bool)

handleSkillInvocation checks if a slash command is a skill name and invokes it

type Result

type Result struct {
	Message       string
	Quit          bool
	ClearMessages bool
	SkillPrompt   string // If set, send this as a prompt to the agent
	PlanToggle    bool   // Toggle plan mode
	SessionTitle  string // Rename current session
	VimToggle     bool   // Toggle vim mode
	StartLogin    bool   // Start interactive login wizard
}

Result is returned by slash command handlers

func SaveProviderConfig added in v0.6.1

func SaveProviderConfig(provider, apiKey, baseURL, model string) Result

SaveProviderConfig writes provider config to settings.json

Jump to

Keyboard shortcuts

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