Skip to content

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

Update API_URL to INFISICAL_API_URL

Maidul Islam840efbdc2f1e
diff --git a/cli/packages/cmd/root.go b/cli/packages/cmd/root.go
index cac719c71a..196c20d7d7 100644
--- a/cli/packages/cmd/root.go
+++ b/cli/packages/cmd/root.go
@@ -32,14 +32,14 @@ func Execute() {
func init() {
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
rootCmd.PersistentFlags().BoolVarP(&debugLogging, "debug", "d", false, "Enable verbose logging")
- 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: API_URL]")
+ 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.PersistentPreRun = func(cmd *cobra.Command, args []string) {
// }
// if config.INFISICAL_URL is set to the default value, check if INFISICAL_URL is set in the environment
// this is used to allow overrides of the default value
if !rootCmd.Flag("domain").Changed {
- if envInfisicalBackendUrl, ok := os.LookupEnv("API_URL"); ok {
+ if envInfisicalBackendUrl, ok := os.LookupEnv("INFISICAL_API_URL"); ok {
config.INFISICAL_URL = envInfisicalBackendUrl
}
}
diff --git a/docs/cli/overview.mdx b/docs/cli/overview.mdx
index 390e99982c..560dce0836 100644
--- a/docs/cli/overview.mdx
+++ b/docs/cli/overview.mdx
@@ -109,11 +109,11 @@ infisical login
The CLI is set to connect to Infisical Cloud by default, but if you're running your own instance of Infisical, you can direct the CLI to it using one of the methods provided below.
#### Export environment variable
-You can point the CLI to the self hosted Infisical instance by exporting the environment variable `API_URL` in your terminal.
+You can point the CLI to the self hosted Infisical instance by exporting the environment variable `INFISICAL_API_URL` in your terminal.
```bash
# Example
-export API_URL="https://your-self-hosted-infisical.com/api"
+export INFISICAL_API_URL="https://your-self-hosted-infisical.com/api"
```
#### Set manually on every command