cmd

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package cmd has all commands for ca

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedToGetCurrentDir  = errors.New("failed to get current directory")
	ErrMissingPrompt          = errors.New("failed as prompt not specified")
	ErrAIProcessingFailed     = errors.New("AI modification failed")
	ErrFailedToWriteChanges   = errors.New("failed to write changes")
	ErrFailedToLoadSession    = errors.New("failed to load session")
	ErrFailedToSaveSession    = errors.New("failed to save session")
	ErrFileOutsideCurrentDir  = errors.New("file is outside the current directory")
	ErrFailedToResolveAbsPath = errors.New("failed to resolve absolute path")
	ErrFailedToReadFile       = errors.New("failed to read file")
	ErrFilesMustBeSpecified   = errors.New("failed as files not specified")
)

Predefined Errors.

View Source
var (
	ErrProviderRequired = errors.New("provider is required")
	ErrModelRequired    = errors.New("model is required")
	ErrAPITokenRequired = errors.New("api token is required")
)

Functions

func CodeCommand

func CodeCommand() *cli.Command

CodeCommand applies AI modifications to code.

func EndSessionCommand

func EndSessionCommand() *cli.Command

EndSessionCommand archives the session.

func GlobalFlags

func GlobalFlags() []cli.Flag

GlobalFlags defines global CLI flags.

func NewSessionCommand

func NewSessionCommand() *cli.Command

NewSessionCommand initializes a new coding session.

func ReviewCommand

func ReviewCommand() *cli.Command

ReviewCommand shows the session progress and diffs.

func RollbackCommand

func RollbackCommand() *cli.Command

RollbackCommand undoes a specific AI-modified step.

Types

type LLMConfig added in v1.2.0

type LLMConfig struct {
	Provider   string         // E.g. "openai", "ollama", "azureopenai", etc.
	Model      string         // E.g. "gpt-4", "deepseek", ...
	APIKey     string         // For openai/anthropic, not needed by ollama
	Endpoint   string         // E.g. for azureopenai or a remote Ollama
	MaxTokens  int            // Common
	MaxRetries int            // Common
	RetryDelay time.Duration  // Common
	LogLevel   gollm.LogLevel // Common
	// contains filtered or unexported fields
}

LLMConfig is a catch-all config. Some fields only matter for certain providers.

func NewLLMConfigFromContext added in v1.2.0

func NewLLMConfigFromContext(c *cli.Context) *LLMConfig

NewLLMConfigFromContext extracts the LLM configuration from the CLI context.

func (*LLMConfig) BuildLLM added in v1.2.0

func (c *LLMConfig) BuildLLM() (gollm.LLM, error)

BuildLLM applies the validated fields to construct a gollm.LLM.

func (*LLMConfig) Validate added in v1.2.0

func (c *LLMConfig) Validate() error

Validate checks that all required fields are present for the given provider.

Jump to

Keyboard shortcuts

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