Skip to content

Instantly share code, notes, and snippets.

@Markeljan
Created February 9, 2026 23:58
Show Gist options
  • Select an option

  • Save Markeljan/2627a300c71265d2bb0c1f5e4256ba07 to your computer and use it in GitHub Desktop.

Select an option

Save Markeljan/2627a300c71265d2bb0c1f5e4256ba07 to your computer and use it in GitHub Desktop.
Remove all env variables stored on vercel linked project
#!/usr/bin/env bash
# Remove all Vercel environment variables for the linked project.
# Only parses lines where value is "Encrypted" so we don't try to delete
# header/footer tokens (e.g. "Common", "next") from vercel env ls output.
set -e
env_vars=$(vercel env ls)
# Only treat lines as env vars when the second column is "Encrypted"
env_var_names=$(echo "$env_vars" | awk '$2 == "Encrypted" { print $1 }')
for name in $env_var_names; do
echo "Removing: $name"
vercel env rm "$name" -y
done
echo "Done."
# or run the logic inline
# vercel env ls | awk '$2 == "Encrypted" { print $1 }' | while read -r name; do echo "Removing: $name"; vercel env rm "$name" -y; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment