Initilaize

This commit is contained in:
NEO
2025-04-15 19:58:39 +08:00
commit 126b128db2
11 changed files with 1079 additions and 0 deletions

37
cmd/lazykimi/main.go Normal file
View File

@@ -0,0 +1,37 @@
package main
import (
"fmt"
"lazykimi/internal/ui/app"
"os"
tea "github.com/charmbracelet/bubbletea/v2"
)
func main() {
// Get API key from environment
apiKey := os.Getenv("OPENAI_API_KEY")
if apiKey == "" {
fmt.Println("Error: Please set the OPENAI_API_KEY environment variable")
os.Exit(1)
}
// Initialize application
app, err := app.NewApp(apiKey)
if err != nil {
fmt.Println("Error initializing: " + err.Error())
os.Exit(1)
}
// Create and run program
p := tea.NewProgram(
app,
tea.WithAltScreen(),
tea.WithMouseAllMotion(),
)
if _, err := p.Run(); err != nil {
fmt.Println("Error running program: " + err.Error())
os.Exit(1)
}
}