fungs
October 2, 2026, 11:58am
1
When deploying secrets from a third-party secret store to fly.io using fly secrets import, old or renamed secrets remain. Is there any recommended and simple way to clear all secrets before deploying new ones?
A simple fly secrets import --clear-all would be useful.
Related topic: Feature request: update secrets for next deployment
fungs
October 6, 2026, 8:30am
3
Hi,
for sn in $(fly secrets list --json | jq -r ".[]|.name"); do echo fly secrets unset --stage $sn; done
Let me know if that’s simple enough. Remove the echo to actually do it, this would just print a list of commands to run to unset the secrets.
There’s no built-in platform functionality to do that in one go, though.
fungs
October 8, 2026, 11:12pm
5
Thanks! That’s the naive solution (and it makes it explicit that the API does not support it).
I’d say you can even do it in just two calls:
fly secrets list --json | jq -r ".[]|.name" | xargs echo fly secrets unset --stage (remove the echo).
fungs
October 13, 2026, 12:03pm
6
While it seemed to work before, now it appears that the JSON output has camel style, so it should be .Name:
fly secrets list --json | jq -r ".[]|.Name" | xargs echo fly secrets unset --stage.