Skip to content

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

5.3 KB
Raw Blame
---
title: "Infisical CLI FAQ"
sidebarTitle: "FAQ"
description: "Frequently Asked Questions about the Infisical CLI."
---

Frequently asked questions about the CLI can be found on this page. 
If you can't find the answer you're looking for, please create an issue on the [CLI's GitHub repository](https://github.com/Infisical/cli/issues) or ask in the [Infisical community](https://community.infisical.com/) for additional support.

<AccordionGroup>

<Accordion title="I'm getting a Keyring-related error message when trying to login">
By default, the CLI will choose the most suitable store available on your system. 
If you experience issues with the default store, you can switch to a different one. 
If none of the available stores work for you, you can try using the `file` store type by running `infisical vault set file`, which should work in most cases. 
If you're still experiencing trouble, please seek support. 

[Learn more about the vault command](/cli/reference#vault)

</Accordion>

<Accordion title="How do I keep secret values out of my shell history?">
Your shell saves the commands you run to a history file, so a secret value you pass to `infisical sm secrets set` stays in that file. To avoid this, pass the values with `--file` or `name=@path`, or configure your shell to skip those commands.

<Tabs>
  <Tab title="Bash">
    Add the pattern to `HISTIGNORE` in `~/.bashrc`:

    ```bash
    echo 'export HISTIGNORE="*infisical*secrets set*:$HISTIGNORE"' >> ~/.bashrc && source ~/.bashrc
    ```
  </Tab>
  <Tab title="Zsh">
    Add the pattern to `HISTORY_IGNORE` in `~/.zshrc`:

    ```bash
    echo "HISTORY_IGNORE='(*infisical*secrets set*)'" >> ~/.zshrc && source ~/.zshrc
    ```

    Zsh applies `HISTORY_IGNORE` when it writes the history file, so the command still appears when you press the up arrow in the current session.
  </Tab>
  <Tab title="Windows">
    If you use WSL, follow the Bash or Zsh steps.

    In PowerShell, the PSReadLine module saves your command history. To check its version, run `(Get-Module PSReadLine).Version`.

    PSReadLine 2.2 and later, which ships with PowerShell 7.2 and later, doesn't save commands that contain words such as `secret`, `token`, or `password`, so `infisical sm secrets set` is already skipped.

    Older versions, including the one that ships with Windows PowerShell 5.1, save every command. Add this line to your [PowerShell profile](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles) to skip `infisical sm secrets set`:

    ```powershell
    Set-PSReadLineOption -AddToHistoryHandler { param($line) $line -notlike '*infisical*secrets set*' }
    ```

    Don't add this line on PSReadLine 2.2 or later, because a custom handler replaces the built-in one that skips commands with sensitive words.

    Command Prompt keeps history only until you close the window.
  </Tab>
</Tabs>

</Accordion>

<Accordion title="Can I fetch secrets with Infisical while I'm offline?">
Yes. If you have previously retrieved secrets for a specific project and environment (such as dev, staging, or prod), the  `run`/`secret` command will utilize the saved secrets, even when offline, on subsequent fetch attempts.

Running `infisical login` or `infisical logout` deletes the saved secrets, so they're only available offline again after your next fetch.

</Accordion>

<Accordion title="Can I upload the `.infisical.yaml` file that was generated?">
Yes. This is simply a configuration file and contains no sensitive data.
</Accordion>

<Accordion title="Where can I find my Project ID?">

  Run [infisical sm projects list](/cli/reference#sm-projects-list) to print the name, slug, and ID of each of your projects.

  You can also find the ID in Infisical.

  Visit the Infisical website and navigate to a project of your choice. Once on the project page, access the **Project Settings** from the sidebar. Within the Project name section, select the "Copy Project ID" button for copying the current Project ID to clipboard, or simply obtain it from the URL of the current page.
  
  ```
    https://app.infisical.com/project/<your_project_id>/settings
  ```
</Accordion>

<Accordion title="How do I use custom headers with the Infisical CLI?">
  
  The Infisical CLI supports custom HTTP headers for requests to servers that require additional authentication. Set these headers using the `INFISICAL_CUSTOM_HEADERS` environment variable:
  
  ```bash
  export INFISICAL_CUSTOM_HEADERS="Access-Client-Id=your-client-id Access-Client-Secret=your-client-secret"
  ```
  
  After setting this environment variable, run your Infisical commands as usual.
</Accordion>

<Accordion title="Why would I need to use custom headers?">
  
  Custom headers are necessary when your Infisical server is protected by services like Cloudflare Access or other reverse proxies that require specific authentication headers. Without this feature, you would need to implement security workarounds that might compromise your security posture.
</Accordion>

<Accordion title="What format should I use for the custom headers?">
  
  Custom headers should be specified in the format `headername1=headervalue1 headername2=headervalue2`, with spaces separating each header-value pair. For example:
  
  ```bash
  export INFISICAL_CUSTOM_HEADERS="Header1=value1 Header2=value2 Header3=value3"
  ```
</Accordion>

</AccordionGroup>