{"modulePath":"github.com/hostinger/mail-api-cli","version":"v1.11.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmd\n\n## Variables\n\n```go\nvar AskFlagValue = askFlagValue\n```\nAskFlagValue returns ok=false when it cannot ask. Tests replace it.\n\n```go\nvar AuthCmd = \u0026cobra.Command{\n\tUse:     \"auth\",\n\tShort:   \"Sign in and check which credentials are used\",\n\tGroupID: groupSetup,\n\tArgs:    cobra.ArbitraryArgs,\n\tRunE:    utils.GroupRunE,\n}\n```\n\n```go\nvar ConfigCmd = \u0026cobra.Command{\n\tUse:     \"config\",\n\tShort:   \"Read and write CLI settings\",\n\tGroupID: groupSetup,\n\tArgs:    cobra.ArbitraryArgs,\n\tRunE:    utils.GroupRunE,\n}\n```\n\n```go\nvar RootCmd = \u0026cobra.Command{\n\tUse:   \"hostinger-mail\",\n\tShort: \"Hostinger Mail API Command Line Interface\",\n\tLong:  \"Hostinger Mail API Command Line Interface.\\n\\nGet started:\\n  1. Sign in:        hostinger-mail config set api_token   (or set HOSTINGER_MAIL_API_TOKEN)\\n\\nOutput is a table on a terminal and JSON when piped; pick one with --format\\n(table|json|yaml|tree) or filter it with --jq. Missing arguments and required\\nflags are prompted for in a terminal (disable with --no-input). Commands that\\ndelete or stop things ask for confirmation (skip with --yes), and --dry-run\\nprints the request as curl without sending it.\\n\\nDocumentation: https://github.com/hostinger/mail-api-cli/tree/main/docs\",\n\n\tSilenceErrors:     true,\n\tSilenceUsage:      true,\n\tPersistentPreRunE: preRun,\n}\n```\n\n```go\nvar VersionCmd = \u0026cobra.Command{\n\tUse:   \"version\",\n\tShort: \"Show the current version\",\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tfmt.Println(utils.CLIVersion.String(true))\n\t},\n}\n```\n\n## Functions\n\n```go\nfunc Execute()\n```\nExecute 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.\n\n```go\nfunc Question(f *pflag.Flag) string\n```\nQuestion is a short title for common flags, else the trimmed flag help.\n\n","path":"github.com/hostinger/mail-api-cli/cmd","name":"cmd","synopsis":"","isRedistributable":true}
