Project config file & customization options
.infisical.json
file in the root directory of your project.
The .infisical.json
file specifies various parameters, such as the Infisical project to retrieve secrets from, along with other configuration options. Furthermore, you can define additional properties in the file to further tailor your local development experience.
--env
flag in your command.
However, this can be inconvenient if you typically work in just one environment.
To simplify the process, you can establish a default environment, which will be used for every command unless you specify otherwise.
defaultEnvironment
and gitBranchToEnvironmentMapping
are configured, gitBranchToEnvironmentMapping
will take precedence over defaultEnvironment
.
However, if gitBranchToEnvironmentMapping
is not set and defaultEnvironment
is, then the defaultEnvironment
will be used to execute your Infisical CLI commands.
If you wish to override the defaultEnvironment
, you can do so by using the --env
flag explicitly.
--env
flag. However, in certain cases, you may prefer the environment to be automatically mapped based on the current GitHub branch you are working on.
To achieve this, simply add the gitBranchToEnvironmentMapping
property to your configuration file, as shown below.
--env
flag while interacting with the CLI.