Setting Env
Generates an env file with simple commands.
🛠 Installation
To set up env file in your project, follow these steps:
npm install @in-ch/setup -g
or
npm install @in-ch/setup --save-dev
🚀 Usage
Running the ev command
ics env
What happens when you run the command:
-
The CLI checks if a
.env
file already exists in your project root:- If it exists, you'll get a message:
"At least one env file exists."
- If it exists, you'll get a message:
-
If no
.env
file exists, the CLI will:-
Create a new
.env
file in the root directory. -
Prompt you to add key-value pairs. Example:
Enter the key: API_KEY
Enter the value: 123456Resulting
.env
file content:API_KEY=123456
-
-
After each key-value pair, the CLI asks if you'd like to add more. You can continue adding or finish the process.
-
If any errors occur during the process, a message will appear:
"🥲 Failed to create env file."
❗ Important Notes
env setup must be executed from the project root.