88 "os"
99 "strings"
1010
11- "charm.land/lipgloss/v2"
1211 "github.com/psviderski/uncloud/cmd/uncloud/caddy"
1312 cmdcontext "github.com/psviderski/uncloud/cmd/uncloud/context"
1413 "github.com/psviderski/uncloud/cmd/uncloud/dns"
@@ -19,6 +18,7 @@ import (
1918 "github.com/psviderski/uncloud/cmd/uncloud/wg"
2019 "github.com/psviderski/uncloud/internal/cli"
2120 "github.com/psviderski/uncloud/internal/cli/config"
21+ "github.com/psviderski/uncloud/internal/cli/tui"
2222 "github.com/psviderski/uncloud/internal/fs"
2323 "github.com/psviderski/uncloud/internal/log"
2424 "github.com/psviderski/uncloud/internal/machine"
@@ -39,7 +39,6 @@ func main() {
3939 cmd := & cobra.Command {
4040 Use : "uc" ,
4141 Short : "A CLI tool for managing Uncloud resources such as machines, services, and volumes." ,
42- Version : version .String (),
4342 SilenceUsage : true ,
4443 SilenceErrors : true ,
4544 PersistentPreRunE : func (cmd * cobra.Command , args []string ) error {
@@ -113,15 +112,11 @@ func main() {
113112 defaultHelpFunc (c , args )
114113 // Only show links for the root 'uc' command.
115114 if c .Name () == "uc" {
116- urlStyle := lipgloss .NewStyle ().
117- Underline (true ).
118- Foreground (lipgloss .Color ("12" )) // light blue
119-
120115 fmt .Fprintln (c .OutOrStdout ())
121116 fmt .Fprintf (c .OutOrStdout (), "Learn more about Uncloud: %s\n " ,
122- urlStyle . Render ("https://uncloud.run/docs" ))
117+ tui . URLStyle . Render (version . DocsURL ))
123118 fmt .Fprintf (c .OutOrStdout (), "Join our Discord community: %s\n " ,
124- urlStyle . Render ("https://uncloud.run/discord" ))
119+ tui . URLStyle . Render (version . DiscordURL ))
125120 }
126121 })
127122
@@ -151,6 +146,7 @@ func main() {
151146 service .NewScaleCommand ("service" ),
152147 service .NewStartCommand ("service" ),
153148 service .NewStopCommand ("service" ),
149+ NewVersionCommand (),
154150 volume .NewRootCommand (),
155151 wg .NewRootCommand (),
156152 )
0 commit comments