Repository: helm/helm
File: pkg/cli/environment.go (Go)

Code before:
	return float32(ret)
}

func envCSV(name string) (ls []string) {
	trimmed := strings.Trim(os.Getenv(name), ", ")
	if trimmed != "" {
		ls = strings.Split(trimmed, ",")
	}
	return
}

func envColorMode() string {
	// Check NO_COLOR environment variable first (standard)
	if v, ok := os.LookupEnv("NO_COLOR"); ok && v != "" {
		return "never"
	}
	// Check HELM_COLOR environment variable
	if v, ok := os.LookupEnv("HELM_COLOR"); ok {
		v = strings.ToLower(v)
		switch v {
		case "never", "auto", "always":
			return v
		}
	}
	// Default to never (disabled) until more commands support color
	return "never"
}

func (s *EnvSettings) EnvVars() map[string]string {
	envvars := map[string]string{
		"HELM_BIN":               os.Args[0],
		"HELM_CACHE_HOME":        helmpath.CachePath(""),
		"HELM_CONFIG_HOME":       helmpath.ConfigPath(""),
		"HELM_DATA_HOME":         helmpath.DataPath(""),
		"HELM_DEBUG":             fmt.Sprint(s.Debug),
		"HELM_PLUGINS":           s.PluginsDirectory,
		"HELM_REGISTRY_CONFIG":   s.RegistryConfig,
		"HELM_REPOSITORY_CACHE":  s.RepositoryCache,
		"HELM_REPOSITORY_CONFIG": s.RepositoryConfig,
		"HELM_NAMESPACE":         s.Namespace(),
		"HELM_MAX_HISTORY":       strconv.Itoa(s.MaxHistory),
		"HELM_BURST_LIMIT":       strconv.Itoa(s.BurstLimit),
		"HELM_QPS":               strconv.FormatFloat(float64(s.QPS), 'f', 2, 32),

		// broken, these are populated from helm flags and not kubeconfig.
		"HELM_KUBECONTEXT":                  s.KubeContext,
		"HELM_KUBETOKEN":                    s.KubeToken,
		"HELM_KUBEASUSER":                   s.KubeAsUser,
		"HELM_KUBEASGROUPS":                 strings.Join(s.KubeAsGroups, ","),
		"HELM_KUBEAPISERVER":                s.KubeAPIServer,
		"HELM_KUBECAFILE":                   s.KubeCaFile,

Review comment (suggestion):
I differ in opinion from @gjenkins8. I don't see any harm in using auto by default, especially as an initial v4 release of this feature. If we default to `never` prior to locking v4, we'll be stuck with that default until v5. Let's do it now and ensure that users don't shoot themselves in the foot by coding around a default we'd like to later change.

Code after:
	return float32(ret)
}

func envCSV(name string) (ls []string) {
	trimmed := strings.Trim(os.Getenv(name), ", ")
	if trimmed != "" {
		ls = strings.Split(trimmed, ",")
	}
	return
}

func envColorMode() string {
	// Check NO_COLOR environment variable first (standard)
	if v, ok := os.LookupEnv("NO_COLOR"); ok && v != "" {
		return "never"
	}
	// Check HELM_COLOR environment variable
	if v, ok := os.LookupEnv("HELM_COLOR"); ok {
		v = strings.ToLower(v)
		switch v {
		case "never", "auto", "always":
			return v
		}
	}
	// Default to auto
	return "auto"
}

func (s *EnvSettings) EnvVars() map[string]string {
	envvars := map[string]string{
		"HELM_BIN":               os.Args[0],
		"HELM_CACHE_HOME":        helmpath.CachePath(""),
		"HELM_CONFIG_HOME":       helmpath.ConfigPath(""),
		"HELM_DATA_HOME":         helmpath.DataPath(""),
		"HELM_DEBUG":             fmt.Sprint(s.Debug),
		"HELM_PLUGINS":           s.PluginsDirectory,
		"HELM_REGISTRY_CONFIG":   s.RegistryConfig,
		"HELM_REPOSITORY_CACHE":  s.RepositoryCache,
		"HELM_REPOSITORY_CONFIG": s.RepositoryConfig,
		"HELM_NAMESPACE":         s.Namespace(),
		"HELM_MAX_HISTORY":       strconv.Itoa(s.MaxHistory),
		"HELM_BURST_LIMIT":       strconv.Itoa(s.BurstLimit),
		"HELM_QPS":               strconv.FormatFloat(float64(s.QPS), 'f', 2, 32),

		// broken, these are populated from helm flags and not kubeconfig.
		"HELM_KUBECONTEXT":                  s.KubeContext,
		"HELM_KUBETOKEN":                    s.KubeToken,
		"HELM_KUBEASUSER":                   s.KubeAsUser,
		"HELM_KUBEASGROUPS":                 strings.Join(s.KubeAsGroups, ","),
		"HELM_KUBEAPISERVER":                s.KubeAPIServer,
		"HELM_KUBECAFILE":                   s.KubeCaFile,