You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotenv-tool/README.md

62 lines
1.4 KiB
Markdown

The command line tool to read, manipulate and update .env files.
## Setup
```bash
npm install -g dotenv-tool --registry https://npm.dzienia.pl
```
## Command Line
If input or output file(s) are not specified, `dotenv-tool` will use `stdin` or `stdout`
```bash
$ echo -n "VAR1=value1\nVAR2=value2" | dotenv-tool read VAR1 > result.txt
$ cat result.txt
value1
```
### Modify files
```bash
$ dotenv-tool -h
```
```
Usage: dotenv-tool [options] [command] [paramsToSet]
Tool to read and update .env files
Arguments:
paramsToSet space separated list of additional envs to set, in format key=value (default: "")
Options:
-v, --version output the version number
-i, --files <filePaths...> Input file(s)
-o, --outputFile <filePath> Output file
-m, --modify Modify first input file
-s, --silent Mute all messages and errors
-h, --help display help for command
Commands:
get [options] <key> Returns given variable from env file (if specified)
```
### Read prop from file
```bash
$ dotenv-tool get -h
```
```
Usage: dotenv-tool get [options] <key>
Returns given variable from env file (if specified)
Arguments:
key env variable name a.k.a. key
Options:
-f, --file <filePath> Input file to parse (if not given, stdio is used)
-h, --help display help for command
```