To use the Infisical CLI in your local development environment, simply run the command below and follow the interactive guide.This will create
If you are in a containerized environment such as WSL 2 or Codespaces, run
infisical login -i
to avoid browser based loginInitialize Infisical for your project
.infisical.json
file at the location the command was executed. This file contains your local project settings. It does not contain any sensitive data.Inject environment variables
run
command here
Connect CLI to self hosted Infisical
Optional: point CLI to self-hosted
Optional: point CLI to self-hosted
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.
Method 1: Use the updated CLI
Beginning with CLI version V0.4.0, it is now possible to choose between logging in through the Infisical cloud or your own self-hosted instance. Simply execute theinfisical login
command and follow the on-screen instructions.Method 2: Export environment variable
You can point the CLI to the self hosted Infisical instance by exporting the environment variableINFISICAL_API_URL
in your terminal.Method 3: Set manually on every command
Another option to point the CLI to your self hosted Infisical instance is to set it via a flag on every command you run.History
Your terminal keeps a history with the commands you run. When you create Infisical secrets directly from your terminal, they’ll stay there for a while. For security and privacy concerns, we recommend you to configure your terminal to ignore those specific Infisical commands.Ignore commands
Ignore commands
$HOME/.profile
is pretty common but, you could place it under $HOME/.profile.d/infisical.sh
or any profile file run at login