Put the database's variables in .env
database_env_to_fileWrites DATABASE_URL and PG* database variables into a project's .env file, keeps the password out of chat, replaces existing values, preserves other entries, and adds the file to .gitignore.
Instructions
Write DATABASE_URL and the PG* variables for this application's database into a .env file in the project directory, and return only the names of what was written. The password goes into the file and never into this conversation, so do not read the file back out to the user. These are the same variables the deployed app receives. Variables already in the file are replaced, everything else is kept, and the file is added to .gitignore. Needs the account token that login (or https://antideploy.com/agent.md) saves on this machine: a project key cannot read a connection string. Once the app is live its database holds real data: do not reset, truncate or drop it from here without asking.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | A .env file inside the project directory. Default .env; .env.local suits Next.js. | |
| directory | No | The project folder. Defaults to this server's working directory. |