@dotenvx/dotenvx 2.18.1 → 2.19.0
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
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
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.0...main)
|
|
6
|
+
|
|
7
|
+
## [2.19.0](https://github.com/dotenvx/dotenvx/compare/v2.18.1...v2.19.0) (2026-07-27)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* Add `dotenvx armor open` to open armored key details in browser ([#930](https://github.com/dotenvx/dotenvx/pull/930))
|
|
6
12
|
|
|
7
13
|
## [2.18.1](https://github.com/dotenvx/dotenvx/compare/v2.18.0...v2.18.1) (2026-07-26)
|
|
8
14
|
|
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')
|
|
@@ -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
|