diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 6268f2492ba..16a227a237d 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -8,6 +8,7 @@ * Added `--limit` flag to all paginated list commands for client-side result capping ([#4984](https://github.com/databricks/cli/pull/4984)). * Accept `yes` in addition to `y` for confirmation prompts, and show `[y/N]` to indicate that no is the default. +* Deprecated `auth env`. The command is hidden from help listings and prints a deprecation warning to stderr; it will be removed in a future release. ### Bundles * Remove `experimental-jobs-as-code` template, superseded by `pydabs` ([#4999](https://github.com/databricks/cli/pull/4999)). diff --git a/cmd/auth/env.go b/cmd/auth/env.go index 11149af8c04..9861d491e42 100644 --- a/cmd/auth/env.go +++ b/cmd/auth/env.go @@ -93,8 +93,12 @@ func loadFromDatabricksCfg(ctx context.Context, cfg *config.Config) error { func newEnvCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "env", - Short: "Get env", + Use: "env", + Short: "Get env (deprecated)", + Hidden: true, + Long: `Get env. + +Deprecated: this command will be removed in a future release.`, } var host string @@ -103,6 +107,8 @@ func newEnvCommand() *cobra.Command { cmd.Flags().StringVar(&profile, "profile", profile, "Profile to get auth env for") cmd.RunE = func(cmd *cobra.Command, args []string) error { + fmt.Fprintln(cmd.ErrOrStderr(), "Warning: 'databricks auth env' is deprecated and will be removed in a future release.") + cfg := &config.Config{ Host: host, Profile: profile,