@@ -109,7 +109,7 @@ func runDeploy(cobraCmd *cobra.Command) error {
109109 cobraCmd .Printf ("\n ✓ Version created: %s\n " , resp .VersionID )
110110
111111 // Poll deployment status with beautiful UI
112- finalStatus , deploymentError , err := pollDeploymentStatus (applicationID , organizationID , resp .VersionID )
112+ finalStatus , deploymentError , appURL , err := pollDeploymentStatus (applicationID , organizationID , resp .VersionID )
113113 if err != nil {
114114 return fmt .Errorf ("failed to track deployment status: %w" , err )
115115 }
@@ -118,10 +118,8 @@ func runDeploy(cobraCmd *cobra.Command) error {
118118 if finalStatus == "DEPLOYED" {
119119 cobraCmd .Printf ("\n 🎉 Deployment successful!\n " )
120120
121- // Print application URL
122- cfg := singletons .GetConfig ()
123- if cfg != nil && cfg .AppURLSuffix != "" {
124- appURL := fmt .Sprintf ("https://app-%s.%s" , applicationID , cfg .AppURLSuffix )
121+ // Print application URL from the API response
122+ if appURL != "" {
125123 cobraCmd .Printf ("\n 🌐 Your application is live at:\n " )
126124 cobraCmd .Printf (" %s\n " , appURL )
127125 }
@@ -146,6 +144,7 @@ type deploymentStatusModel struct {
146144 spinner spinner.Model
147145 status string
148146 deploymentError string
147+ appURL string
149148 err error
150149 done bool
151150 dots int // Track number of dots (0-4)
@@ -156,6 +155,7 @@ type deploymentStatusModel struct {
156155type statusMsg struct {
157156 status string
158157 deploymentError string
158+ appURL string
159159 err error
160160}
161161
@@ -179,6 +179,7 @@ func (m deploymentStatusModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
179179 case statusMsg :
180180 m .status = msg .status
181181 m .deploymentError = msg .deploymentError
182+ m .appURL = msg .appURL
182183 m .err = msg .err
183184
184185 // Check if we're in a terminal state
@@ -264,12 +265,13 @@ func pollStatus(applicationID, organizationID, versionID string) tea.Cmd {
264265 return statusMsg {
265266 status : resp .Status ,
266267 deploymentError : resp .DeploymentError ,
268+ appURL : resp .AppURL ,
267269 }
268270 }
269271}
270272
271273func tickCmd () tea.Cmd {
272- return tea .Tick (2 * time .Second , func (t time.Time ) tea.Msg {
274+ return tea .Tick (1 * time .Second , func (t time.Time ) tea.Msg {
273275 return tickMsg (t )
274276 })
275277}
@@ -310,7 +312,7 @@ func getStatusDisplay(status string) (string, string) {
310312 }
311313}
312314
313- func pollDeploymentStatus (applicationID , organizationID , versionID string ) (string , string , error ) {
315+ func pollDeploymentStatus (applicationID , organizationID , versionID string ) (string , string , string , error ) {
314316 s := spinner .New ()
315317 s .Spinner = spinner .Dot
316318 s .Style = lipgloss .NewStyle ().Foreground (lipgloss .Color ("205" ))
@@ -322,6 +324,7 @@ func pollDeploymentStatus(applicationID, organizationID, versionID string) (stri
322324 spinner : s ,
323325 status : "" ,
324326 deploymentError : "" ,
327+ appURL : "" ,
325328 done : false ,
326329 dots : 1 ,
327330 dotsIncreasing : true ,
@@ -331,15 +334,15 @@ func pollDeploymentStatus(applicationID, organizationID, versionID string) (stri
331334 p := tea .NewProgram (m )
332335 finalModel , err := p .Run ()
333336 if err != nil {
334- return "" , "" , err
337+ return "" , "" , "" , err
335338 }
336339
337340 finalStatusModel := finalModel .(deploymentStatusModel )
338341 if finalStatusModel .err != nil {
339- return "" , "" , finalStatusModel .err
342+ return "" , "" , "" , finalStatusModel .err
340343 }
341344
342- return finalStatusModel .status , finalStatusModel .deploymentError , nil
345+ return finalStatusModel .status , finalStatusModel .deploymentError , finalStatusModel . appURL , nil
343346}
344347
345348// formatDeploymentError formats the deployment error message with nice styling
0 commit comments