@dotenvx/dotenvx 1.51.4 → 1.53.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 +13 -1
- package/README.md +80 -38
- package/package.json +1 -1
- package/src/cli/actions/run.js +0 -2
- package/src/lib/helpers/executeDynamic.js +1 -8
- package/src/lib/main.js +7 -3
- package/src/lib/services/radar.js +0 -81
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/v1.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.53.0...main)
|
|
6
|
+
|
|
7
|
+
## [1.53.0](https://github.com/dotenvx/dotenvx/compare/v1.52.0...v1.53.0) (2026-03-05)
|
|
8
|
+
|
|
9
|
+
### Removed
|
|
10
|
+
|
|
11
|
+
* Remove `radar`. It has been a year since replaced by `ops`. ([#743](https://github.com/dotenvx/dotenvx/pull/743))
|
|
12
|
+
|
|
13
|
+
## [1.52.0](https://github.com/dotenvx/dotenvx/compare/v1.51.4...v1.52.0) (2026-01-22)
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
* Pass log level options to `main.set` ([#731](https://github.com/dotenvx/dotenvx/pull/731))
|
|
6
18
|
|
|
7
19
|
## [1.51.4](https://github.com/dotenvx/dotenvx/compare/v1.51.3...v1.51.4) (2025-12-29)
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -2568,6 +2568,17 @@ const dotenvx = require('@dotenvx/dotenvx')
|
|
|
2568
2568
|
dotenvx.set('HELLO', 'World', { path: '.env' })
|
|
2569
2569
|
```
|
|
2570
2570
|
|
|
2571
|
+
</details>
|
|
2572
|
+
<details><summary>`set(KEY, value, {plain:})`</summary><br>
|
|
2573
|
+
|
|
2574
|
+
Programmatically set a plaintext environment variable.
|
|
2575
|
+
|
|
2576
|
+
```js
|
|
2577
|
+
// index.js
|
|
2578
|
+
const dotenvx = require('@dotenvx/dotenvx')
|
|
2579
|
+
dotenvx.set('HELLO', 'World', { plain: true })
|
|
2580
|
+
```
|
|
2581
|
+
|
|
2571
2582
|
</details>
|
|
2572
2583
|
<details><summary>`get(KEY)` - <i>Decryption at Access</i></summary><br>
|
|
2573
2584
|
|
|
@@ -2586,74 +2597,93 @@ This is known as *Decryption at Access* and is written about in [the whitepaper]
|
|
|
2586
2597
|
|
|
2587
2598
|
|
|
2588
2599
|
|
|
2589
|
-
##
|
|
2600
|
+
## AS2 🔐
|
|
2590
2601
|
|
|
2591
|
-
|
|
2602
|
+
<a href="https://dotenvx.com/as2">
|
|
2603
|
+
<img src="https://dotenvx.com/assets/img/as2/9.jpg" alt="dotenvx as2" height="400" align="right">
|
|
2604
|
+
</a>
|
|
2592
2605
|
|
|
2593
|
-
|
|
2606
|
+
*agentic secret storage*.
|
|
2594
2607
|
|
|
2595
|
-
|
|
2608
|
+
> Secrets designed for agents. No logins. No consoles. Pure cryptography.
|
|
2596
2609
|
|
|
2597
|
-
###
|
|
2610
|
+
### Quickstart
|
|
2598
2611
|
|
|
2599
|
-
|
|
2612
|
+
Install [`vestauth`](https://github.com/vestauth/vestauth) and initialize your agent. (AS2 uses [vestauth](https://vestauth.com) to authenticate agents.)
|
|
2600
2613
|
|
|
2601
2614
|
```sh
|
|
2602
|
-
|
|
2615
|
+
npm i -g vestauth
|
|
2616
|
+
vestauth agent init
|
|
2603
2617
|
```
|
|
2604
2618
|
|
|
2605
|
-
|
|
2619
|
+
Your agent can `set` secrets.
|
|
2606
2620
|
|
|
2607
|
-
```
|
|
2608
|
-
|
|
2609
|
-
✔ logged in [username]
|
|
2621
|
+
```
|
|
2622
|
+
vestauth agent curl -X POST https://as2.dotenvx.com/set '{"KEY": "value"}'
|
|
2610
2623
|
```
|
|
2611
2624
|
|
|
2612
|
-
|
|
2625
|
+
Your agent can `get` secrets.
|
|
2613
2626
|
|
|
2614
|
-
```sh
|
|
2615
|
-
$ dotenvx run -- yourcommand
|
|
2616
|
-
[dotenvx@1.0.0] 📡 radar active
|
|
2617
|
-
[dotenvx@1.0.0] injecting env (1) from .env
|
|
2618
2627
|
```
|
|
2628
|
+
vestauth agent curl https://as2.dotenvx.com/get?key=KEY
|
|
2629
|
+
```
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
|
|
2633
|
+
## Ops 🏰
|
|
2634
|
+
|
|
2635
|
+
[](https://dotenvx.com/ops)
|
|
2619
2636
|
|
|
2620
|
-
|
|
2637
|
+
*production grade dotenvx*–with operational primitives.
|
|
2638
|
+
|
|
2639
|
+
> As dotenvx spreads inside companies, we're learning—through enterprise engagements—that dotenvx is missing an operations layer.
|
|
2640
|
+
>
|
|
2641
|
+
> Dotenvx Ops is our answer.
|
|
2642
|
+
>
|
|
2643
|
+
> It's production grade dotenvx–with operational primitives for teams, infrastructure, and agents. Private key management, access controls, and more.
|
|
2621
2644
|
|
|
2622
|
-
###
|
|
2645
|
+
### Quickstart
|
|
2623
2646
|
|
|
2624
|
-
|
|
2647
|
+
Install it and gain `ops` commands.
|
|
2648
|
+
|
|
2649
|
+
```sh
|
|
2650
|
+
$ curl -sfS https://dotenvx.sh/ops | sh
|
|
2651
|
+
$ dotenvx ops backup
|
|
2652
|
+
✔ backed up [username/project]
|
|
2653
|
+
⮕ next run [dotenvx-ops open] to view
|
|
2654
|
+
```
|
|
2625
2655
|
|
|
2626
2656
|
### CLI
|
|
2627
2657
|
|
|
2628
|
-
<details><summary>`
|
|
2658
|
+
<details><summary>`ops backup`</summary><br>
|
|
2629
2659
|
|
|
2630
|
-
|
|
2660
|
+
Back up .env.keys.
|
|
2631
2661
|
|
|
2632
2662
|
```sh
|
|
2633
|
-
$ dotenvx-ops
|
|
2634
|
-
|
|
2635
|
-
⠹ waiting on browser authorization
|
|
2636
|
-
✔ logged in [username] to this device and activated token [dxo_6kjPifI…]
|
|
2663
|
+
$ dotenvx-ops backup
|
|
2664
|
+
✔ backed up [username/project]
|
|
2637
2665
|
```
|
|
2638
2666
|
|
|
2639
2667
|
</details>
|
|
2640
|
-
<details><summary>`
|
|
2668
|
+
<details><summary>`ops login`</summary><br>
|
|
2641
2669
|
|
|
2642
|
-
Log
|
|
2670
|
+
Log in.
|
|
2643
2671
|
|
|
2644
2672
|
```sh
|
|
2645
|
-
$ dotenvx-ops
|
|
2646
|
-
|
|
2673
|
+
$ dotenvx-ops login
|
|
2674
|
+
press Enter to open [https://ops.dotenvx.com/login/device] and enter code [D9C1-03BC]... (Y/n)
|
|
2675
|
+
⠹ waiting on browser authorization
|
|
2676
|
+
✔ logged in [username] to this device and activated token [dxo_6kjPifI…]
|
|
2647
2677
|
```
|
|
2648
2678
|
|
|
2649
2679
|
</details>
|
|
2650
|
-
<details><summary>`
|
|
2680
|
+
<details><summary>`ops logout`</summary><br>
|
|
2651
2681
|
|
|
2652
|
-
|
|
2682
|
+
Log out.
|
|
2653
2683
|
|
|
2654
2684
|
```sh
|
|
2655
|
-
$ dotenvx
|
|
2656
|
-
|
|
2685
|
+
$ dotenvx ops logout
|
|
2686
|
+
✔ logged out [username] from this device and revoked token [dxo_5ZrwRXV…]
|
|
2657
2687
|
```
|
|
2658
2688
|
|
|
2659
2689
|
</details>
|
|
@@ -2668,13 +2698,25 @@ Usage: dotenvx-ops settings [options] [command]
|
|
|
2668
2698
|
⚙️ settings
|
|
2669
2699
|
|
|
2670
2700
|
Options:
|
|
2671
|
-
-h, --help
|
|
2701
|
+
-h, --help display help for command
|
|
2672
2702
|
|
|
2673
2703
|
Commands:
|
|
2674
|
-
username
|
|
2675
|
-
token [options]
|
|
2676
|
-
|
|
2677
|
-
|
|
2704
|
+
username print your username
|
|
2705
|
+
token [options] print your access token (--unmask)
|
|
2706
|
+
device [options] print your device pubkey (--unmask)
|
|
2707
|
+
hostname print hostname
|
|
2708
|
+
path print path to settings file
|
|
2709
|
+
help [command] display help for command
|
|
2710
|
+
```
|
|
2711
|
+
|
|
2712
|
+
</details>
|
|
2713
|
+
<details><summary>`ops status`</summary><br>
|
|
2714
|
+
|
|
2715
|
+
Check current status of [Ops](https://dotenvx.com/ops) - `on` or `off` (logged in or out).
|
|
2716
|
+
|
|
2717
|
+
```sh
|
|
2718
|
+
$ dotenvx ops status
|
|
2719
|
+
on
|
|
2678
2720
|
```
|
|
2679
2721
|
|
|
2680
2722
|
</details>
|
package/package.json
CHANGED
package/src/cli/actions/run.js
CHANGED
|
@@ -3,7 +3,6 @@ const { logger } = require('./../../shared/logger')
|
|
|
3
3
|
|
|
4
4
|
const executeCommand = require('./../../lib/helpers/executeCommand')
|
|
5
5
|
const Run = require('./../../lib/services/run')
|
|
6
|
-
const Radar = require('./../../lib/services/radar')
|
|
7
6
|
const Ops = require('./../../lib/services/ops')
|
|
8
7
|
|
|
9
8
|
const conventions = require('./../../lib/helpers/conventions')
|
|
@@ -55,7 +54,6 @@ async function run () {
|
|
|
55
54
|
} = new Run(envs, options.overload, process.env.DOTENV_KEY, process.env, options.envKeysFile, opsOn).run()
|
|
56
55
|
|
|
57
56
|
if (opsOn) {
|
|
58
|
-
try { new Radar().observe({ beforeEnv, processedEnvs, afterEnv }) } catch {}
|
|
59
57
|
try { new Ops().observe({ beforeEnv, processedEnvs, afterEnv }) } catch {}
|
|
60
58
|
}
|
|
61
59
|
|
|
@@ -22,11 +22,7 @@ function executeDynamic (program, command, rawArgs) {
|
|
|
22
22
|
|
|
23
23
|
const result = childProcess.spawnSync(`dotenvx-${command}`, forwardedArgs, { stdio: 'inherit', env })
|
|
24
24
|
if (result.error) {
|
|
25
|
-
if (command === '
|
|
26
|
-
logger.warn(`[INSTALLATION_NEEDED] install dotenvx-${command} to use [dotenvx ${command}] 📡`)
|
|
27
|
-
logger.warn('[DEPRECATION NOTICE] dotenvx-radar to be sunsetted soon (2026) and its featureset to be rolled into dotenvx-ops')
|
|
28
|
-
logger.help('? see installation instructions [https://dotenvx.com/radar]')
|
|
29
|
-
} else if (command === 'ops') {
|
|
25
|
+
if (command === 'ops') {
|
|
30
26
|
const ops = ` _______________________________________________________________________
|
|
31
27
|
| |
|
|
32
28
|
| dotenvx-ops: production grade dotenvx–with operational primitives |
|
|
@@ -40,9 +36,6 @@ function executeDynamic (program, command, rawArgs) {
|
|
|
40
36
|
| ░▒▓██████▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ |
|
|
41
37
|
| |
|
|
42
38
|
| Learn more at https://dotenvx.com/ops |
|
|
43
|
-
| |
|
|
44
|
-
| --------------------------------------------------------------------- |
|
|
45
|
-
| - thank you for using dotenvx! - @motdotla |
|
|
46
39
|
|_______________________________________________________________________|`
|
|
47
40
|
|
|
48
41
|
console.log(ops)
|
package/src/lib/main.js
CHANGED
|
@@ -12,7 +12,6 @@ const Sets = require('./services/sets')
|
|
|
12
12
|
const Get = require('./services/get')
|
|
13
13
|
const Keypair = require('./services/keypair')
|
|
14
14
|
const Genexample = require('./services/genexample')
|
|
15
|
-
const Radar = require('./services/radar')
|
|
16
15
|
const Ops = require('./services/ops')
|
|
17
16
|
|
|
18
17
|
// helpers
|
|
@@ -67,7 +66,6 @@ const config = function (options = {}) {
|
|
|
67
66
|
} = new Run(envs, overload, DOTENV_KEY, processEnv, envKeysFile, opsOn).run()
|
|
68
67
|
|
|
69
68
|
if (opsOn) {
|
|
70
|
-
try { new Radar().observe({ beforeEnv, processedEnvs, afterEnv }) } catch {}
|
|
71
69
|
try { new Ops().observe({ beforeEnv, processedEnvs, afterEnv }) } catch {}
|
|
72
70
|
}
|
|
73
71
|
|
|
@@ -188,6 +186,12 @@ const set = function (key, value, options = {}) {
|
|
|
188
186
|
encrypt = false
|
|
189
187
|
}
|
|
190
188
|
|
|
189
|
+
if (options) {
|
|
190
|
+
setLogLevel(options)
|
|
191
|
+
setLogName(options)
|
|
192
|
+
setLogVersion(options)
|
|
193
|
+
}
|
|
194
|
+
|
|
191
195
|
const envs = buildEnvs(options)
|
|
192
196
|
const envKeysFilepath = options.envKeysFile
|
|
193
197
|
|
|
@@ -334,7 +338,7 @@ module.exports = {
|
|
|
334
338
|
ls,
|
|
335
339
|
keypair,
|
|
336
340
|
genexample,
|
|
337
|
-
// expose for libs depending on @dotenvx/dotenvx - like dotenvx-
|
|
341
|
+
// expose for libs depending on @dotenvx/dotenvx - like dotenvx-ops
|
|
338
342
|
setLogLevel,
|
|
339
343
|
logger,
|
|
340
344
|
getColor,
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const childProcess = require('child_process')
|
|
3
|
-
|
|
4
|
-
const { logger } = require('./../../shared/logger')
|
|
5
|
-
|
|
6
|
-
class Radar {
|
|
7
|
-
constructor () {
|
|
8
|
-
this.radarLib = null
|
|
9
|
-
|
|
10
|
-
// check npm lib
|
|
11
|
-
try {
|
|
12
|
-
this.radarLib = this._radarNpm()
|
|
13
|
-
logger.warn('[DEPRECATION NOTICE] dotenvx-radar is renamed dotenv-ops. [See https://dotenvx.com/docs/ops]')
|
|
14
|
-
logger.successv(`📡 radar: ${this.radarLib.status}`)
|
|
15
|
-
} catch (e) {
|
|
16
|
-
// check binary cli
|
|
17
|
-
try {
|
|
18
|
-
this.radarLib = this._radarCli()
|
|
19
|
-
logger.warn('[DEPRECATION NOTICE] dotenvx-radar is renamed dotenv-ops. [See https://dotenvx.com/docs/ops]')
|
|
20
|
-
logger.successv(`📡 radar: ${this.radarLib.status}`)
|
|
21
|
-
} catch (_e2) {
|
|
22
|
-
// noop
|
|
23
|
-
}
|
|
24
|
-
// noop
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
observe (payload) {
|
|
29
|
-
if (this.radarLib && this.radarLib.status !== 'off') {
|
|
30
|
-
const encoded = this.encode(payload)
|
|
31
|
-
this.radarLib.observe(encoded)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
encode (payload) {
|
|
36
|
-
return Buffer.from(JSON.stringify(payload)).toString('base64')
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
_radarNpm () {
|
|
40
|
-
const fallbackBin = path.resolve(process.cwd(), 'node_modules/.bin/dotenvx-radar')
|
|
41
|
-
const status = childProcess.execSync(`${fallbackBin} status`, { stdio: ['pipe', 'pipe', 'ignore'] })
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
status: status.toString().trim(),
|
|
45
|
-
observe: (encoded) => {
|
|
46
|
-
try {
|
|
47
|
-
const subprocess = childProcess.spawn(fallbackBin, ['observe', encoded], {
|
|
48
|
-
stdio: 'ignore',
|
|
49
|
-
detached: true
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
subprocess.unref() // let it run independently
|
|
53
|
-
} catch (e) {
|
|
54
|
-
// noop
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_radarCli () {
|
|
61
|
-
const status = childProcess.execSync('dotenvx-radar status', { stdio: ['pipe', 'pipe', 'ignore'] })
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
status: status.toString().trim(),
|
|
65
|
-
observe: (encoded) => {
|
|
66
|
-
try {
|
|
67
|
-
const subprocess = childProcess.spawn('dotenvx-radar', ['observe', encoded], {
|
|
68
|
-
stdio: 'ignore',
|
|
69
|
-
detached: true
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
subprocess.unref() // let it run independently
|
|
73
|
-
} catch (e) {
|
|
74
|
-
// noop
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
module.exports = Radar
|