login

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package login provides the defined login CLI command for Vela.

Usage:

import "github.com/go-vela/cli/command/login"

Index

Constants

This section is empty.

Variables

View Source
var CommandLogin = &cli.Command{
	Name:        "login",
	Description: "Use this command to authenticate and login to Vela.",
	Usage:       "Authenticate and login to Vela",
	Action:      runLogin,
	Flags: []cli.Flag{

		&cli.StringFlag{
			EnvVars: []string{"VELA_ADDR", "LOGIN_ADDR"},
			Name:    internal.FlagAPIAddress,
			Aliases: []string{"a"},
			Usage:   "Vela server address as a fully qualified url (<scheme>://<host>)",
		},

		&cli.StringFlag{
			EnvVars: []string{"VELA_ACCESS_TOKEN", "CONFIG_ACCESS_TOKEN"},
			Name:    internal.FlagAPIAccessToken,
			Aliases: []string{"at"},
			Usage:   "access token used for communication with the Vela server",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_REFRESH_TOKEN", "CONFIG_REFRESH_TOKEN"},
			Name:    internal.FlagAPIRefreshToken,
			Aliases: []string{"rt"},
			Usage:   "refresh token used for communication with the Vela server",
		},
		&cli.BoolFlag{
			EnvVars: []string{"VELA_YES_ALL", "CONFIG_YES_ALL"},
			Name:    "yes-all",
			Aliases: []string{"y"},
			Usage:   "auto-confirm all prompts",
			Value:   false,
		},

		&cli.StringFlag{
			EnvVars: []string{"VELA_TOKEN", "CONFIG_TOKEN"},
			Name:    internal.FlagAPIToken,
			Usage:   "hidden flag to clear existing token",
			Hidden:  true,
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
  1. Login to Vela (will launch browser).
    $ {{.HelpName}} --api.addr https://vela.example.com

DOCUMENTATION:

  https://go-vela.github.io/docs/reference/cli/login/
`, cli.CommandHelpTemplate),
}

CommandLogin defines the command for authenticating and logging in to Vela.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL