Skip to content

Commit 96b6a70

Browse files
committed
fix(cli): provide instructions on how to create a team
1 parent adb9021 commit 96b6a70

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cli/pkg/app/team.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
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

2122
type 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

2931
func 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,7 @@ 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+
fmt.Printf("No teams found. Navigate to %s in your browser to create your first team.", style.Teal(t.config.Url))
6064
return nil
6165
}
6266

0 commit comments

Comments
 (0)