Ask coding questions

← Back to all posts
How do you swap environments?
h
DavidBetz (0)

The sole reason I use Replit was to run scenarios. I would paste in new .env content to see how my code would run with that environment. The .env concept was genius in its simplicity.

How do you swap environments in the new secrets tab? Environment variables are only really /environment/ variables in aggregate (that is, they relate to a particular environment). Looking at these one at a time leads to inconsistencies between variables. Consider how a key relating to your a particular monitoring solution must always be associated with a particular database connection string.

I can't for the life of me figure out how to rapidly wholesale change multiple envvars in the new documentation.

Answered by masfrost (124) [earned 5 cycles]
View Answer
Comments
hotnewtop
masfrost (124)

We're working on it.

Do you prefer the old .env format, or would json format work/make sense to you?

Cc @Bookie0

DavidBetz (0)

@masfrost That's an excellent question. It just needs to be replaceable with my local files. JSON would be perfect. YAML would be even better (since it can have comments).

Bookie0 (6247)

Oo hey there @masfrost

I think many people enjoyed the old .env format, where you make a file, name it .env, and type yourself TOKEN=token_here. Made it a lot easier to see all the data you're storing, as well as copy/pasting things. Could also make people less confused (I've seen so many ask post asking where it went haha!

But thanks for asking, glad replit is working on it! :D

Bookie0 (6247)

Yeah..it's really annoying, with the GUI you can't just for example cmd-f/ctrl-f something and replace it. You have to manually click on each secret to show it; you can't see all of them at the same time. And I don't think you can swap environments, there's no button or anything.

I'd suggest giving this as feedback over here :)

Good luck! :D

codingjlu (166)

IT'S ALL REPLIT'S FAULT PLEASE CHANGE IT BACK OR AT LEAST MAKE AN OPTION TO CHANGE BACK TO AN ACTUAL ENV FILE.