infisical icon indicating copy to clipboard operation
infisical copied to clipboard

Infisical CLI: allow set/create secret with empty value

Open mrhackcz opened this issue 8 months ago • 3 comments

Describe the bug

I want to import my existing .env files to infisical. There is no problem with importing via web UI, but it's too much work. I want it to import via CLI, but there is a problem with empty values.

To Reproduce

infisical secrets set --env staging --file .env
Secret key 'TEST_ENV' has an empty value

infisical secrets set --env staging TEST_ENV=""
ensure that each secret has a none empty key and value. Modify the input and try again

Expected behavior

Create secret with empty value, like on import from web UI.

Platform you are having the issue on:

Ubuntu 24 infisical-cli version 0.39.1

mrhackcz avatar Apr 10 '25 15:04 mrhackcz

Hey @mrhackcz, thanks so much for sharing your feedback! I’ll bring this to the team for discussion and we’ll get back to you as soon as we have an update.

carlosmonastyrski avatar Apr 10 '25 15:04 carlosmonastyrski

@carlosmonastyrski Any updates on this?

saumitra-dev avatar Jun 25 '25 20:06 saumitra-dev

@mrhackcz I had the same issue and found a workaround: create the secret with a space. The Infisical UI then lists that secret as having an "Empty value", which is exactly what I needed.

infisical secrets set --env staging TEST_ENV=" "

AlexRingelmann avatar Oct 04 '25 09:10 AlexRingelmann