Initilaize
This commit is contained in:
37
cmd/lazykimi/main.go
Normal file
37
cmd/lazykimi/main.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user