88 "github.com/charmbracelet/huh"
99 "github.com/charmbracelet/lipgloss"
1010 "github.com/nitrictech/suga/cli/internal/api"
11+ "github.com/nitrictech/suga/cli/internal/config"
1112 "github.com/nitrictech/suga/cli/internal/style"
1213 "github.com/nitrictech/suga/cli/internal/style/colors"
1314 "github.com/nitrictech/suga/cli/internal/style/icons"
@@ -19,6 +20,7 @@ import (
1920)
2021
2122type TeamApp struct {
23+ config * config.Config
2224 apiClient * api.SugaApiClient
2325 // auth uses WorkOSAuth directly because team switching requires
2426 // WorkOS-specific organization ID during token refresh
@@ -27,6 +29,7 @@ type TeamApp struct {
2729}
2830
2931func NewTeamApp (injector do.Injector ) (* TeamApp , error ) {
32+ config := do.MustInvoke [* config.Config ](injector )
3033 apiClient , err := api .NewSugaApiClient (injector )
3134 if err != nil {
3235 return nil , fmt .Errorf ("failed to create API client: %w" , err )
@@ -38,6 +41,7 @@ func NewTeamApp(injector do.Injector) (*TeamApp, error) {
3841 styles := tui .NewAppStyles ()
3942
4043 return & TeamApp {
44+ config : config ,
4145 apiClient : apiClient ,
4246 auth : auth ,
4347 styles : styles ,
@@ -56,7 +60,11 @@ func (t *TeamApp) SwitchTeam(teamSlug string) error {
5660 }
5761
5862 if len (allTeams ) == 0 {
59- fmt .Println ("No teams found. Create a team first to continue." )
63+ url := t .config .Url
64+ if url == "" {
65+ url = "the Suga dashboard"
66+ }
67+ fmt .Printf ("No teams found. Navigate to %s in your browser to create your first team.\n " , style .Teal (url ))
6068 return nil
6169 }
6270
0 commit comments