Skip to content
Snippets Groups Projects
Commit 852a0c2b authored by Filip Aleksic's avatar Filip Aleksic Committed by Gary Holtz
Browse files

docs(help): document all environment variables

parent 648db314
No related branches found
No related tags found
1 merge request!1925docs(help): document all environment variables
......@@ -47,36 +47,42 @@ func NewCmdRoot(f *cmdutils.Factory, version, buildDate string) *cobra.Command {
SilenceUsage: true,
Annotations: map[string]string{
"help:environment": heredoc.Doc(`
GITLAB_TOKEN: An authentication token for API requests. Set this variable to
avoid prompts to authenticate. Overrides any previously-stored credentials.
Can be set in the config with 'glab config set token xxxxxx'.
BROWSER: The web browser to use for opening links.
Can be set in the config with 'glab config set browser mybrowser'.
GITLAB_HOST or GL_HOST: Specify the URL of the GitLab server if self-managed.
(Example: https://gitlab.example.com) Defaults to https://gitlab.com.
DEBUG: Set to 1 or true to output more logging information, including underlying Git commands,
expanded aliases and DNS error details.
FORCE_HYPERLINKS: Set to 1 to force hyperlinks in output, even when not outputting to a TTY.
GITLAB_CLIENT_ID: Provide custom 'client_id' generated by GitLab OAuth 2.0 application.
Defaults to the 'client-id' for GitLab.com.
REMOTE_ALIAS or GIT_REMOTE_URL_VAR: A 'git remote' variable or alias that contains
the GitLab URL. Can be set in the config with 'glab config set remote_alias origin'.
GITLAB_HOST or GL_HOST: Specify the URL of the GitLab server if self-managed.
(Example: https://gitlab.example.com) Defaults to https://gitlab.com.
VISUAL, EDITOR (in order of precedence): The editor tool to use for authoring text.
Can be set in the config with 'glab config set editor vim'.
GITLAB_TOKEN: An authentication token for API requests. Set this variable to
avoid prompts to authenticate. Overrides any previously-stored credentials.
Can be set in the config with 'glab config set token xxxxxx'.
BROWSER: The web browser to use for opening links.
Can be set in the config with 'glab config set browser mybrowser'.
GLAB_CHECK_UPDATE: Set to 1 or true to force an update check. By default the cli tool
checks for updates once a day.
GLAB_CONFIG_DIR: Set to a directory path to override the global configuration location.
GLAMOUR_STYLE: The environment variable to set your desired Markdown renderer style.
Available options: dark, light, notty. To set a custom style, read
https://github.com/charmbracelet/glamour#styles
NO_PROMPT: Set to 1 (true) or 0 (false) to disable or enable prompts.
NO_COLOR: Set to any value to avoid printing ANSI escape sequences for color output.
FORCE_HYPERLINKS: Set to 1 to force hyperlinks in output, even when not outputting to a TTY.
NO_PROMPT: Set to 1 (true) or 0 (false) to disable or enable prompts.
GLAB_CONFIG_DIR: Set to a directory path to override the global configuration location.
REMOTE_ALIAS or GIT_REMOTE_URL_VAR: A 'git remote' variable or alias that contains
the GitLab URL. Can be set in the config with 'glab config set remote_alias origin'.
VISUAL, EDITOR (in order of precedence): The editor tool to use for authoring text.
Can be set in the config with 'glab config set editor vim'.
`),
"help:feedback": heredoc.Docf(`
Encountered a bug or want to suggest a feature?
......
......@@ -11,6 +11,7 @@ import (
"gitlab.com/gitlab-org/cli/commands/cmdutils"
"github.com/MakeNowJust/heredoc/v2"
"github.com/hashicorp/go-version"
"github.com/spf13/cobra"
gitlab "gitlab.com/gitlab-org/api/client-go"
......@@ -25,9 +26,12 @@ var commandAliases = []string{"update"}
func NewCheckUpdateCmd(f *cmdutils.Factory, version string) *cobra.Command {
cmd := &cobra.Command{
Use: commandUse,
Short: "Check for latest glab releases.",
Long: ``,
Use: commandUse,
Short: "Check for latest glab releases.",
Long: heredoc.Doc(`Checks for new versions every 24 hours after any 'glab' command is run. Does not recheck if the most recent recheck is less than 24 hours old.
To override the recheck behavior and force an update check, set the GLAB_CHECK_UPDATE environment variable to 'true'.
`),
Aliases: commandAliases,
RunE: func(cmd *cobra.Command, args []string) error {
return CheckUpdate(f, version, false, "")
......
......@@ -13,6 +13,12 @@ Please do not edit this file directly. Run `make gen-docs` instead.
Check for latest glab releases.
## Synopsis
Checks for new versions every 24 hours after any 'glab' command is run. Does not recheck if the most recent recheck is less than 24 hours old.
To override the recheck behavior and force an update check, set the GLAB_CHECK_UPDATE environment variable to 'true'.
```plaintext
glab check-update [flags]
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment