Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Add a option to 'infisical run' for using secrets from a temporary file #3101

Open
jaeyoi opened this issue Feb 11, 2025 · 0 comments

Comments

@jaeyoi
Copy link

jaeyoi commented Feb 11, 2025

Feature description

Add a --use-temp-file option to the Infisical CLI to allow storing secrets retrieved from the Infisical server in a temporary file, and using the file path in subsequent commands. This temporary file will be automatically deleted after the command execution is finished.

Why would it be useful?

Currently, the Infisical CLI can only inject secrets as environment variables. However, there are cases where secrets need to be used in file form. For example, some programs read secrets from files instead of environment variables, or you may need to manage multiple secrets in a file at once.

The --use-temp-file option allows you to meet these requirements. Infisical users can easily manage secrets in file form and use them in subsequent commands. This will increase the usability of Infisical and improve user convenience.

Additional context

  • The --use-temp-file option creates a temporary file and stores the secrets in it.
  • In subsequent commands, you can access the temporary file path through placeholders such as {}.
  • The temporary file is automatically deleted when the command operation is completed.
  • It provides a similar function to the exec-file option of SOPS.

Here is an example of use:

infisical run --env=dev --use-temp-file --command="echo temp file path: {}; flutter run --dart-define-from-file={}"

The above command retrieves secrets from the dev environment on the Infisical server, stores them in a temporary file, and passes the file path to the echo and flutter run commands. The flutter run command reads the secrets from the temporary file and runs the application.

Adding this feature will make the Infisical CLI a more powerful and flexible tool.

@jaeyoi jaeyoi changed the title Add a option to 'infisical run' for using secrets from a temporary file [feature request] Add a option to 'infisical run' for using secrets from a temporary file Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant