In my recent LLM workshop, folks had a hard time following by instructions to add environment variables to .Renviron. This is possible due to my poor instructions, but I think it would be useful to have a helper that could add a new value. The signature would look something like like use_env_var("API_KEY") and the value would be captured using {askpass} or similar.
This would mainly be aimed at people who don't have a lot in the env var (e.g. in my workshop I didn't see anyone with an existing .Renviron) so would need relatively little intelligence. I I think it would be reasonable to start by just appending a newNAME=value line at the bottom of the file.
In my recent LLM workshop, folks had a hard time following by instructions to add environment variables to
.Renviron. This is possible due to my poor instructions, but I think it would be useful to have a helper that could add a new value. The signature would look something like likeuse_env_var("API_KEY")and the value would be captured using {askpass} or similar.This would mainly be aimed at people who don't have a lot in the env var (e.g. in my workshop I didn't see anyone with an existing
.Renviron) so would need relatively little intelligence. I I think it would be reasonable to start by just appending a newNAME=valueline at the bottom of the file.