diff options
| author | Kujtim Hoxha <[email protected]> | 2025-03-25 13:04:36 +0100 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-03-26 01:12:30 +0100 |
| commit | 904061c243f70696bfe781e97bf4e392e6954d07 (patch) | |
| tree | 4428f96d09968ee0cde44e6ebbaee4757f80050e /cmd | |
| parent | 005b8ac16776512b2d4b1f22bd989da162ca1bad (diff) | |
| download | opencode-904061c243f70696bfe781e97bf4e392e6954d07.tar.gz opencode-904061c243f70696bfe781e97bf4e392e6954d07.zip | |
additional tools
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/root.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/root.go b/cmd/root.go index 9e5ddbd7d..ddab0d81a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -10,6 +10,7 @@ import ( "github.com/kujtimiihoxha/termai/internal/db" "github.com/kujtimiihoxha/termai/internal/llm/models" "github.com/kujtimiihoxha/termai/internal/tui" + zone "github.com/lrstanley/bubblezone" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -37,9 +38,11 @@ var rootCmd = &cobra.Command{ app := app.New(ctx, conn) app.Logger.Info("Starting termai...") + zone.NewGlobal() tui := tea.NewProgram( tui.New(app), tea.WithAltScreen(), + tea.WithMouseCellMotion(), ) app.Logger.Info("Setting up subscriptions...") ch, unsub := setupSubscriptions(app) @@ -102,6 +105,16 @@ func setupSubscriptions(app *app.App) (chan tea.Msg, func()) { wg.Done() }() } + { + sub := app.Permissions.Subscribe(ctx) + wg.Add(1) + go func() { + for ev := range sub { + ch <- ev + } + wg.Done() + }() + } return ch, func() { cancel() wg.Wait() @@ -130,6 +143,7 @@ func loadConfig() { // LLM viper.SetDefault("models.big", string(models.DefaultBigModel)) viper.SetDefault("models.small", string(models.DefaultLittleModel)) + viper.SetDefault("providers.openai.key", os.Getenv("OPENAI_API_KEY")) viper.SetDefault("providers.anthropic.key", os.Getenv("ANTHROPIC_API_KEY")) viper.SetDefault("providers.groq.key", os.Getenv("GROQ_API_KEY")) |
