Skip to content

Commit

Permalink
Edits to render root command and login copy (#155)
Browse files Browse the repository at this point in the history
* Edits to render root command copy

* Update login copy
  • Loading branch information
StephenBarlow authored Dec 3, 2024
1 parent d92d330 commit 67bced0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
13 changes: 8 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

var welcomeMsg = lipgloss.NewStyle().Bold(true).Foreground(renderstyle.ColorFocus).
Render("Welcome to the Render CLI!")
Render("Render CLI v" + cfg.Version)

var betaMsg = lipgloss.NewStyle().Foreground(renderstyle.ColorInfo).
Render("Note: The Render CLI is currently in beta, and may change as we release improvements and new features.")
Expand All @@ -30,11 +30,14 @@ var longHelp = fmt.Sprintf(`%s
%s
The Render CLI lets you manage your Render projects, environments, and services directly from the command line.
You can trigger deployments, view logs, and more—right from your terminal.
Welcome! Use the Render CLI to manage your services, datastores, and
environments directly from the command line. Trigger deploys, view logs,
start psql/SSH sessions, and more.
The CLI defaults to %s mode, offering an easy-to-use visual experience that makes it easier to find what you're looking for.
Prefer working without the interface? Use %s mode by specifying the --output option with either json or yaml for structured, scriptable responses.
The CLI's default %s mode provides intuitive, menu-based navigation.
To use in %s mode (such as in a script), set each command's --output
option to either json or yaml for structured responses.
`, welcomeMsg, betaMsg, renderstyle.Bold("interactive"), renderstyle.Bold("non-interactive"))

// rootCmd represents the base command when called without any subcommands
Expand Down
14 changes: 7 additions & 7 deletions pkg/tui/views/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NonInteractiveLogin(cmd *cobra.Command) error {

alreadyLoggedIn := isAlreadyLoggedIn(cmd.Context())
if alreadyLoggedIn {
command.Println(cmd, "Success! You are authenticated.")
command.Println(cmd, "Success: CLI is already authenticated.")
return nil
}

Expand All @@ -38,12 +38,12 @@ func NonInteractiveLogin(cmd *cobra.Command) error {
return err
}

command.Println(cmd, "Success! You are now authenticated.")
command.Println(cmd, "Login successful! CLI token saved.")

newVersion, err := vc.NewVersionAvailable()
if err == nil && newVersion != "" {
_, _ = cmd.ErrOrStderr().Write([]byte(fmt.Sprintf("\n%s\n\n", lipgloss.NewStyle().Foreground(renderstyle.ColorWarning).
Render(fmt.Sprintf("render v%s is available. Current version is %s.\nInstallation instructions can be found at: %s", newVersion, cfg.Version, cfg.InstallationInstructionsURL)))))
Render(fmt.Sprintf("render v%s is available. Current version is %s.\nInstallation instructions: %s", newVersion, cfg.Version, cfg.InstallationInstructionsURL)))))
}

return nil
Expand All @@ -60,12 +60,12 @@ func login(cmd *cobra.Command, c *oauth.Client) error {
return err
}

command.Println(cmd, "Complete the login via the dashboard. Launching browser to:\n\n\t%s\n\n", u)
command.Println(cmd, "Complete login in the Render Dashboard. Opening your browser to:\n\n\t%s\n\n", u)
err = dashboard.Open(u.String())
if err != nil {
return err
}
command.Println(cmd, "Waiting for login to complete...\n\n")
command.Println(cmd, "Waiting for login...\n\n")

token, err := pollForToken(cmd.Context(), c, dg)
if err != nil {
Expand Down Expand Up @@ -165,7 +165,7 @@ func (l *LoginView) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return tui.DoneLoadingDataMsg{}
},
),
LoadingMsgTmpl: fmt.Sprintf("Complete the login via the dashboard. Launching browser to:\n\n\t%s\n\n%%sWaiting for login...\n", l.dashURL),
LoadingMsgTmpl: fmt.Sprintf("Complete login in the Render Dashboard. Opening your browser to:\n\n\t%s\n\n%%sWaiting for login...\n", l.dashURL),
}
})
case loginCompleteMsg:
Expand All @@ -175,7 +175,7 @@ func (l *LoginView) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}

func (l *LoginView) View() string {
return fmt.Sprintf("Complete the login via the dashboard. Launching browser to:\n\n\t%s\n\nWaiting for login...\n", l.dashURL)
return fmt.Sprintf("Complete login in the Render Dashboard. Opening your browser to:\n\n\t%s\n\nWaiting for login...\n", l.dashURL)
}

func isAlreadyLoggedIn(ctx context.Context) bool {
Expand Down

0 comments on commit 67bced0

Please sign in to comment.