From 1b9a28ffee27a434892703ef9518392c5d024696 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Jun 2026 23:39:11 +0000 Subject: [PATCH] Use K3K_ env prefix for k3kcli viper binding --- cli/cmds/root.go | 6 +++--- cli/cmds/root_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/cmds/root.go b/cli/cmds/root.go index 97eb0921..3a37a24e 100644 --- a/cli/cmds/root.go +++ b/cli/cmds/root.go @@ -92,10 +92,10 @@ func CobraFlagNamespace(appCtx *AppContext, flag *pflag.FlagSet) { } func InitializeConfig(cmd *cobra.Command) { - // Use a "K3KCLI" prefix so that only namespaced environment variables (e.g. - // K3KCLI_VERSION) bind to flags. Without a prefix, common environment variables + // Use a "K3K" prefix so that only namespaced environment variables (e.g. + // K3K_VERSION) bind to flags. Without a prefix, common environment variables // such as VERSION, MODE or TOKEN would silently override the matching CLI flags. - viper.SetEnvPrefix("K3KCLI") + viper.SetEnvPrefix("K3K") viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) viper.AutomaticEnv() diff --git a/cli/cmds/root_test.go b/cli/cmds/root_test.go index b4d8ee43..eecc48f0 100644 --- a/cli/cmds/root_test.go +++ b/cli/cmds/root_test.go @@ -21,7 +21,7 @@ func Test_InitializeConfig_envPrefix(t *testing.T) { }, { name: "prefixed env binds to flag", - envName: "K3KCLI_VERSION", + envName: "K3K_VERSION", want: "1h", }, }