@dotenvx/dotenvx 2.18.1 → 2.19.1
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 +163 -0
- package/package.json +1 -1
- package/src/cli/actions/armor/open.js +28 -0
- package/src/cli/commands/armor.js +9 -0
- package/src/cli/dotenvx.js +6 -1
- package/src/cli/help.js +13 -11
- package/src/lib/providers/armor/index.js +7 -1
- package/src/lib/services/armorOpen.js +26 -0
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.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.19.1...main)
|
|
6
|
+
|
|
7
|
+
## [2.19.1](https://github.com/dotenvx/dotenvx/compare/v2.19.0...v2.19.1) (2026-07-29)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* User can click enter to open up approval url for convenience ([#934](https://github.com/dotenvx/dotenvx/pull/934))
|
|
12
|
+
|
|
13
|
+
## [2.19.0](https://github.com/dotenvx/dotenvx/compare/v2.18.1...v2.19.0) (2026-07-27)
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
* Add `dotenvx armor open` to open armored key details in browser ([#930](https://github.com/dotenvx/dotenvx/pull/930))
|
|
6
18
|
|
|
7
19
|
## [2.18.1](https://github.com/dotenvx/dotenvx/compare/v2.18.0...v2.18.1) (2026-07-26)
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -1734,6 +1734,37 @@ Turn off OS secret store lookups for get.
|
|
|
1734
1734
|
$ dotenvx get HELLO --no-native
|
|
1735
1735
|
```
|
|
1736
1736
|
|
|
1737
|
+
</details>
|
|
1738
|
+
<details><summary>`get KEY --no-armor`</summary><br>
|
|
1739
|
+
|
|
1740
|
+
Turn off [Dotenvx Armor ⛨](https://dotenvx.com/armor) features for get.
|
|
1741
|
+
|
|
1742
|
+
```sh
|
|
1743
|
+
$ dotenvx get HELLO --no-armor
|
|
1744
|
+
World
|
|
1745
|
+
```
|
|
1746
|
+
|
|
1747
|
+
</details>
|
|
1748
|
+
<details><summary>`get KEY --ignore`</summary><br>
|
|
1749
|
+
|
|
1750
|
+
Ignore specific error codes.
|
|
1751
|
+
|
|
1752
|
+
```sh
|
|
1753
|
+
$ dotenvx get HELLO --ignore=MISSING_ENV_FILE
|
|
1754
|
+
```
|
|
1755
|
+
|
|
1756
|
+
Ignore multiple error codes by separating them with spaces.
|
|
1757
|
+
|
|
1758
|
+
```sh
|
|
1759
|
+
$ dotenvx get HELLO --ignore=MISSING_ENV_FILE MISSING_KEY
|
|
1760
|
+
```
|
|
1761
|
+
|
|
1762
|
+
You can also set `DOTENV_CONFIG_IGNORE`. Its value is a comma-separated list.
|
|
1763
|
+
|
|
1764
|
+
```sh
|
|
1765
|
+
$ DOTENV_CONFIG_IGNORE=MISSING_ENV_FILE,OTHER dotenvx get HELLO
|
|
1766
|
+
```
|
|
1767
|
+
|
|
1737
1768
|
</details>
|
|
1738
1769
|
<details><summary>`get KEY -f`</summary><br>
|
|
1739
1770
|
|
|
@@ -1880,6 +1911,20 @@ $ dotenvx get
|
|
|
1880
1911
|
{"HELLO":"World"}
|
|
1881
1912
|
```
|
|
1882
1913
|
|
|
1914
|
+
</details>
|
|
1915
|
+
<details><summary>`get --pretty-print`</summary><br>
|
|
1916
|
+
|
|
1917
|
+
Make the JSON output more readable.
|
|
1918
|
+
|
|
1919
|
+
```sh
|
|
1920
|
+
$ echo "HELLO=World" > .env
|
|
1921
|
+
|
|
1922
|
+
$ dotenvx get --pretty-print
|
|
1923
|
+
{
|
|
1924
|
+
"HELLO": "World"
|
|
1925
|
+
}
|
|
1926
|
+
```
|
|
1927
|
+
|
|
1883
1928
|
</details>
|
|
1884
1929
|
<details><summary>`get -ik`</summary><br>
|
|
1885
1930
|
|
|
@@ -1904,6 +1949,18 @@ $ dotenvx get --format=eval-export -ek "DOTENV_PUBLIC_KEY*"
|
|
|
1904
1949
|
export HELLO='World'
|
|
1905
1950
|
```
|
|
1906
1951
|
|
|
1952
|
+
</details>
|
|
1953
|
+
<details><summary>`get --format colon`</summary><br>
|
|
1954
|
+
|
|
1955
|
+
Return a colon-formatted response of all key/value pairs in a `.env` file.
|
|
1956
|
+
|
|
1957
|
+
```sh
|
|
1958
|
+
$ echo "HELLO=World" > .env
|
|
1959
|
+
|
|
1960
|
+
$ dotenvx get --format colon
|
|
1961
|
+
HELLO: World
|
|
1962
|
+
```
|
|
1963
|
+
|
|
1907
1964
|
</details>
|
|
1908
1965
|
<details><summary>`get --format shell`</summary><br>
|
|
1909
1966
|
|
|
@@ -2100,6 +2157,25 @@ Turn off OS secret store lookups for set.
|
|
|
2100
2157
|
$ dotenvx set HELLO World --no-native
|
|
2101
2158
|
```
|
|
2102
2159
|
|
|
2160
|
+
</details>
|
|
2161
|
+
<details><summary>`set KEY value --no-armor`</summary><br>
|
|
2162
|
+
|
|
2163
|
+
Turn off [Dotenvx Armor ⛨](https://dotenvx.com/armor) features for set.
|
|
2164
|
+
|
|
2165
|
+
```sh
|
|
2166
|
+
$ dotenvx set HELLO World --no-armor
|
|
2167
|
+
◈ encrypted HELLO (.env)
|
|
2168
|
+
```
|
|
2169
|
+
|
|
2170
|
+
</details>
|
|
2171
|
+
<details><summary>`set KEY value --no-create`</summary><br>
|
|
2172
|
+
|
|
2173
|
+
Do not create a missing `.env` file.
|
|
2174
|
+
|
|
2175
|
+
```sh
|
|
2176
|
+
$ dotenvx set HELLO World -f .env.production --no-create
|
|
2177
|
+
```
|
|
2178
|
+
|
|
2103
2179
|
</details>
|
|
2104
2180
|
<details><summary>`encrypt`</summary><br>
|
|
2105
2181
|
|
|
@@ -2149,6 +2225,25 @@ $ dotenvx encrypt --no-armor
|
|
|
2149
2225
|
◈ encrypted (.env)
|
|
2150
2226
|
```
|
|
2151
2227
|
|
|
2228
|
+
</details>
|
|
2229
|
+
<details><summary>`encrypt --token`</summary><br>
|
|
2230
|
+
|
|
2231
|
+
Set the Armor token.
|
|
2232
|
+
|
|
2233
|
+
```sh
|
|
2234
|
+
$ dotenvx encrypt --token token
|
|
2235
|
+
◈ encrypted (.env) · armored ⛨
|
|
2236
|
+
```
|
|
2237
|
+
|
|
2238
|
+
</details>
|
|
2239
|
+
<details><summary>`encrypt --no-create`</summary><br>
|
|
2240
|
+
|
|
2241
|
+
Do not create a missing `.env` file.
|
|
2242
|
+
|
|
2243
|
+
```sh
|
|
2244
|
+
$ dotenvx encrypt -f .env.production --no-create
|
|
2245
|
+
```
|
|
2246
|
+
|
|
2152
2247
|
</details>
|
|
2153
2248
|
<details><summary>`encrypt -fk`</summary><br>
|
|
2154
2249
|
|
|
@@ -2278,6 +2373,16 @@ $ dotenvx decrypt --no-native
|
|
|
2278
2373
|
◇ decrypted (.env)
|
|
2279
2374
|
```
|
|
2280
2375
|
|
|
2376
|
+
</details>
|
|
2377
|
+
<details><summary>`decrypt --no-armor`</summary><br>
|
|
2378
|
+
|
|
2379
|
+
Turn off [Dotenvx Armor ⛨](https://dotenvx.com/armor) features for decrypt.
|
|
2380
|
+
|
|
2381
|
+
```sh
|
|
2382
|
+
$ dotenvx decrypt --no-armor
|
|
2383
|
+
◇ decrypted (.env)
|
|
2384
|
+
```
|
|
2385
|
+
|
|
2281
2386
|
</details>
|
|
2282
2387
|
<details><summary>`decrypt -f`</summary><br>
|
|
2283
2388
|
|
|
@@ -2416,6 +2521,16 @@ $ dotenvx keypair --no-native
|
|
|
2416
2521
|
{"DOTENV_PUBLIC_KEY":"<publicKey>","DOTENV_PRIVATE_KEY":"<privateKey>"}
|
|
2417
2522
|
```
|
|
2418
2523
|
|
|
2524
|
+
</details>
|
|
2525
|
+
<details><summary>`keypair --no-armor`</summary><br>
|
|
2526
|
+
|
|
2527
|
+
Turn off [Dotenvx Armor ⛨](https://dotenvx.com/armor) features for keypair.
|
|
2528
|
+
|
|
2529
|
+
```sh
|
|
2530
|
+
$ dotenvx keypair --no-armor
|
|
2531
|
+
{"DOTENV_PUBLIC_KEY":"<publicKey>","DOTENV_PRIVATE_KEY":"<privateKey>"}
|
|
2532
|
+
```
|
|
2533
|
+
|
|
2419
2534
|
</details>
|
|
2420
2535
|
<details><summary>`keypair -f`</summary><br>
|
|
2421
2536
|
|
|
@@ -2469,6 +2584,39 @@ $ dotenvx keypair --format shell
|
|
|
2469
2584
|
DOTENV_PUBLIC_KEY=<publicKey> DOTENV_PRIVATE_KEY=<privateKey>
|
|
2470
2585
|
```
|
|
2471
2586
|
|
|
2587
|
+
</details>
|
|
2588
|
+
<details><summary>`keypair --format colon`</summary><br>
|
|
2589
|
+
|
|
2590
|
+
Return a colon-formatted keypair.
|
|
2591
|
+
|
|
2592
|
+
```sh
|
|
2593
|
+
$ dotenvx keypair --format colon
|
|
2594
|
+
DOTENV_PUBLIC_KEY:<publicKey> DOTENV_PRIVATE_KEY:<privateKey>
|
|
2595
|
+
```
|
|
2596
|
+
|
|
2597
|
+
</details>
|
|
2598
|
+
<details><summary>`keypair --format json`</summary><br>
|
|
2599
|
+
|
|
2600
|
+
Return a JSON-formatted keypair.
|
|
2601
|
+
|
|
2602
|
+
```sh
|
|
2603
|
+
$ dotenvx keypair --format json
|
|
2604
|
+
{"DOTENV_PUBLIC_KEY":"<publicKey>","DOTENV_PRIVATE_KEY":"<privateKey>"}
|
|
2605
|
+
```
|
|
2606
|
+
|
|
2607
|
+
</details>
|
|
2608
|
+
<details><summary>`keypair --pretty-print`</summary><br>
|
|
2609
|
+
|
|
2610
|
+
Make the JSON output more readable.
|
|
2611
|
+
|
|
2612
|
+
```sh
|
|
2613
|
+
$ dotenvx keypair --pretty-print
|
|
2614
|
+
{
|
|
2615
|
+
"DOTENV_PUBLIC_KEY": "<publicKey>",
|
|
2616
|
+
"DOTENV_PRIVATE_KEY": "<privateKey>"
|
|
2617
|
+
}
|
|
2618
|
+
```
|
|
2619
|
+
|
|
2472
2620
|
</details>
|
|
2473
2621
|
<details><summary>`ls`</summary><br>
|
|
2474
2622
|
|
|
@@ -2895,6 +3043,21 @@ Use a token when running non-interactively.
|
|
|
2895
3043
|
$ dotenvx armor pull -f .env.production --token "$DOTENVX_ARMOR_TOKEN"
|
|
2896
3044
|
```
|
|
2897
3045
|
|
|
3046
|
+
</details>
|
|
3047
|
+
<details><summary>`armor open`</summary><br>
|
|
3048
|
+
|
|
3049
|
+
Open an armored key in your browser.
|
|
3050
|
+
|
|
3051
|
+
```sh
|
|
3052
|
+
$ dotenvx armor open
|
|
3053
|
+
```
|
|
3054
|
+
|
|
3055
|
+
Open the armored key for a specific env file.
|
|
3056
|
+
|
|
3057
|
+
```sh
|
|
3058
|
+
$ dotenvx armor open -f .env.production
|
|
3059
|
+
```
|
|
3060
|
+
|
|
2898
3061
|
</details>
|
|
2899
3062
|
<details><summary>`armor move`</summary><br>
|
|
2900
3063
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const { logger } = require('../../../shared/logger')
|
|
2
|
+
const Session = require('./../../../db/session')
|
|
3
|
+
const ArmorOpen = require('./../../../lib/services/armorOpen')
|
|
4
|
+
const openUrl = require('../../../lib/helpers/openUrl')
|
|
5
|
+
const armoredKeyDisplay = require('../../../lib/helpers/armoredKeyDisplay')
|
|
6
|
+
|
|
7
|
+
async function open () {
|
|
8
|
+
const options = this.opts()
|
|
9
|
+
|
|
10
|
+
logger.debug(`options: ${JSON.stringify(options)}`)
|
|
11
|
+
|
|
12
|
+
const sesh = new Session()
|
|
13
|
+
await sesh.notifyUpdate()
|
|
14
|
+
const hostname = options.hostname || sesh.hostname()
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const { url, publicKeyValue } = new ArmorOpen(hostname, options.envFile).run()
|
|
18
|
+
const keyDisplay = armoredKeyDisplay(publicKeyValue)
|
|
19
|
+
|
|
20
|
+
await openUrl(url)
|
|
21
|
+
logger.success(`◌ opened (${keyDisplay})`)
|
|
22
|
+
} catch (error) {
|
|
23
|
+
logger.error(error.message)
|
|
24
|
+
process.exit(1)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = open
|
|
@@ -61,6 +61,15 @@ function configureArmorCommand (armor) {
|
|
|
61
61
|
return require('./../actions/armor/pull').apply(this, args)
|
|
62
62
|
})
|
|
63
63
|
|
|
64
|
+
// dotenvx armor open
|
|
65
|
+
armor
|
|
66
|
+
.command('open')
|
|
67
|
+
.description('open armored key (in browser)')
|
|
68
|
+
.option('-f, --env-file <path>', 'path to your env file')
|
|
69
|
+
.action(function (...args) {
|
|
70
|
+
return require('./../actions/armor/open').apply(this, args)
|
|
71
|
+
})
|
|
72
|
+
|
|
64
73
|
// dotenvx armor move
|
|
65
74
|
armor
|
|
66
75
|
.command('move')
|
package/src/cli/dotenvx.js
CHANGED
|
@@ -282,11 +282,16 @@ program.command('logout', { hidden: true })
|
|
|
282
282
|
program.command('curl', { hidden: true })
|
|
283
283
|
.description('Dotenvx Armor API')
|
|
284
284
|
.addHelpText('after', help.curl)
|
|
285
|
-
.argument('
|
|
285
|
+
.argument('[url]', '(run dotenvx curl --help for list of urls)')
|
|
286
286
|
.option('-X, --request <method>', 'HTTP request method')
|
|
287
287
|
.option('--data <json>', 'JSON request body')
|
|
288
288
|
.option('--token <token>', 'set token')
|
|
289
289
|
.action(function (...args) {
|
|
290
|
+
if (!this.args[0]) {
|
|
291
|
+
this.outputHelp()
|
|
292
|
+
return
|
|
293
|
+
}
|
|
294
|
+
|
|
290
295
|
return require('./actions/curl').apply(this, args)
|
|
291
296
|
})
|
|
292
297
|
|
package/src/cli/help.js
CHANGED
|
@@ -105,20 +105,22 @@ Endpoints:
|
|
|
105
105
|
GET /api/teams/:team/invitations
|
|
106
106
|
POST /api/teams/:team/invitations
|
|
107
107
|
DELETE /api/teams/:team/invitations/:id
|
|
108
|
+
GET /api/logs?team=:team
|
|
108
109
|
|
|
109
110
|
Examples:
|
|
110
111
|
|
|
111
|
-
dotenvx curl https://armor.dotenvx.com/api/account
|
|
112
|
-
dotenvx curl https://armor.dotenvx.com/api/armor/keypairs
|
|
113
|
-
dotenvx curl https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY
|
|
114
|
-
dotenvx curl https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/settings/guard --data '{"value":true}'
|
|
115
|
-
dotenvx curl https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/settings/enclave --data '{"value":true}'
|
|
116
|
-
dotenvx curl https://armor.dotenvx.com/api/teams
|
|
117
|
-
dotenvx curl https://armor.dotenvx.com/api/teams/TEAM
|
|
118
|
-
dotenvx curl https://armor.dotenvx.com/api/teams/TEAM/members
|
|
119
|
-
dotenvx curl https://armor.dotenvx.com/api/teams/TEAM/members
|
|
120
|
-
dotenvx curl https://armor.dotenvx.com/api/teams/TEAM/invitations --data '{"email":"person@example.com","role":"member"}'
|
|
121
|
-
dotenvx curl https://armor.dotenvx.com/api/teams/TEAM/invitations/123 --request DELETE
|
|
112
|
+
dotenvx curl "https://armor.dotenvx.com/api/account"
|
|
113
|
+
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs"
|
|
114
|
+
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY"
|
|
115
|
+
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/settings/guard" --data '{"value":true}'
|
|
116
|
+
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/settings/enclave" --data '{"value":true}'
|
|
117
|
+
dotenvx curl "https://armor.dotenvx.com/api/teams"
|
|
118
|
+
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM"
|
|
119
|
+
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/members"
|
|
120
|
+
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/members"
|
|
121
|
+
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/invitations" --data '{"email":"person@example.com","role":"member"}'
|
|
122
|
+
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/invitations/123" --request DELETE
|
|
123
|
+
dotenvx curl "https://armor.dotenvx.com/api/logs?team=TEAM"
|
|
122
124
|
`
|
|
123
125
|
}
|
|
124
126
|
|
|
@@ -2,6 +2,8 @@ const Session = require('../../../db/session')
|
|
|
2
2
|
const ArmorKeyring = require('../../services/armorKeyring')
|
|
3
3
|
const armoredKeyDisplay = require('../../helpers/armoredKeyDisplay')
|
|
4
4
|
const isNetworkError = require('../../helpers/isNetworkError')
|
|
5
|
+
const listenForOpenKey = require('../../helpers/listenForOpenKey')
|
|
6
|
+
const openUrl = require('../../helpers/openUrl')
|
|
5
7
|
|
|
6
8
|
async function index (publicKeyHex, options = {}) {
|
|
7
9
|
const sesh = new Session()
|
|
@@ -16,11 +18,13 @@ async function index (publicKeyHex, options = {}) {
|
|
|
16
18
|
devicePublicKey,
|
|
17
19
|
publicKeyHex
|
|
18
20
|
)
|
|
21
|
+
let cleanupOpenKeyListener = () => {}
|
|
19
22
|
if (options.onStatus) {
|
|
20
23
|
keyring.onApprovalRequired = ({ approvalUri, code }) => {
|
|
21
24
|
const keyDisplay = armoredKeyDisplay(publicKeyHex)
|
|
22
25
|
const keySuffix = keyDisplay ? ` (${keyDisplay})` : ''
|
|
23
|
-
options.onStatus(`[${code}]
|
|
26
|
+
options.onStatus(`[${code}] press Enter to open [${approvalUri}] and approve${keySuffix}`)
|
|
27
|
+
cleanupOpenKeyListener = listenForOpenKey(() => openUrl(approvalUri))
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
|
|
@@ -32,6 +36,8 @@ async function index (publicKeyHex, options = {}) {
|
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
throw error
|
|
39
|
+
} finally {
|
|
40
|
+
cleanupOpenKeyListener()
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const keynames = require('../conventions/keynames')
|
|
2
|
+
const readEnvKey = require('../helpers/readEnvKey')
|
|
3
|
+
|
|
4
|
+
class ArmorOpen {
|
|
5
|
+
constructor (hostname, envFile = '.env') {
|
|
6
|
+
this.hostname = hostname
|
|
7
|
+
this.envFile = envFile
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
run () {
|
|
11
|
+
const hostname = this.hostname
|
|
12
|
+
const envFile = this.envFile
|
|
13
|
+
|
|
14
|
+
const { publicKeyName } = keynames(envFile)
|
|
15
|
+
const publicKey = readEnvKey(publicKeyName, envFile, { strict: true })
|
|
16
|
+
const url = `${hostname}/go/arm_${publicKey}`
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
url,
|
|
20
|
+
publicKeyName,
|
|
21
|
+
publicKeyValue: publicKey
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = ArmorOpen
|