Documentation
¶
Overview ¶
Package commands handles slash commands for Celeste CLI. Commands provide direct user control over modes, endpoints, and configuration.
Index ¶
- func DetectRoutingHints(message string) string
- func IsContentPolicyRefusal(response string) bool
- func IsImageGenerationRequest(message string) bool
- type Command
- type CommandContext
- type CommandResult
- func Execute(cmd *Command, ctx *CommandContext) *CommandResult
- func HandleCollectionsCommand(cmd *Command, cfg *config.Config) *CommandResult
- func HandleContextCommand(args []string, contextTracker *config.ContextTracker) CommandResult
- func HandleExportCommand(args []string, currentSession *config.Session) CommandResult
- func HandleProvidersCommand(cmd *Command, ctx *CommandContext) *CommandResult
- func HandleStatsCommand(args []string, contextTracker *config.ContextTracker) CommandResult
- type SelectorData
- type SelectorItem
- type SessionAction
- type StateChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectRoutingHints ¶
DetectRoutingHints checks if message contains routing hints. Returns suggested endpoint or empty string.
func IsContentPolicyRefusal ¶
IsContentPolicyRefusal checks if the LLM response is a content policy refusal.
func IsImageGenerationRequest ¶
IsImageGenerationRequest checks if the message is requesting image generation.
Types ¶
type CommandContext ¶
type CommandContext struct {
NSFWMode bool
Provider string // Current provider (grok, openai, venice, etc.)
CurrentModel string // Current model in use
APIKey string // API key for model listing
BaseURL string // Base URL for API calls
SkillsEnabled bool // Whether skills/functions are currently enabled
Version string // Application version
Build string // Build identifier
}
CommandContext provides context for command execution.
type CommandResult ¶
type CommandResult struct {
Success bool
Message string
ShouldRender bool // Whether to show in chat history
StateChange *StateChange
}
CommandResult represents the result of executing a command.
func Execute ¶
func Execute(cmd *Command, ctx *CommandContext) *CommandResult
Execute executes a command and returns the result.
func HandleCollectionsCommand ¶
func HandleCollectionsCommand(cmd *Command, cfg *config.Config) *CommandResult
HandleCollectionsCommand handles the collections command and its subcommands. Usage:
celeste collections - Show help celeste collections create <name> - Create a collection celeste collections list - List all collections celeste collections upload <id> <files...> - Upload documents celeste collections delete <id> - Delete a collection celeste collections enable <id> - Add to active set celeste collections disable <id> - Remove from active set celeste collections show <id> - Show collection details
func HandleContextCommand ¶
func HandleContextCommand(args []string, contextTracker *config.ContextTracker) CommandResult
HandleContextCommand handles the /context command and its subcommands. Usage:
/context - Show current context usage /context status - Detailed context breakdown /context compact - Manual context compaction (future)
func HandleExportCommand ¶
func HandleExportCommand(args []string, currentSession *config.Session) CommandResult
HandleExportCommand exports the current or specified session
func HandleProvidersCommand ¶
func HandleProvidersCommand(cmd *Command, ctx *CommandContext) *CommandResult
HandleProvidersCommand handles the /providers command and its subcommands. Usage:
/providers - List all providers /providers --tools - Show only tool-capable providers /providers info <name> - Show detailed capabilities /providers current - Show current provider info
func HandleStatsCommand ¶
func HandleStatsCommand(args []string, contextTracker *config.ContextTracker) CommandResult
HandleStatsCommand displays a corruption-themed usage dashboard
type SelectorData ¶
type SelectorData struct {
Title string
Items []SelectorItem
}
SelectorData holds data for showing the interactive selector.
type SelectorItem ¶
SelectorItem represents an item in the interactive selector.
type SessionAction ¶
type SessionAction struct {
Action string // "new", "resume", "list", "clear", "merge", "info"
SessionID string // For resume/merge operations
Name string // For new session with name
}
SessionAction represents a session management operation.
type StateChange ¶
type StateChange struct {
EndpointChange *string
NSFWMode *bool
Model *string
ImageModel *string
ClearHistory bool
MenuState *string // "status", "commands", "skills"
SessionAction *SessionAction // Session management operations
ShowSelector *SelectorData // Show interactive selector
}
StateChange represents a change in application state.