
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Manage your .env variable using ligthweight cli. You can add, update, remove or list your environment variables.
envar-cli is lightweight global package for managing .env variables using cli. You can add, update, remove or list environment variables.
# with npm
npm install -g envar-cli
Open your terminal on project folder and check the below instructions. To get help please write envar-cli --help on terminal.
There are several .env file extension. Default file is .env for envar-cli.
envar-cli supports:
Please specify the extension end of the command with --[fileSpecifier]
envar-cli [command] [value] [extension]
# Select .env (do not write anything)
#.env is default. No need to write anything.
# .env.example
envar-cli [command] [value] --example
# .env.local
envar-cli [command] [value] --local
# .env.dev
envar-cli [command] [value] --dev
# .env.development
envar-cli [command] [value] --development
# .env.prod
envar-cli [command] [value] --prod
# .env.production
envar-cli [command] [value] --production
# .env.staging
envar-cli [command] [value] --staging
# .env.preview
envar-cli [command] [value] --preview
If .env file is not exists envar-cli will create a blank .env file.
envar-cli add "PORT=9000"
# or
envar-cli add PORT=9000
#with specific .env file --[extension]
envar-cli add PORT=3000 --dev
envar-cli add PORT=8080 --prod
.env:
PORT=9000
.env.dev:
PORT=3000
.env.prod:
PORT=8080
If you want to add a comment to your .env file, please use --comment option. It will be add your comment line before the variable. Currently, it works only if variable is newly added.
envar-cli add "SECRET_KEY=github" --comment "# SECRET KEYS"
#or
#with specific .env file --[extension]
envar-cli add "SECRET_KEY=google" --comment "# SECRET KEYS" --prod
.env:
# SECRET KEYS
SECRET_KEY=github
.env.prod:
# SECRET KEYS
SECRET_KEY=google
To update a variable you can use update command.
envar-cli update SECRET_KEY=github
#or
envar-cli update "SECRET_KEY=github"
#with specific .env file --[extension]
envar-cli update SECRET_KEY=github --prod
If variable not exists you will see a message like this: ❗: <MY_VAR> not found in .env
Deleting is also simple. Just use remove, del or delete command. And please:
envar-cli remove SECRET_KEY
#or
envar-cli del "SECRET_KEY"
#with specific .env file --[extension]
envar-cli delete SECRET_KEY --staging
To count and see your environment values please use list command.
envar-cli list
#with specific .env file --[extension]
envar-cli list --development
1. PORT=8080
2. SECRET_KEY=github
📄 : 2 variables found in .env
FAQs
Manage your .env variable using ligthweight cli. You can add, update, remove or list your environment variables.
The npm package envar-cli receives a total of 0 weekly downloads. As such, envar-cli popularity was classified as not popular.
We found that envar-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.