diff --git a/cli/packages/cmd/secrets.go b/cli/packages/cmd/secrets.go index a3e74d04a..03d7d086e 100644 --- a/cli/packages/cmd/secrets.go +++ b/cli/packages/cmd/secrets.go @@ -406,7 +406,7 @@ func getSecretsByNames(cmd *cobra.Command, args []string) { util.HandleError(err, "Unable to parse path flag") } - showOnlyValue, err := cmd.Flags().GetBool("value") + showOnlyValue, err := cmd.Flags().GetBool("raw-value") if err != nil { util.HandleError(err, "Unable to parse path flag") } @@ -433,7 +433,7 @@ func getSecretsByNames(cmd *cobra.Command, args []string) { } if showOnlyValue && len(requestedSecrets) > 1 { - util.PrintErrorMessageAndExit("--value only works with one secret.") + util.PrintErrorMessageAndExit("--raw-value only works with one secret.") } if showOnlyValue { @@ -674,7 +674,7 @@ func init() { secretsGetCmd.Flags().String("token", "", "Fetch secrets using the Infisical Token") secretsCmd.AddCommand(secretsGetCmd) secretsGetCmd.Flags().String("path", "/", "get secrets within a folder path") - secretsGetCmd.Flags().Bool("value", false, "Returns only the value of secret, only works with one secret") + secretsGetCmd.Flags().Bool("raw-value", false, "Returns only the value of secret, only works with one secret") secretsCmd.Flags().Bool("secret-overriding", true, "Prioritizes personal secrets, if any, with the same name over shared secrets") secretsCmd.AddCommand(secretsSetCmd) diff --git a/docs/cli/commands/secrets.mdx b/docs/cli/commands/secrets.mdx index fe604ae97..3e0fa4dd3 100644 --- a/docs/cli/commands/secrets.mdx +++ b/docs/cli/commands/secrets.mdx @@ -12,13 +12,12 @@ infisical secrets This command enables you to perform CRUD (create, read, update, delete) operations on secrets within your Infisical project. With it, you can view, create, update, and delete secrets in your environment. ### Sub-commands - Use this command to print out all of the secrets in your project -```bash -$ infisical secrets -``` + ```bash + $ infisical secrets + ``` ### Environment variables @@ -91,17 +90,16 @@ $ infisical secrets get DOMAIN - - Used to get just the value of that secret. But this only works with one secret. + + Used to print the plain value of a single requested secret without any table style. Default value: `false` Example: `infisical secrets get DOMAIN --value` - ```sh - # Suggested: When running in CI/CD Environments, or in a script, set INFISICAL_DISABLE_UPDATE_CHECK env to true, to hide cli update messages. - INFISICAL_DISABLE_UPDATE_CHECK=true infisical secrets get DOMAIN --value - ``` + + When running in CI/CD environments or in a script, set `INFISICAL_DISABLE_UPDATE_CHECK` env to `true`. This will help hide any CLI update messages and only show the secret value. +