@@ -10,7 +10,6 @@ import (
1010
1111 nodev1 "buf.build/gen/go/brevdev/devplane/protocolbuffers/go/devplaneapi/v1"
1212 "connectrpc.com/connect"
13- "github.com/briandowns/spinner"
1413 "github.com/google/uuid"
1514
1615 "github.com/brevdev/brev-cli/pkg/config"
@@ -212,9 +211,11 @@ func runRegister(ctx context.Context, t *terminal.Terminal, s RegisterStore, opt
212211 t .Vprintf (" %s %s\n " , t .Green (fmt .Sprintf ("%-14s" , "Organization:" )), t .BoldBlue (org .Name + " (" + org .ID + ")" ))
213212 t .Vprint ("" )
214213 t .Vprint (t .Yellow (" This will:" ))
215- t .Vprint (" 1. Set up Brev tunnel" )
214+ t .Vprint (" 1. Download and install Brev tunnel" )
216215 t .Vprint (" 2. Collect hardware profile" )
217216 t .Vprint (" 3. Register this machine with Brev" )
217+ t .Vprint (" 4. Store registration data" )
218+ t .Vprint (" 5. Connect device to Brev" )
218219 t .Vprint ("" )
219220
220221 if opts .interactive {
@@ -260,38 +261,18 @@ func runRegister(ctx context.Context, t *terminal.Terminal, s RegisterStore, opt
260261// runRegisterSteps performs netbird install, hardware profile, AddNode, save registration, and runSetup.
261262// It does not prompt or enable SSH. Used by both flag-driven and prompt-driven flows.
262263func runRegisterSteps (ctx context.Context , t * terminal.Terminal , s RegisterStore , name string , org * entity.Organization , deps registerDeps ) (* DeviceRegistration , error ) {
263- const clearLine = "\033 [2K\n "
264264 t .Vprint ("" )
265265
266- // Stop spinner (and clear its line) before any of our prints so stdout and stderr don't interleave.
267- var sp * spinner.Spinner
268- stopSpinner := func () {
269- if sp != nil {
270- sp .FinalMSG = clearLine
271- sp .Stop ()
272- sp = nil
273- }
274- }
275- defer stopSpinner ()
276-
277- t .Vprint (t .Yellow ("[Step 1/3] Setting up Brev tunnel..." ))
278- sp = t .NewSpinner ()
279- sp .Suffix = " Registering device..."
280- sp .Start ()
266+ t .Vprint (t .Yellow ("[Step 1/5] Downloading and installing Brev tunnel..." ))
281267 err := deps .netbird .Install ()
282- stopSpinner ()
283268 if err != nil {
284269 return nil , fmt .Errorf ("brev tunnel setup failed: %w" , err )
285270 }
286271 t .Vprintf ("%s Brev tunnel ready.\n " , t .Green (" ✓" ))
287272
288273 t .Vprint ("" )
289- t .Vprint (t .Yellow ("[Step 2/3] Collecting hardware profile..." ))
290- sp = t .NewSpinner ()
291- sp .Suffix = " Registering device..."
292- sp .Start ()
274+ t .Vprint (t .Yellow ("[Step 2/5] Collecting hardware profile..." ))
293275 hwProfile , err := deps .hardwareProfiler .Profile ()
294- stopSpinner ()
295276 if err != nil {
296277 return nil , fmt .Errorf ("failed to collect hardware profile: %w" , err )
297278 }
@@ -301,10 +282,7 @@ func runRegisterSteps(ctx context.Context, t *terminal.Terminal, s RegisterStore
301282 t .Vprint (FormatHardwareProfile (hwProfile ))
302283
303284 t .Vprint ("" )
304- t .Vprint (t .Yellow ("[Step 3/3] Registering with Brev..." ))
305- sp = t .NewSpinner ()
306- sp .Suffix = " Registering device..."
307- sp .Start ()
285+ t .Vprint (t .Yellow ("[Step 3/5] Registering device with Brev..." ))
308286 deviceID := uuid .New ().String ()
309287 client := deps .nodeClients .NewNodeClient (s , config .GlobalConfig .GetBrevPublicAPIURL ())
310288 addResp , err := client .AddNode (ctx , connect .NewRequest (& nodev1.AddNodeRequest {
@@ -314,7 +292,6 @@ func runRegisterSteps(ctx context.Context, t *terminal.Terminal, s RegisterStore
314292 NodeSpec : toProtoNodeSpec (hwProfile ),
315293 }))
316294 if err != nil {
317- stopSpinner ()
318295 return nil , fmt .Errorf ("failed to register node: %w" , err )
319296 }
320297
@@ -328,13 +305,17 @@ func runRegisterSteps(ctx context.Context, t *terminal.Terminal, s RegisterStore
328305 RegisteredAt : time .Now ().UTC ().Format (time .RFC3339 ),
329306 HardwareProfile : * hwProfile ,
330307 }
308+
309+ t .Vprint ("" )
310+ t .Vprint (t .Yellow ("[Step 4/5] Storing registration data..." ))
331311 if err := deps .registrationStore .Save (reg ); err != nil {
332- stopSpinner ()
333312 return nil , fmt .Errorf ("node registered but failed to save locally: %w" , err )
334313 }
335314
315+ t .Vprint ("" )
316+ t .Vprint (t .Yellow ("[Step 5/5] Connecting device to Brev..." ))
336317 runSetup (node , t , deps )
337- stopSpinner ()
318+
338319 t .Vprintf ("%s Node registered.\n " , t .Green (" ✓" ))
339320 t .Vprintf ("%s Registration complete.\n " , t .Green (" ✓" ))
340321 return reg , nil
0 commit comments