@dotenvx/dotenvx 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/README.md +272 -117
- package/package.json +2 -2
- package/src/cli/commands/armor.js +18 -0
- package/src/cli/dotenvx.js +11 -4
- package/src/db/session.js +7 -7
- package/src/lib/services/genexample.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.2.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.2.2...main)
|
|
6
|
+
|
|
7
|
+
## [2.2.2](https://github.com/dotenvx/dotenvx/compare/v2.2.1...v2.2.2) (2026-07-08)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* Move `login` and `logout` under armor ([#874](https://github.com/dotenvx/dotenvx/pull/874))
|
|
12
|
+
|
|
13
|
+
## [2.2.1](https://github.com/dotenvx/dotenvx/compare/v2.2.0...v2.2.1) (2026-07-08)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Move `genexample` to top level commands ([#873](https://github.com/dotenvx/dotenvx/pull/873))
|
|
6
18
|
|
|
7
19
|
## [2.2.0](https://github.com/dotenvx/dotenvx/compare/v2.1.5...v2.2.0) (2026-07-07)
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -1384,6 +1384,15 @@ Set Armor ⛨ token for retrieving armored private keys.
|
|
|
1384
1384
|
$ dotenvx run --token "$DOTENVX_ARMOR_TOKEN" -- yourcommand
|
|
1385
1385
|
```
|
|
1386
1386
|
|
|
1387
|
+
</details>
|
|
1388
|
+
<details><summary>`run --no-keychain`</summary><br>
|
|
1389
|
+
|
|
1390
|
+
Turn off macOS Keychain lookups.
|
|
1391
|
+
|
|
1392
|
+
```sh
|
|
1393
|
+
$ dotenvx run --no-keychain -- yourcommand
|
|
1394
|
+
```
|
|
1395
|
+
|
|
1387
1396
|
</details>
|
|
1388
1397
|
<details><summary>`run --no-armor`</summary><br>
|
|
1389
1398
|
|
|
@@ -1393,8 +1402,6 @@ Turn off [Dotenvx Armor ⛨](https://dotenvx.com/armor) features.
|
|
|
1393
1402
|
$ dotenvx run --no-armor -- yourcommand
|
|
1394
1403
|
```
|
|
1395
1404
|
|
|
1396
|
-
`--no-vlt` and `--no-ops` are deprecated aliases.
|
|
1397
|
-
|
|
1398
1405
|
</details>
|
|
1399
1406
|
<details><summary>`get KEY`</summary><br>
|
|
1400
1407
|
|
|
@@ -1407,6 +1414,15 @@ $ dotenvx get HELLO
|
|
|
1407
1414
|
World
|
|
1408
1415
|
```
|
|
1409
1416
|
|
|
1417
|
+
</details>
|
|
1418
|
+
<details><summary>`get KEY --no-keychain`</summary><br>
|
|
1419
|
+
|
|
1420
|
+
Turn off macOS Keychain lookups for get.
|
|
1421
|
+
|
|
1422
|
+
```sh
|
|
1423
|
+
$ dotenvx get HELLO --no-keychain
|
|
1424
|
+
```
|
|
1425
|
+
|
|
1410
1426
|
</details>
|
|
1411
1427
|
<details><summary>`get KEY -f`</summary><br>
|
|
1412
1428
|
|
|
@@ -1722,6 +1738,15 @@ set HELLO_PLAIN (.env)
|
|
|
1722
1738
|
|
|
1723
1739
|
Keys ending in `_PLAIN` are not encrypted by `dotenvx set` or `dotenvx encrypt`.
|
|
1724
1740
|
|
|
1741
|
+
</details>
|
|
1742
|
+
<details><summary>`set KEY value --no-keychain`</summary><br>
|
|
1743
|
+
|
|
1744
|
+
Turn off macOS Keychain lookups for set.
|
|
1745
|
+
|
|
1746
|
+
```sh
|
|
1747
|
+
$ dotenvx set HELLO Dotenvx --no-keychain
|
|
1748
|
+
```
|
|
1749
|
+
|
|
1725
1750
|
</details>
|
|
1726
1751
|
<details><summary>`encrypt`</summary><br>
|
|
1727
1752
|
|
|
@@ -1753,6 +1778,16 @@ $ dotenvx encrypt -f .env.production
|
|
|
1753
1778
|
⮕ next run [DOTENV_PRIVATE_KEY='bff...bc4' dotenvx run -- yourcommand] to test decryption locally
|
|
1754
1779
|
```
|
|
1755
1780
|
|
|
1781
|
+
</details>
|
|
1782
|
+
<details><summary>`encrypt --no-keychain`</summary><br>
|
|
1783
|
+
|
|
1784
|
+
Turn off macOS Keychain lookups for encrypt.
|
|
1785
|
+
|
|
1786
|
+
```sh
|
|
1787
|
+
$ dotenvx encrypt --no-keychain
|
|
1788
|
+
◈ encrypted (.env)
|
|
1789
|
+
```
|
|
1790
|
+
|
|
1756
1791
|
</details>
|
|
1757
1792
|
<details><summary>`encrypt --no-armor`</summary><br>
|
|
1758
1793
|
|
|
@@ -1763,8 +1798,6 @@ $ dotenvx encrypt --no-armor
|
|
|
1763
1798
|
◈ encrypted (.env)
|
|
1764
1799
|
```
|
|
1765
1800
|
|
|
1766
|
-
`--no-vlt` and `--no-ops` are deprecated aliases.
|
|
1767
|
-
|
|
1768
1801
|
</details>
|
|
1769
1802
|
<details><summary>`encrypt -fk`</summary><br>
|
|
1770
1803
|
|
|
@@ -1884,6 +1917,16 @@ $ dotenvx decrypt
|
|
|
1884
1917
|
◇ decrypted (.env)
|
|
1885
1918
|
```
|
|
1886
1919
|
|
|
1920
|
+
</details>
|
|
1921
|
+
<details><summary>`decrypt --no-keychain`</summary><br>
|
|
1922
|
+
|
|
1923
|
+
Turn off macOS Keychain lookups for decrypt.
|
|
1924
|
+
|
|
1925
|
+
```sh
|
|
1926
|
+
$ dotenvx decrypt --no-keychain
|
|
1927
|
+
◇ decrypted (.env)
|
|
1928
|
+
```
|
|
1929
|
+
|
|
1887
1930
|
</details>
|
|
1888
1931
|
<details><summary>`decrypt -f`</summary><br>
|
|
1889
1932
|
|
|
@@ -1995,6 +2038,16 @@ $ dotenvx keypair
|
|
|
1995
2038
|
{"DOTENV_PUBLIC_KEY":"<publicKey>","DOTENV_PRIVATE_KEY":"<privateKey>"}
|
|
1996
2039
|
```
|
|
1997
2040
|
|
|
2041
|
+
</details>
|
|
2042
|
+
<details><summary>`keypair --no-keychain`</summary><br>
|
|
2043
|
+
|
|
2044
|
+
Turn off macOS Keychain lookups for keypair.
|
|
2045
|
+
|
|
2046
|
+
```sh
|
|
2047
|
+
$ dotenvx keypair --no-keychain
|
|
2048
|
+
{"DOTENV_PUBLIC_KEY":"<publicKey>","DOTENV_PRIVATE_KEY":"<privateKey>"}
|
|
2049
|
+
```
|
|
2050
|
+
|
|
1998
2051
|
</details>
|
|
1999
2052
|
<details><summary>`keypair -f`</summary><br>
|
|
2000
2053
|
|
|
@@ -2121,101 +2174,14 @@ $ dotenvx ls -ef '**/.env.prod*'
|
|
|
2121
2174
|
```
|
|
2122
2175
|
|
|
2123
2176
|
</details>
|
|
2124
|
-
<details><summary>`
|
|
2125
|
-
|
|
2126
|
-
Output help for `dotenvx`.
|
|
2127
|
-
|
|
2128
|
-
```sh
|
|
2129
|
-
$ dotenvx help
|
|
2130
|
-
Usage: dotenvx run -- yourcommand
|
|
2131
|
-
|
|
2132
|
-
a secure dotenv–from the creator of `dotenv`
|
|
2133
|
-
|
|
2134
|
-
Options:
|
|
2135
|
-
-l, --log-level <level> set log level (default: "info")
|
|
2136
|
-
-q, --quiet sets log level to error
|
|
2137
|
-
-v, --verbose sets log level to verbose
|
|
2138
|
-
-d, --debug sets log level to debug
|
|
2139
|
-
-V, --version output the version number
|
|
2140
|
-
-h, --help display help for command
|
|
2141
|
-
|
|
2142
|
-
Commands:
|
|
2143
|
-
run inject env at runtime [dotenvx run -- yourcommand]
|
|
2144
|
-
get [KEY] return a single environment variable
|
|
2145
|
-
set <KEY> <value> set a single environment variable
|
|
2146
|
-
encrypt encrypt .env file(s)
|
|
2147
|
-
decrypt decrypt .env file(s)
|
|
2148
|
-
keypair [KEY] print public/private keys for .env file(s)
|
|
2149
|
-
ls [directory] print all .env files in a tree structure
|
|
2150
|
-
gitignore append to .gitignore
|
|
2151
|
-
precommit [directory]
|
|
2152
|
-
prevent committing .env files to code
|
|
2153
|
-
prebuild [directory]
|
|
2154
|
-
prevent including .env files in docker
|
|
2155
|
-
|
|
2156
|
-
Professional Security:
|
|
2157
|
-
login log in to move keys off-device, share with your team, and audit access
|
|
2158
|
-
logout log out of connected security features
|
|
2159
|
-
armor ⛨ move private keys off-device [www.dotenvx.com/armor]
|
|
2160
|
-
```
|
|
2161
|
-
|
|
2162
|
-
You can get more detailed help per command with `dotenvx help COMMAND`.
|
|
2163
|
-
|
|
2164
|
-
```sh
|
|
2165
|
-
$ dotenvx help run
|
|
2166
|
-
Usage: @dotenvx/dotenvx run [options]
|
|
2167
|
-
|
|
2168
|
-
inject env at runtime [dotenvx run -- yourcommand]
|
|
2169
|
-
|
|
2170
|
-
Options:
|
|
2171
|
-
-e, --env <strings...> environment variable(s) set as string (example: "HELLO=Dotenvx") (default: [])
|
|
2172
|
-
-f, --env-file <paths...> path(s) to your env file(s) (default: [])
|
|
2173
|
-
-fv, --env-vault-file <paths...> path(s) to your .env.vault file(s) (default: [])
|
|
2174
|
-
-o, --overload override existing env variables
|
|
2175
|
-
--convention <name> load a .env convention (available conventions: ['nextjs'])
|
|
2176
|
-
-h, --help display help for command
|
|
2177
|
-
|
|
2178
|
-
Examples:
|
|
2179
|
-
|
|
2180
|
-
$ dotenvx run -- npm run dev
|
|
2181
|
-
$ dotenvx run -- flask --app index run
|
|
2182
|
-
$ dotenvx run -- php artisan serve
|
|
2183
|
-
$ dotenvx run -- bin/rails s
|
|
2184
|
-
|
|
2185
|
-
Try it:
|
|
2186
|
-
|
|
2187
|
-
$ echo "HELLO=Dotenvx" > .env
|
|
2188
|
-
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
2189
|
-
|
|
2190
|
-
$ dotenvx run -- node index.js
|
|
2191
|
-
[dotenvx@1.X.X] injecting env (1) from .env
|
|
2192
|
-
Hello Dotenvx
|
|
2193
|
-
```
|
|
2194
|
-
|
|
2195
|
-
</details>
|
|
2196
|
-
<details><summary>`--version`</summary><br>
|
|
2197
|
-
|
|
2198
|
-
Check current version of `dotenvx`.
|
|
2199
|
-
|
|
2200
|
-
```sh
|
|
2201
|
-
$ dotenvx --version
|
|
2202
|
-
X.X.X
|
|
2203
|
-
```
|
|
2204
|
-
|
|
2205
|
-
</details>
|
|
2206
|
-
|
|
2207
|
-
### Utilities
|
|
2208
|
-
|
|
2209
|
-
Additional workflow helpers.
|
|
2210
|
-
|
|
2211
|
-
<details><summary>`ext genexample`</summary><br>
|
|
2177
|
+
<details><summary>`genexample`</summary><br>
|
|
2212
2178
|
|
|
2213
2179
|
In one command, generate a `.env.example` file from your current `.env` file contents.
|
|
2214
2180
|
|
|
2215
2181
|
```sh
|
|
2216
2182
|
$ echo "HELLO=Dotenvx" > .env
|
|
2217
2183
|
|
|
2218
|
-
$ dotenvx
|
|
2184
|
+
$ dotenvx genexample
|
|
2219
2185
|
▣ generated (.env.example)
|
|
2220
2186
|
```
|
|
2221
2187
|
|
|
@@ -2225,7 +2191,7 @@ HELLO=""
|
|
|
2225
2191
|
```
|
|
2226
2192
|
|
|
2227
2193
|
</details>
|
|
2228
|
-
<details><summary>`
|
|
2194
|
+
<details><summary>`genexample -f`</summary><br>
|
|
2229
2195
|
|
|
2230
2196
|
Pass multiple `.env` files to generate your `.env.example` file from the combination of their contents.
|
|
2231
2197
|
|
|
@@ -2233,7 +2199,7 @@ Pass multiple `.env` files to generate your `.env.example` file from the combina
|
|
|
2233
2199
|
$ echo "HELLO=Dotenvx" > .env
|
|
2234
2200
|
$ echo "DB_HOST=example.com" > .env.production
|
|
2235
2201
|
|
|
2236
|
-
$ dotenvx
|
|
2202
|
+
$ dotenvx genexample -f .env -f .env.production
|
|
2237
2203
|
▣ generated (.env.example)
|
|
2238
2204
|
```
|
|
2239
2205
|
|
|
@@ -2244,7 +2210,7 @@ DB_HOST=""
|
|
|
2244
2210
|
```
|
|
2245
2211
|
|
|
2246
2212
|
</details>
|
|
2247
|
-
<details><summary>`
|
|
2213
|
+
<details><summary>`genexample directory`</summary><br>
|
|
2248
2214
|
|
|
2249
2215
|
Generate a `.env.example` file inside the specified directory. Useful for monorepos.
|
|
2250
2216
|
|
|
@@ -2253,7 +2219,7 @@ $ echo "HELLO=Dotenvx" > .env
|
|
|
2253
2219
|
$ mkdir -p apps/backend
|
|
2254
2220
|
$ echo "HELLO=Backend" > apps/backend/.env
|
|
2255
2221
|
|
|
2256
|
-
$ dotenvx
|
|
2222
|
+
$ dotenvx genexample apps/backend
|
|
2257
2223
|
▣ generated (.env.example)
|
|
2258
2224
|
```
|
|
2259
2225
|
|
|
@@ -2357,17 +2323,217 @@ CMD ["/usr/local/bin/dotenvx", "run", "--", "node", "apps/backend/index.js"]
|
|
|
2357
2323
|
```
|
|
2358
2324
|
|
|
2359
2325
|
</details>
|
|
2360
|
-
<details><summary>`
|
|
2326
|
+
<details><summary>`keychain`</summary><br>
|
|
2327
|
+
|
|
2328
|
+
Store private keys in macOS Keychain to keep them out of `.env.keys`.
|
|
2329
|
+
|
|
2330
|
+
Currently supported on macOS.
|
|
2331
|
+
|
|
2332
|
+
</details>
|
|
2333
|
+
<details><summary>`keychain up`</summary><br>
|
|
2334
|
+
|
|
2335
|
+
Move a private key from `.env.keys` into macOS Keychain.
|
|
2336
|
+
|
|
2337
|
+
```sh
|
|
2338
|
+
$ dotenvx keychain up
|
|
2339
|
+
```
|
|
2340
|
+
|
|
2341
|
+
Specify files with `-f` and `-fk`.
|
|
2342
|
+
|
|
2343
|
+
```sh
|
|
2344
|
+
$ dotenvx keychain up -f .env.production -fk .env.keys
|
|
2345
|
+
```
|
|
2346
|
+
|
|
2347
|
+
</details>
|
|
2348
|
+
<details><summary>`keychain down`</summary><br>
|
|
2349
|
+
|
|
2350
|
+
Move a private key from macOS Keychain back into `.env.keys`.
|
|
2351
|
+
|
|
2352
|
+
```sh
|
|
2353
|
+
$ dotenvx keychain down
|
|
2354
|
+
```
|
|
2355
|
+
|
|
2356
|
+
</details>
|
|
2357
|
+
<details><summary>`keychain push`</summary><br>
|
|
2358
|
+
|
|
2359
|
+
Copy a private key from `.env.keys` into macOS Keychain.
|
|
2360
|
+
|
|
2361
|
+
```sh
|
|
2362
|
+
$ dotenvx keychain push
|
|
2363
|
+
```
|
|
2364
|
+
|
|
2365
|
+
</details>
|
|
2366
|
+
<details><summary>`keychain pull`</summary><br>
|
|
2367
|
+
|
|
2368
|
+
Copy a private key from macOS Keychain into `.env.keys`.
|
|
2369
|
+
|
|
2370
|
+
```sh
|
|
2371
|
+
$ dotenvx keychain pull
|
|
2372
|
+
```
|
|
2373
|
+
|
|
2374
|
+
</details>
|
|
2375
|
+
<details><summary>`armor`</summary><br>
|
|
2376
|
+
|
|
2377
|
+
Move private keys into [Dotenvx Armor ⛨](https://dotenvx.com/armor) for off-device storage, sharing with your team, and audited access.
|
|
2378
|
+
|
|
2379
|
+
</details>
|
|
2380
|
+
<details><summary>`armor up`</summary><br>
|
|
2381
|
+
|
|
2382
|
+
Move a private key from `.env.keys` into Dotenvx Armor.
|
|
2383
|
+
|
|
2384
|
+
```sh
|
|
2385
|
+
$ dotenvx armor login
|
|
2386
|
+
$ dotenvx armor up
|
|
2387
|
+
```
|
|
2388
|
+
|
|
2389
|
+
Specify environment and team.
|
|
2390
|
+
|
|
2391
|
+
```sh
|
|
2392
|
+
$ dotenvx armor up -f .env.production --team acme
|
|
2393
|
+
```
|
|
2394
|
+
|
|
2395
|
+
</details>
|
|
2396
|
+
<details><summary>`armor down`</summary><br>
|
|
2397
|
+
|
|
2398
|
+
Move a private key from Dotenvx Armor back into `.env.keys`.
|
|
2399
|
+
|
|
2400
|
+
```sh
|
|
2401
|
+
$ dotenvx armor down
|
|
2402
|
+
```
|
|
2403
|
+
|
|
2404
|
+
</details>
|
|
2405
|
+
<details><summary>`armor push`</summary><br>
|
|
2406
|
+
|
|
2407
|
+
Copy a private key from `.env.keys` into Dotenvx Armor.
|
|
2408
|
+
|
|
2409
|
+
```sh
|
|
2410
|
+
$ dotenvx armor push
|
|
2411
|
+
```
|
|
2412
|
+
|
|
2413
|
+
</details>
|
|
2414
|
+
<details><summary>`armor pull`</summary><br>
|
|
2415
|
+
|
|
2416
|
+
Copy a private key from Dotenvx Armor into `.env.keys`.
|
|
2417
|
+
|
|
2418
|
+
```sh
|
|
2419
|
+
$ dotenvx armor pull
|
|
2420
|
+
```
|
|
2421
|
+
|
|
2422
|
+
Use a token when running non-interactively.
|
|
2423
|
+
|
|
2424
|
+
```sh
|
|
2425
|
+
$ dotenvx armor pull -f .env.production --token "$DOTENVX_ARMOR_TOKEN"
|
|
2426
|
+
```
|
|
2427
|
+
|
|
2428
|
+
</details>
|
|
2429
|
+
<details><summary>`armor move`</summary><br>
|
|
2430
|
+
|
|
2431
|
+
Move an armored key to another team.
|
|
2432
|
+
|
|
2433
|
+
```sh
|
|
2434
|
+
$ dotenvx armor move --team acme
|
|
2435
|
+
```
|
|
2436
|
+
|
|
2437
|
+
</details>
|
|
2438
|
+
<details><summary>`armor login`</summary><br>
|
|
2439
|
+
|
|
2440
|
+
Log in to Dotenvx Armor.
|
|
2441
|
+
|
|
2442
|
+
```sh
|
|
2443
|
+
$ dotenvx armor login
|
|
2444
|
+
```
|
|
2445
|
+
|
|
2446
|
+
</details>
|
|
2447
|
+
<details><summary>`armor logout`</summary><br>
|
|
2448
|
+
|
|
2449
|
+
Log out of Dotenvx Armor.
|
|
2450
|
+
|
|
2451
|
+
```sh
|
|
2452
|
+
$ dotenvx armor logout
|
|
2453
|
+
```
|
|
2454
|
+
|
|
2455
|
+
</details>
|
|
2456
|
+
<details><summary>`help`</summary><br>
|
|
2457
|
+
|
|
2458
|
+
Output help for `dotenvx`.
|
|
2459
|
+
|
|
2460
|
+
```sh
|
|
2461
|
+
$ dotenvx help
|
|
2462
|
+
Usage: dotenvx run -- yourcommand
|
|
2463
|
+
|
|
2464
|
+
a secure dotenv–from the creator of `dotenv`
|
|
2465
|
+
|
|
2466
|
+
Options:
|
|
2467
|
+
-l, --log-level <level> set log level (default: "info")
|
|
2468
|
+
-q, --quiet sets log level to error
|
|
2469
|
+
-v, --verbose sets log level to verbose
|
|
2470
|
+
-d, --debug sets log level to debug
|
|
2471
|
+
-V, --version output the version number
|
|
2472
|
+
-h, --help display help for command
|
|
2473
|
+
|
|
2474
|
+
Commands:
|
|
2475
|
+
run inject env at runtime [dotenvx run -- yourcommand]
|
|
2476
|
+
get [KEY] return a single environment variable
|
|
2477
|
+
set <KEY> <value> set a single environment variable
|
|
2478
|
+
encrypt encrypt .env file(s)
|
|
2479
|
+
decrypt decrypt .env file(s)
|
|
2480
|
+
keypair [KEY] print public/private keys for .env file(s)
|
|
2481
|
+
ls [directory] print all .env files in a tree structure
|
|
2482
|
+
genexample [directory]
|
|
2483
|
+
generate .env.example
|
|
2484
|
+
gitignore append to .gitignore
|
|
2485
|
+
precommit [directory]
|
|
2486
|
+
prevent committing .env files to code
|
|
2487
|
+
prebuild [directory]
|
|
2488
|
+
prevent including .env files in docker
|
|
2489
|
+
|
|
2490
|
+
Professional Security:
|
|
2491
|
+
keychain ⌥ move private keys into macOS Keychain
|
|
2492
|
+
armor ⛨ move private keys into Dotenvx Armor [www.dotenvx.com/armor]
|
|
2493
|
+
```
|
|
2361
2494
|
|
|
2362
|
-
|
|
2495
|
+
You can get more detailed help per command with `dotenvx help COMMAND`.
|
|
2363
2496
|
|
|
2364
2497
|
```sh
|
|
2365
|
-
$ dotenvx
|
|
2366
|
-
|
|
2367
|
-
|
|
2498
|
+
$ dotenvx help run
|
|
2499
|
+
Usage: @dotenvx/dotenvx run [options]
|
|
2500
|
+
|
|
2501
|
+
inject env at runtime [dotenvx run -- yourcommand]
|
|
2502
|
+
|
|
2503
|
+
Options:
|
|
2504
|
+
-e, --env <strings...> environment variable(s) set as string (example: "HELLO=Dotenvx") (default: [])
|
|
2505
|
+
-f, --env-file <paths...> path(s) to your env file(s) (default: [])
|
|
2506
|
+
-fv, --env-vault-file <paths...> path(s) to your .env.vault file(s) (default: [])
|
|
2507
|
+
-o, --overload override existing env variables
|
|
2508
|
+
--convention <name> load a .env convention (available conventions: ['nextjs'])
|
|
2509
|
+
-h, --help display help for command
|
|
2510
|
+
|
|
2511
|
+
Examples:
|
|
2512
|
+
|
|
2513
|
+
$ dotenvx run -- npm run dev
|
|
2514
|
+
$ dotenvx run -- flask --app index run
|
|
2515
|
+
$ dotenvx run -- php artisan serve
|
|
2516
|
+
$ dotenvx run -- bin/rails s
|
|
2517
|
+
|
|
2518
|
+
Try it:
|
|
2519
|
+
|
|
2520
|
+
$ echo "HELLO=Dotenvx" > .env
|
|
2521
|
+
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
2522
|
+
|
|
2523
|
+
$ dotenvx run -- node index.js
|
|
2524
|
+
[dotenvx@1.X.X] injecting env (1) from .env
|
|
2525
|
+
Hello Dotenvx
|
|
2368
2526
|
```
|
|
2369
2527
|
|
|
2370
|
-
|
|
2528
|
+
</details>
|
|
2529
|
+
<details><summary>`--version`</summary><br>
|
|
2530
|
+
|
|
2531
|
+
Check current version of `dotenvx`.
|
|
2532
|
+
|
|
2533
|
+
```sh
|
|
2534
|
+
$ dotenvx --version
|
|
2535
|
+
X.X.X
|
|
2536
|
+
```
|
|
2371
2537
|
|
|
2372
2538
|
</details>
|
|
2373
2539
|
|
|
@@ -2614,8 +2780,6 @@ Turn off [Dotenvx Armor ⛨](https://dotenvx.com/armor) features.
|
|
|
2614
2780
|
require('@dotenvx/dotenvx').config({noArmor: true})
|
|
2615
2781
|
```
|
|
2616
2782
|
|
|
2617
|
-
`noVlt` and `noOps` are deprecated aliases.
|
|
2618
|
-
|
|
2619
2783
|
</details>
|
|
2620
2784
|
<details><summary>`parse(src)`</summary><br>
|
|
2621
2785
|
|
|
@@ -2723,18 +2887,6 @@ This is known as *Decryption at Access* and is written about in [the whitepaper]
|
|
|
2723
2887
|
|
|
2724
2888
|
|
|
2725
2889
|
|
|
2726
|
-
## Whitepaper
|
|
2727
|
-
|
|
2728
|
-
> **Dotenvx: Reducing Secrets Risk with Cryptographic Separation**
|
|
2729
|
-
>
|
|
2730
|
-
> Abstract. An ideal secrets solution would not only centralize secrets but also contain the fallout of a breach. While secrets managers offer centralized storage and distribution, their design creates a large blast radius, risking exposure of thousands or even millions of secrets. We propose a solution that reduces the blast radius by splitting secrets management into two distinct components: an encrypted secrets file and a separate decryption key.
|
|
2731
|
-
>
|
|
2732
|
-
> ...
|
|
2733
|
-
>
|
|
2734
|
-
> [Read the whitepaper](https://dotenvx.com/dotenvx.pdf)
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
2890
|
## Guides
|
|
2739
2891
|
|
|
2740
2892
|
> Go deeper with `dotenvx` – detailed framework and platform guides.
|
|
@@ -2766,6 +2918,9 @@ This is known as *Decryption at Access* and is written about in [the whitepaper]
|
|
|
2766
2918
|
* [Render](https://dotenvx.com/docs/platforms/render)
|
|
2767
2919
|
* [CI/CDs](https://dotenvx.com/docs#cis)
|
|
2768
2920
|
* [GitHub Actions](https://dotenvx.com/docs/cis/github-actions)
|
|
2921
|
+
* [Password Managers](https://dotenvx.com/docs#password-managers)
|
|
2922
|
+
* [1Password](https://dotenvx.com/docs/guides/1password)
|
|
2923
|
+
* [Bitwarden](https://dotenvx.com/docs/guides/bitwarden)
|
|
2769
2924
|
* [Background Jobs](https://dotenvx.com/docs#background-jobs)
|
|
2770
2925
|
* [Trigger.dev](https://dotenvx.com/docs/background-jobs/triggerdotdev)
|
|
2771
2926
|
* [Package Managers](https://dotenvx.com/docs#package-managers)
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.2.
|
|
2
|
+
"version": "2.2.2",
|
|
3
3
|
"name": "@dotenvx/dotenvx",
|
|
4
4
|
"description": "a secure dotenv–from the creator of `dotenv`",
|
|
5
5
|
"author": "@motdotla",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"standard": "standard",
|
|
37
37
|
"standard:fix": "standard --fix",
|
|
38
38
|
"test": "tap run --test-env=DOTENVX_NO_ARMOR=true --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
39
|
-
"testshell": "bash
|
|
39
|
+
"testshell": "shellspec --shell /bin/bash",
|
|
40
40
|
"release:check": "npm test && npm run testshell",
|
|
41
41
|
"prerelease": "npm run release:check",
|
|
42
42
|
"release": "npm run release:check && standard-version"
|
|
@@ -66,6 +66,24 @@ function configureArmorCommand (armor) {
|
|
|
66
66
|
.option('--token <token>', 'set token')
|
|
67
67
|
.action(moveAction)
|
|
68
68
|
|
|
69
|
+
// dotenvx armor login
|
|
70
|
+
const loginAction = require('./../actions/login')
|
|
71
|
+
armor
|
|
72
|
+
.command('login')
|
|
73
|
+
.description('log in to Dotenvx Armor')
|
|
74
|
+
.allowUnknownOption()
|
|
75
|
+
.option('--hostname <hostname>', 'set Armor ⛨ hostname')
|
|
76
|
+
.action(loginAction)
|
|
77
|
+
|
|
78
|
+
// dotenvx armor logout
|
|
79
|
+
const logoutAction = require('./../actions/logout')
|
|
80
|
+
armor
|
|
81
|
+
.command('logout')
|
|
82
|
+
.description('log out of Dotenvx Armor')
|
|
83
|
+
.allowUnknownOption()
|
|
84
|
+
.option('--hostname <hostname>', 'set Armor ⛨ hostname')
|
|
85
|
+
.action(logoutAction)
|
|
86
|
+
|
|
69
87
|
return armor
|
|
70
88
|
}
|
|
71
89
|
|
package/src/cli/dotenvx.js
CHANGED
|
@@ -186,6 +186,15 @@ program.command('ls')
|
|
|
186
186
|
return require('./actions/ls').apply(this, args)
|
|
187
187
|
})
|
|
188
188
|
|
|
189
|
+
// dotenvx genexample
|
|
190
|
+
program.command('genexample')
|
|
191
|
+
.description('generate .env.example')
|
|
192
|
+
.argument('[directory]', 'directory to generate from', '.')
|
|
193
|
+
.option('-f, --env-file <paths...>', 'path(s) to your env file(s)', '.env')
|
|
194
|
+
.action(function (...args) {
|
|
195
|
+
return require('./actions/ext/genexample').apply(this, args)
|
|
196
|
+
})
|
|
197
|
+
|
|
189
198
|
// dotenvx gitignore
|
|
190
199
|
program.command('gitignore')
|
|
191
200
|
.description('append to .gitignore')
|
|
@@ -222,7 +231,7 @@ program.command('doctor', { hidden: true })
|
|
|
222
231
|
return require('./actions/doctor').apply(this, args)
|
|
223
232
|
})
|
|
224
233
|
|
|
225
|
-
// dotenvx login
|
|
234
|
+
// dotenvx login (compatibility alias for dotenvx armor login)
|
|
226
235
|
program.command('login', { hidden: true })
|
|
227
236
|
.description('log in to move keys off-device, share with your team, and audit access')
|
|
228
237
|
.allowUnknownOption()
|
|
@@ -231,7 +240,7 @@ program.command('login', { hidden: true })
|
|
|
231
240
|
return require('./actions/login').apply(this, args)
|
|
232
241
|
})
|
|
233
242
|
|
|
234
|
-
// dotenvx logout
|
|
243
|
+
// dotenvx logout (compatibility alias for dotenvx armor logout)
|
|
235
244
|
program.command('logout', { hidden: true })
|
|
236
245
|
.description('log out of connected security features')
|
|
237
246
|
.allowUnknownOption()
|
|
@@ -259,8 +268,6 @@ program.command('help [command]')
|
|
|
259
268
|
// dotenvx armor
|
|
260
269
|
program.addHelpText('after', ' ')
|
|
261
270
|
program.addHelpText('after', 'Professional Security: ')
|
|
262
|
-
program.addHelpText('after', ' login log in to move keys off-device, share with your team, and audit access')
|
|
263
|
-
program.addHelpText('after', ' logout log out of connected security features')
|
|
264
271
|
program.addHelpText('after', ' keychain ⌥ move private keys into macOS Keychain')
|
|
265
272
|
program.addHelpText('after', ' armor ⛨ move private keys into Dotenvx Armor [www.dotenvx.com/armor]')
|
|
266
273
|
|
package/src/db/session.js
CHANGED
|
@@ -226,19 +226,19 @@ class Session {
|
|
|
226
226
|
//
|
|
227
227
|
login (hostname, id, username, accessToken) {
|
|
228
228
|
if (!hostname) {
|
|
229
|
-
throw new Error('DOTENVX_ARMOR_HOSTNAME not set. Run [dotenvx login]')
|
|
229
|
+
throw new Error('DOTENVX_ARMOR_HOSTNAME not set. Run [dotenvx armor login]')
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
if (!id) {
|
|
233
|
-
throw new Error('DOTENVX_ARMOR_USER not set. Run [dotenvx login]')
|
|
233
|
+
throw new Error('DOTENVX_ARMOR_USER not set. Run [dotenvx armor login]')
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
if (!username) {
|
|
237
|
-
throw new Error('DOTENVX_ARMOR_USERNAME not set. Run [dotenvx login]')
|
|
237
|
+
throw new Error('DOTENVX_ARMOR_USERNAME not set. Run [dotenvx armor login]')
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
if (!accessToken) {
|
|
241
|
-
throw new Error('DOTENVX_ARMOR_TOKEN not set. Run [dotenvx login]')
|
|
241
|
+
throw new Error('DOTENVX_ARMOR_TOKEN not set. Run [dotenvx armor login]')
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
const store = this.createStore()
|
|
@@ -252,15 +252,15 @@ class Session {
|
|
|
252
252
|
|
|
253
253
|
logout (hostname, id, accessToken) {
|
|
254
254
|
if (!hostname) {
|
|
255
|
-
throw new Error('DOTENVX_ARMOR_HOSTNAME not set. Run [dotenvx login]')
|
|
255
|
+
throw new Error('DOTENVX_ARMOR_HOSTNAME not set. Run [dotenvx armor login]')
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
if (!id) {
|
|
259
|
-
throw new Error('DOTENVX_ARMOR_USER not set. Run [dotenvx login]')
|
|
259
|
+
throw new Error('DOTENVX_ARMOR_USER not set. Run [dotenvx armor login]')
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
if (!accessToken) {
|
|
263
|
-
throw new Error('DOTENVX_ARMOR_TOKEN not set. Run [dotenvx login]')
|
|
263
|
+
throw new Error('DOTENVX_ARMOR_TOKEN not set. Run [dotenvx armor login]')
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
const store = this.openStore()
|
|
@@ -45,7 +45,7 @@ class Genexample {
|
|
|
45
45
|
const filepath = path.resolve(this.directory, envFilepath)
|
|
46
46
|
if (!fsx.existsSync(filepath)) {
|
|
47
47
|
const error = new Errors({ envFilepath, filepath }).missingEnvFile()
|
|
48
|
-
error.help = `? add it with [echo "HELLO=World" > ${envFilepath}] and then run [dotenvx
|
|
48
|
+
error.help = `? add it with [echo "HELLO=World" > ${envFilepath}] and then run [dotenvx genexample]`
|
|
49
49
|
throw error
|
|
50
50
|
}
|
|
51
51
|
|