@@ -28,7 +28,7 @@ type Board struct {
2828var setupCmd = & cobra.Command {
2929 Use : "setup" ,
3030 Short : "Interactive setup wizard" ,
31- Long : "Configure Fizzy CLI with your API token, account, and default board." ,
31+ Long : "Configure Fizzy CLI with your API token, account, and default board.\n New users without an account will be guided through signup. " ,
3232 RunE : runSetup ,
3333}
3434
@@ -46,6 +46,26 @@ func runSetup(cmd *cobra.Command, args []string) error {
4646 fmt .Println ("Welcome to Fizzy CLI setup!" )
4747 fmt .Println ()
4848
49+ // Ask if user has an account before checking existing config
50+ var hasAccount string
51+ err := huh .NewSelect [string ]().
52+ Title ("Do you have a Fizzy account?" ).
53+ Options (
54+ huh .NewOption ("Yes, I have an account" , "yes" ),
55+ huh .NewOption ("No, I'd like to sign up" , "no" ),
56+ ).
57+ Value (& hasAccount ).
58+ Run ()
59+
60+ if err != nil {
61+ fmt .Println ("Setup cancelled." )
62+ return nil //nolint:nilerr // user cancelled prompt
63+ }
64+
65+ if hasAccount == "no" {
66+ return signupWizard ()
67+ }
68+
4969 // Check for existing config
5070 globalExists := config .Exists ()
5171 localPath := config .LocalConfigPath ()
@@ -57,7 +77,7 @@ func runSetup(cmd *cobra.Command, args []string) error {
5777 configLocation = "local config (" + localPath + ")"
5878 }
5979
60- err : = huh .NewConfirm ().
80+ err = huh .NewConfirm ().
6181 Title (fmt .Sprintf ("Existing %s found. Reconfigure?" , configLocation )).
6282 Value (& reconfigure ).
6383 Run ()
@@ -75,7 +95,7 @@ func runSetup(cmd *cobra.Command, args []string) error {
7595
7696 // Ask hosted vs self-hosted
7797 var hostingType string
78- err : = huh .NewSelect [string ]().
98+ err = huh .NewSelect [string ]().
7999 Title ("Are you using the hosted or self-hosted version?" ).
80100 Options (
81101 huh .NewOption ("Hosted (app.fizzy.do)" , "hosted" ),
0 commit comments