Crates.io | eas-env |
lib.rs | eas-env |
version | 0.2.2 |
source | src |
created_at | 2024-03-23 12:39:02.645732 |
updated_at | 2024-04-19 16:42:42.363119 |
description | A simple CLI tool to manage environment variables for Expo projects. |
homepage | |
repository | https://github.com/corasan/eas-env |
max_upload_size | |
id | 1183518 |
size | 21,516 |
You will need to install rust and cargo to run this cli. You can do so by following the instructions here.
cargo install eas-env
curl -sSL https://raw.githubusercontent.com/corasan/eas-env/main/install.sh | bash
Download the latest release from the releases page and add it to your path.
By default, the program will use the default
profile in your eas.json
. You can specify a different environment by passing the profile as an argument. Note that this needs to be run in the root of your project and you will need to add your environment variables to the EAS profile.
eas-env
# creates .env.local file using default profile
eas-env -p production
# creates .env.local file using production profile
You can also specify the path to the app's directory where the eas.json
file is located, useful if the project is in a monorepo. The default path is the current directory where the command is run.
eas-env --app-dir apps/mobile
# creates .env.local file using default profile inside apps/mobile directory
To make things easier you can add it to your package.json
:
{
"scripts": {
"env:dev": "eas-env -p development",
"env:prod": "eas-env -p production",
"env:preview": "eas-env -p preview",
}
}
Then you can run npm run env
to create the .env.local
file with the default profile.