Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

add silent flag

Maidul Islam18d7a14e3ff8
diff --git a/cli/packages/cmd/root.go b/cli/packages/cmd/root.go
index 9c7814eccd..06846260f0 100644
--- a/cli/packages/cmd/root.go
+++ b/cli/packages/cmd/root.go
@@ -40,8 +40,14 @@ func init() {
rootCmd.PersistentFlags().StringP("log-level", "l", "info", "log level (trace, debug, info, warn, error, fatal)")
rootCmd.PersistentFlags().Bool("telemetry", true, "Infisical collects non-sensitive telemetry data to enhance features and improve user experience. Participation is voluntary")
rootCmd.PersistentFlags().StringVar(&config.INFISICAL_URL, "domain", util.INFISICAL_DEFAULT_API_URL, "Point the CLI to your own backend [can also set via environment variable name: INFISICAL_API_URL]")
+ rootCmd.PersistentFlags().Bool("silent", false, "Disable output of tip/info messages. Useful when running in scripts or CI/CD pipelines.")
rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
- if !util.IsRunningInDocker() {
+ silent, err := cmd.Flags().GetBool("silent")
+ if err != nil {
+ util.HandleError(err)
+ }
+
+ if !util.IsRunningInDocker() && !silent {
util.CheckForUpdate()
}
}