-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function like env:export to make .env files from site config #3262
Comments
Hi @N0K0! I agree there are times when this can be useful. Do you ever use |
Hi! Personally i've been using an alternative to the netlify dev command, since from what i can see running Been using the following instead: "scripts": {
"build": "nuxt build",
"generate": "nuxt generate",
"nuxt": "nuxt",
"serve_func": "netlify functions:serve",
"full": "concurrently --kill-others \"npm run nuxt\" \"npm run serve_func\""
}, The |
@erezrokah > netlify env:list
site: my-first-site
.--------------.
| Environment variables |
|--------------|
| Key | Value |
|------|-------|
| TEST | mucho |
| KEY | 1234 |
'--------------' Obviously, putting these in an But, since the code for Instead, we could provide a flag like > netlify env:list --plain
TEST=mucho
KEY=1234 Further on this: with path > netlify env:list --plain .env with redirection > netlify env:list --plain > .env I feel like we should go with the 2nd option (with redirection) since I wouldn't normally expect a What are your thoughts on this? |
Just as good if not an better alternative in my eyes! If its easy to add the flag i might be able to do it 😅 |
👍 to this |
@tinfoil-knight, looks like this is a good opportunity to get @N0K0 involved. @N0K0 would you like to take this on with @tinfoil-knight guiding you? |
@erezrokah Should I take this one up since @N0K0 is a bit unfamiliar with the codebase or try to guide around @N0K0? |
#3262 (comment) is a response to ⬆️ |
@N0K0 if you decide to take this up, go through CONTRIBUTING.md once. The specific code for the Note: The below code is not related to the To figure out how flags are working: see src/commands/dev/index.js (suggesting this file since it has a variety of flags) Specifying a flag: Line 299 in d19213f
Using that flag: Line 196 in d19213f
|
Just noticed that the --json flag is not exposed in the relevant help output, not directly related, but a hint would be nice 👍
|
Yup. I saw that too while going through the codebase. We could document the |
Looking at #371 for hints :) |
@verythorough Do you think this issue is still relevant? If yes, I'll add the feature otherwise we can just close this issue. |
@tinfoil-knight yes, I think this would still be useful! Your proposal for the Side note: for folks who may be looking to use |
Is your feature request related to a problem? Please describe.
When moving from one dev machine to an other i want to be able to quickly setup my .env file with secrets.
Describe the solution you'd like
I'm already using the env:import command to move all the .env content into netlify, that same system could be reversed to setup the new dev environment
Describe alternatives you've considered
At this time i can use env:list and write the file manually, but having an env:export which automatically formats the output would be nice
Additional context
Add any other context or screenshots about the feature request here.
Can you submit a pull request?
No. I don't really trust my own skills, but will look into it based on the env:list when i get some time.
The text was updated successfully, but these errors were encountered: