Files
ghaymah_dev2 618e74277a
ci / build (push) Canceled after 0s
gy CLI: deploy any directory to a live URL
Commands: login/logout/whoami, deploy (TUI + plain/JSON/CI), logs, status, open, list, version.

- deploy pipeline: tar.gz source (gitignore/dockerignore aware) -> presigned upload -> cloud kaniko/buildpacks build -> live URL
- bubbletea/lipgloss TUI with upload progress + live log streaming; auto-falls-back to plain output in CI
- apiclient against the gateway /v1/deployments + /v1/apps endpoints
- GitHub Action (action.yml) + example workflow + install script
2026-10-24 05:18:43 -04:00

52 lines
1023 B
Go

package cli
import (
"fmt"
"os/exec"
"runtime"
"github.com/spf13/cobra"
)
func newOpenCmd() *cobra.Command {
var name string
cmd := &cobra.Command{
Use: "open",
Short: "Open the linked app in your browser",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := requireClient()
if err != nil {
return err
}
app, err := resolveApp(c, cwd(), name)
if err != nil {
return err
}
url := app.URL()
if url == "" {
return fmt.Errorf("app has no public URL yet")
}
if err := openBrowser(url); err != nil {
return err
}
fmt.Println("opened", url)
return nil
},
}
cmd.Flags().StringVar(&name, "name", "", "app name (defaults to the linked app)")
return cmd
}
func openBrowser(url string) error {
var cmd *exec.Cmd
switch runtime.GOOS {
case "darwin":
cmd = exec.Command("open", url)
case "windows":
cmd = exec.Command("rundll32", "url.dll,FileProtocolHandler", url)
default:
cmd = exec.Command("xdg-open", url)
}
return cmd.Start()
}