Load an AI .env line only after your dotenv reader returns a value you wrote
Write one known key with a comma or hash inside quotes. Keep the file only when your loader returns that value.
In short
- Write one key=value you will accept, with a comma or
#inside quotes if that is the real value. - Load with your real dotenv reader — not
line.split('=')plussplit(','). - Keep only when the returned value matches the sheet.
Example: NAME="Gao ST25, 5kg" must round-trip to Gao ST25, 5kg without a fourth “column.”
Write the line you will accept
dotenv formats vary; Docker env-file and Node dotenv both treat quotes specially. Your sheet is the contract for this loader.
| Key | Value |
|---|---|
| NAME | Gao ST25, 5kg |

Naive splits invent keys
split(',') on an unquoted value, or stripping quotes wrong, turns one value into two tokens. Comments after an unquoted # also truncate values in many loaders.

Ask, then load
Return one .env line for NAME whose value is exactly: Gao ST25, 5kg
Quote it so commas stay inside the value.
I will load with my dotenv reader and compare.

Related
Share