-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
39 lines (32 loc) · 758 Bytes
/
main.go
File metadata and controls
39 lines (32 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
"github.com/joho/godotenv"
"github.com/scottharvey/huddle/internal/tui"
)
func main() {
_ = godotenv.Load()
if os.Getenv("OPENROUTER_API_KEY") == "" {
fmt.Println("Error: OPENROUTER_API_KEY environment variable is required")
fmt.Println("Please set it in your environment or in a .env file")
os.Exit(1)
}
model, err := tui.NewModel()
if err != nil {
fmt.Printf("Error initializing application: %v\n", err)
os.Exit(1)
}
defer model.Close()
p := tea.NewProgram(
model,
tea.WithAltScreen(),
tea.WithMouseCellMotion(),
tea.WithMouseAllMotion(),
)
if _, err := p.Run(); err != nil {
fmt.Printf("Error running program: %v\n", err)
os.Exit(1)
}
}