diff --git a/cmd/root.go b/cmd/root.go index 26c8e536..0b9034fd 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,6 +17,7 @@ import ( "github.com/agentuity/cli/internal/util" "github.com/agentuity/go-common/logger" "github.com/agentuity/go-common/tui" + "github.com/charmbracelet/lipgloss" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -29,21 +30,42 @@ var ( var cfgFile string +var logoColor = lipgloss.AdaptiveColor{Light: "#11c7b9", Dark: "#00FFFF"} +var logoStyle = lipgloss.NewStyle().Foreground(logoColor) +var logoBox = lipgloss.NewStyle(). + Width(52). + Border(lipgloss.RoundedBorder()). + BorderForeground(logoColor). + Padding(0, 1). + AlignVertical(lipgloss.Top). + AlignHorizontal(lipgloss.Left). + Foreground(logoColor) + // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ - Use: "agentuity", - Long: `Agentuity CLI is a command-line tool for building, managing, and deploying AI agents. - -Use the various commands to create projects, manage agents, set environment variables, -and deploy your agents to the Agentuity Cloud Platform. - -Run 'agentuity help ' for more information about a specific command.`, + Use: "agentuity", + Short: "Agentuity CLI is a command-line tool for building, managing, and deploying AI agents.", + PreRun: func(cmd *cobra.Command, args []string) { + // do this after load so we can get the dynamic version + cmd.Long = logoBox.Render(fmt.Sprintf(`%s %s + +Version: %s +Docs: %s +Community: %s +Dashboard: %s`, + tui.Bold("⨺ Agentuity"), + tui.Muted("Build, manage and deploy AI agents"), + Version, + tui.Link("https://agentuity.dev/docs"), + tui.Link("https://discord.gg/vtn3hgUfuc"), + tui.Link("https://app.agentuity.com"), + )) + }, Run: func(cmd *cobra.Command, args []string) { if version, _ := cmd.Flags().GetBool("version"); version { fmt.Println(Version) return } - tui.Logo() cmd.Help() }, } diff --git a/go.mod b/go.mod index 8f0e89d0..722dfc16 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.24.2 require ( github.com/Masterminds/semver v1.5.0 - github.com/agentuity/go-common v1.0.37 + github.com/agentuity/go-common v1.0.38 github.com/agentuity/mcp-golang/v2 v2.0.2 github.com/bmatcuk/doublestar/v4 v4.8.1 github.com/charmbracelet/bubbles v0.20.0 diff --git a/go.sum b/go.sum index a20824b2..0be6b61e 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/ProtonMail/go-crypto v1.1.5 h1:eoAQfK2dwL+tFSFpr7TbOaPNUbPiJj4fLYwwGE1FQO4= github.com/ProtonMail/go-crypto v1.1.5/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= -github.com/agentuity/go-common v1.0.37 h1:g/iWSftzK+bIt4B3GtXEjZW6wz+uNj90QSi603U39z8= -github.com/agentuity/go-common v1.0.37/go.mod h1:QBpIuVfB3s+t4edGydNCvVUkJsL8NROovBhkZGzNNoY= +github.com/agentuity/go-common v1.0.38 h1:ngx67t1H095HfY/2RdsDeezjTT0M3327eKDRYYzJYkY= +github.com/agentuity/go-common v1.0.38/go.mod h1:QBpIuVfB3s+t4edGydNCvVUkJsL8NROovBhkZGzNNoY= github.com/agentuity/mcp-golang/v2 v2.0.2 h1:wZqS/aHWZsQoU/nd1E1/iMsVY2dywWT9+PFlf+3YJxo= github.com/agentuity/mcp-golang/v2 v2.0.2/go.mod h1:U105tZXyTatxxOBlcObRgLb/ULvGgT2DJ1nq/8++P6Q= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= diff --git a/internal/errsystem/console.go b/internal/errsystem/console.go index c59fd796..d2e194c2 100644 --- a/internal/errsystem/console.go +++ b/internal/errsystem/console.go @@ -24,6 +24,7 @@ import ( var Version string = "dev" const baseDocURL = "https://agentuity.dev/errors/%s" +const discordURL = "https://discord.gg/vtn3hgUfuc" type crashReport struct { ID string `json:"id"` @@ -128,9 +129,11 @@ func (e *errSystem) ShowErrorAndExit() { detail = append(detail, tui.Bold(tui.PadRight("Error:", 10, " "))+style.Render(errmsg+"\n")) } } - detail = append(detail, tui.Bold(tui.PadRight("Code:", 10, " "))+e.code.Code) - detail = append(detail, tui.Bold(tui.PadRight("ID:", 10, " "))+e.id) - detail = append(detail, tui.Bold(tui.PadRight("Help:", 10, " "))+tui.Link(baseDocURL, e.code.Code)) + detail = append(detail, tui.Bold(tui.PadRight("Code:", 10, " "))+tui.Muted(e.code.Code)) + detail = append(detail, tui.Bold(tui.PadRight("ID:", 10, " "))+tui.Muted(e.id)) + detail = append(detail, tui.Bold(tui.PadRight("Doc:", 10, " "))+tui.Link(baseDocURL, e.code.Code)) + detail = append(detail, tui.Bold(tui.PadRight("Help:", 10, " "))+tui.Link(discordURL)) + detail = append(detail, tui.Bold(tui.PadRight("", 10, " "))+tui.Link("support@agentuity.com")) crashReportFile := e.writeCrashReportFile(stackTrace) for _, d := range detail { body.WriteString(tui.Muted(d) + "\n") diff --git a/internal/util/upgrade.go b/internal/util/upgrade.go index b1bb33c0..c206bf85 100644 --- a/internal/util/upgrade.go +++ b/internal/util/upgrade.go @@ -521,7 +521,7 @@ func upgradeWithHomebrew(ctx context.Context, logger logger.Logger) error { newVersion = strings.TrimSpace(string(v)) } - tui.ShowSpinner("Upgrading agentuity via Homebrew", action) + action() if err != nil { return err