Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CustomHelpTemplate = getHelpHeader() + `
{{with .Long}}{{. | trimTrailingWhitespaces}}
{{end}}{{if or .Runnable .HasSubCommands}}` + getSectionHeader("Usage:") + `{{if .Runnable}}
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
` + getSectionHeader("Aliases:") + `
{{.NameAndAliases}}{{end}}{{if .HasExample}}
` + getSectionHeader("Examples:") + `
{{.Example}}{{end}}{{if .HasAvailableSubCommands}}{{$cmds := .Commands}}{{if eq (len .Groups) 0}}
` + getSectionHeader("Available Commands:") + `{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
` + getCommandColor() + `{{rpad .Name .NamePadding }}` + resetCommandStyle() + ` {{.Short}}{{end}}{{end}}{{else}}{{range $group := .Groups}}{{$hasCommands := false}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}}{{$hasCommands = true}}{{end}}{{end}}{{if $hasCommands}}
` + getSectionHeader("{{.Title}}") + `{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}}
` + getCommandColor() + `{{rpad .Name .NamePadding }}` + resetCommandStyle() + ` {{.Short}}{{end}}{{end}}{{end}}{{end}}{{if not .AllChildCommandsHaveGroup}}
` + getSectionHeader("Additional Commands:") + `{{range $cmds}}{{if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}}
` + getCommandColor() + `{{rpad .Name .NamePadding }}` + resetCommandStyle() + ` {{.Short}}{{end}}{{end}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
` + getSectionHeader("Flags:") + `
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}
` + getSectionHeader("Global Flags:") + `
{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}}
` + getSectionHeader("Additional help topics:") + `{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}}
{{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}}
Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}}{{end}}
`
View Source
var RootCmd = &cobra.Command{ Use: internalVersion.CliName, Version: internalVersion.Version, Short: "Build AI Applications Faster", Long: ` The DataRobot CLI helps you quickly set up, configure, and deploy AI applications using pre-built templates. Get from idea to production in minutes, not hours. ✨ ` + tui.BaseTextStyle.Render("What you can do:") + ` • Choose from ready-made AI application templates • Set up your development environment quickly • Deploy to DataRobot with a single command • Manage environment variables and configurations 🎯 ` + tui.BaseTextStyle.Render("Quick Start:") + ` dr start # Create your first AI app (start here!) dr --help # Show all available commands 💡 ` + tui.BaseTextStyle.Render("New to AI development?") + ` Perfect! Run 'dr start' and we'll guide you through everything.`, PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { useDebug, _ := cmd.Flags().GetBool("debug") useVerbose, _ := cmd.Flags().GetBool("verbose") if useDebug { setLogLevel(log.DebugLevel) } else if useVerbose { setLogLevel(log.InfoLevel) } return initializeConfig(cmd) }, PostRun: func(_ *cobra.Command, _ []string) { setLogLevelFromConfig() }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
func ExecuteContext ¶ added in v0.1.5
ExecuteContext executes the root command with the given context. It adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.