clever-tools icon indicating copy to clipboard operation
clever-tools copied to clipboard

.env import at app creation

Open davlgd opened this issue 1 year ago • 3 comments

When a user creates an app, there is no way to import environment variables automatically. Such a feature would enable easier creation from existing code (open source projects, tutorials, etc.).

As the .env file is a common standard, used in many project, we could:

  • detect its presence during clever create
  • ask the user if he wants to import its content
  • do it if asked

davlgd avatar Jan 01 '24 11:01 davlgd

we need to talk about the "ask" part because not all CLI usage are in an interractive shell

miton18 avatar Jan 02 '24 16:01 miton18

I agree on this. I didn't include anything to bypass "ask" part for this feature because it will depend if it's accepted or not, and if #634 is accepted or not. If it's both, we could move to a global -y/ --yes strategy (for example) to bypass questions in the create command.

davlgd avatar Jan 02 '24 21:01 davlgd

This will be awesome.

But -y or --yes will break all existing script or add unexpected behavior.

Maybe a --with-env=<path-to-env-file> will do the same without breaking change in the CLI.

In my opinion allowing the user to choose the file he wants when the app is created is more flexible.

And if --with-env used as a flag CLI argument, then <path-to-env-file> can be set to ./.env by default

chmuche avatar May 03 '24 09:05 chmuche