Documentation
¶
Overview ¶
Package cli provides simplified command-line interface This version removes all subcommands for a cleaner, more direct experience
Package cli provides command-line interface functionality ¶
This package coordinates CLI operations but delegates business logic to appropriate service packages. It should focus on: - Command parsing and validation - User interaction (prompts, output formatting) - Calling appropriate services - Error presentation to users
Business logic should live in service packages, not here.
Package cli provides command-line interface implementations ¶
Package cli provides first-time setup functionality
Index ¶
- func RunSetupIfNeeded(cfg *config.Config) error
- func ShowBeautifulWelcome(userName string)
- type ChatOptions
- type Session
- func (s *Session) AI() *ai.Service
- func (s *Session) Assistant() assistant.Assistant
- func (s *Session) Chat(ctx context.Context, req assistant.Request) (*assistant.Response, error)
- func (s *Session) Config() *config.Config
- func (s *Session) ConversationID() uuid.UUID
- func (s *Session) DB() *pgxpool.Pool
- func (s *Session) GetConversationID() string
- func (s *Session) GetConversationManager() *conversation.Manager
- func (s *Session) GetMaxTokens() int
- func (s *Session) GetOwnerName() string
- func (s *Session) GetTemperature() float32
- func (s *Session) HasDatabase() bool
- func (s *Session) HasMemoryCapability() bool
- func (s *Session) Options() ChatOptions
- func (s *Session) OwnerName() string
- func (s *Session) SetConversationID(id string) error
- func (s *Session) SetConversationUUID(id uuid.UUID)
- func (s *Session) SetMaxTokens(tokens int)
- func (s *Session) SetOptions(opts ChatOptions)
- func (s *Session) SetTemperature(temp float32)
- func (s *Session) Stream(ctx context.Context, req assistant.Request) (<-chan assistant.StreamChunk, error)
- type SetupWizard
- type SimpleRootCmd
- type UI
- type UserSetupInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunSetupIfNeeded ¶
RunSetupIfNeeded runs the setup wizard if needed
func ShowBeautifulWelcome ¶
func ShowBeautifulWelcome(userName string)
ShowBeautifulWelcome shows a beautiful welcome screen
Types ¶
type ChatOptions ¶
ChatOptions configures chat behavior
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session holds all state and dependencies for a CLI session. It follows the same pattern as ai.Service and assistant.Assistant.
func NewSession ¶
func NewSession(cfg *config.Config, ai *ai.Service, db *pgxpool.Pool, assistant assistant.Assistant, log logger.Logger) (*Session, error)
NewSession creates a new CLI session with validated dependencies. Returns an error if required dependencies are missing.
func (*Session) AI ¶
AI returns the session's AI service. This provides access to the underlying AI provider.
func (*Session) Assistant ¶
Assistant returns the session's assistant instance. This provides access to the chat functionality.
func (*Session) ConversationID ¶
ConversationID returns the current conversation ID
func (*Session) DB ¶
DB returns the session's database connection pool. Returns nil if no database is configured.
func (*Session) GetConversationID ¶
GetConversationID returns the current conversation ID as string
func (*Session) GetConversationManager ¶
func (s *Session) GetConversationManager() *conversation.Manager
GetConversationManager returns the conversation manager if available This is a more specific method that avoids exposing raw database
func (*Session) GetMaxTokens ¶
GetMaxTokens returns the max tokens setting
func (*Session) GetOwnerName ¶
GetOwnerName returns the owner's name
func (*Session) GetTemperature ¶
GetTemperature returns the temperature setting
func (*Session) HasDatabase ¶
HasDatabase returns true if a database is configured
func (*Session) HasMemoryCapability ¶
HasMemoryCapability returns true if memory features are available
func (*Session) Options ¶
func (s *Session) Options() ChatOptions
Options returns the current chat options
func (*Session) SetConversationID ¶
SetConversationID updates the conversation ID from string
func (*Session) SetConversationUUID ¶
SetConversationUUID updates the conversation ID
func (*Session) SetMaxTokens ¶
SetMaxTokens sets the max tokens
func (*Session) SetOptions ¶
func (s *Session) SetOptions(opts ChatOptions)
SetOptions updates the chat options
func (*Session) SetTemperature ¶
SetTemperature sets the temperature
type SetupWizard ¶
type SetupWizard struct {
// contains filtered or unexported fields
}
SetupWizard runs the first-time setup wizard
func NewSetupWizard ¶
func NewSetupWizard(cfg *config.Config) *SetupWizard
NewSetupWizard creates a new setup wizard
type SimpleRootCmd ¶
type SimpleRootCmd struct {
// contains filtered or unexported fields
}
SimpleRootCmd creates a simplified root command with no subcommands
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI provides simple command-line interface (no TTY dependency)
func (*UI) ShowMessage ¶
ShowMessage shows message
Directories
¶
| Path | Synopsis |
|---|---|
|
Package chat provides improved chat functionality
|
Package chat provides improved chat functionality |
|
Package command implements the command system for the CLI interface.
|
Package command implements the command system for the CLI interface. |
|
Package shutdown provides graceful shutdown with progress display
|
Package shutdown provides graceful shutdown with progress display |
|
Package startup provides beautiful initialization progress display
|
Package startup provides beautiful initialization progress display |
|
Package terminal provides enhanced terminal input handling
|
Package terminal provides enhanced terminal input handling |
|
Package ui provides unified UI components for the CLI
|
Package ui provides unified UI components for the CLI |
|
components/chat
Package chat provides chat UI animations
|
Package chat provides chat UI animations |
|
components/styles
Package styles provides shared UI styles and theming for the CLI interface.
|
Package styles provides shared UI styles and theming for the CLI interface. |
|
render
Package render provides UI component builders for dynamic rendering
|
Package render provides UI component builders for dynamic rendering |
|
views/conversations
Package conversations provides UI components for conversation management
|
Package conversations provides UI components for conversation management |