Documentation
¶
Overview ¶
internal/cli/component.go
internal/cli/config.go
internal/cli/database.go
internal/cli/debug.go
internal/cli/doctor.go
internal/cli/export.go
internal/cli/helpers.go
internal/cli/info.go
internal/cli/init_interactive.go Package cli implements the command-line interface for LocalCloud
internal/cli/logs.go
internal/cli/models.go
internal/cli/mongodb.go
internal/cli/ps.go
internal/cli/reset.go
internal/cli/restart.go
internal/cli/root.go
internal/cli/service.go
internal/cli/setup.go
internal/cli/start.go
internal/cli/status.go - Enhanced version with resource monitoring
internal/cli/stop.go
internal/cli/storage.go
internal/cli/tunnel.go
Index ¶
- Variables
- func Execute()
- func FormatBytes(bytes int64) string
- func FormatError(err error) string
- func GetProjectRoot() (string, error)
- func InitializeTemplateFS(fs embed.FS)
- func IsProjectInitialized() bool
- func PrintMongoDBServiceInfo(port int)
- func PrintPgVectorServiceInfo(port int)
- func PrintPostgreSQLServiceInfo(port int, extensions []string)
- func PrintRedisCacheInfo(port int)
- func PrintRedisQueueInfo(port int)
- func RunInteractiveInit(projectName string) error
- func SetTemplateFS(fs embed.FS)
- func SetVersionInfo(v, c, d string)
- func TemplatesCmd() *cobra.Command
- type CLIError
- type EmbeddingData
- type ExportInfo
- type InteractiveConfig
- type StorageCredentials
- type VectorExportData
Constants ¶
This section is empty.
Variables ¶
var ( ErrDockerNotRunning = &CLIError{ Type: "docker_not_running", Message: "Docker is not running", Solution: `Start Docker: - macOS/Windows: Open Docker Desktop - Linux: sudo systemctl start docker For installation: https://docs.docker.com/get-docker/`, } ErrPortInUse = &CLIError{ Type: "port_in_use", Message: "Port already in use", } ErrInsufficientMemory = &CLIError{ Type: "insufficient_memory", Message: "Insufficient memory", Solution: `LocalCloud requires at least 4GB of RAM. To free up memory: - Close unnecessary applications - Use smaller AI models (gemma2:2b, phi3:mini) - Reduce memory limits in config`, } ErrDiskSpace = &CLIError{ Type: "disk_space", Message: "Insufficient disk space", Solution: `Free up disk space: - Remove unused Docker images: docker system prune -a - Clear logs: rm -rf .localcloud/logs/* - Remove unused models: lc models remove <model>`, } )
Common error types
var (
ServiceCmd = serviceCmd
)
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately.
func FormatBytes ¶
FormatBytes converts bytes to human readable format
func FormatError ¶
FormatError formats an error with helpful information
func GetProjectRoot ¶
GetProjectRoot finds the project root directory by looking for .localcloud folder
func InitializeTemplateFS ¶
InitializeTemplateFS sets the template filesystem for commands that need it
func IsProjectInitialized ¶
func IsProjectInitialized() bool
IsProjectInitialized checks if a project is initialized
func PrintMongoDBServiceInfo ¶
func PrintMongoDBServiceInfo(port int)
PrintMongoDBServiceInfo prints MongoDB service information
func PrintPgVectorServiceInfo ¶
func PrintPgVectorServiceInfo(port int)
func PrintPostgreSQLServiceInfo ¶
PrintPostgreSQLServiceInfo prints standard PostgreSQL service information
func PrintRedisCacheInfo ¶
func PrintRedisCacheInfo(port int)
func PrintRedisQueueInfo ¶
func PrintRedisQueueInfo(port int)
func RunInteractiveInit ¶
RunInteractiveInit runs the interactive initialization wizard
func SetVersionInfo ¶ added in v0.2.5
func SetVersionInfo(v, c, d string)
SetVersionInfo sets the version information from build-time variables
Types ¶
type EmbeddingData ¶
type ExportInfo ¶
type InteractiveConfig ¶
type InteractiveConfig struct {
ProjectName string
ProjectType string
Components []string
Models map[string]string // component -> model mapping
Services map[string]bool // enabled services
}
InteractiveConfig represents the configuration built during interactive init
type StorageCredentials ¶
type StorageCredentials struct {
Endpoint string `json:"endpoint"`
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
UseSSL bool `json:"use_ssl"`
ConsoleURL string `json:"console_url"`
BucketName string `json:"default_bucket"`
}
StorageCredentials holds MinIO connection information
type VectorExportData ¶
type VectorExportData struct {
ExportInfo ExportInfo `json:"export_info"`
Collections []string `json:"collections"`
Embeddings []EmbeddingData `json:"embeddings"`
ImportScript string `json:"import_script,omitempty"`
}
VectorExportData represents the structure for vector database export