@dotenvx/dotenvx 1.49.1 → 1.50.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,34 @@
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.49.1...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.50.0...main)
6
+
7
+ ## [1.50.0](https://github.com/dotenvx/dotenvx/compare/v1.49.1...v1.50.0) (2025-09-18)
8
+
9
+ ### Added
10
+
11
+ * Add optional `dotenvx ops` command ([#677](https://github.com/dotenvx/dotenvx/pull/677))
12
+ * Ops is a coming rename of Radar. Radar will become a feature inside ops.
13
+ * With `dotenvx ops` use dotenvx across your team, infrastructure, agents, and more.
14
+
15
+ ```
16
+ _______________________________________________________________________
17
+ | |
18
+ | Dotenvx Ops: Commercial Tooling for Dotenvx |
19
+ | |
20
+ | ░▒▓██████▓▒░░▒▓███████▓▒░ ░▒▓███████▓▒░ |
21
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ |
22
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ |
23
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░ ░▒▓██████▓▒░ |
24
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ |
25
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ |
26
+ | ░▒▓██████▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ |
27
+ | |
28
+ | Use dotenvx across your team, infrastructure, agents, and more. |
29
+ | |
30
+ | Learn more at https://dotenvx.com/ops |
31
+ |_______________________________________________________________________|
32
+ ```
6
33
 
7
34
  ## [1.49.1](https://github.com/dotenvx/dotenvx/compare/v1.49.0...v1.49.1) (2025-09-15)
8
35
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.49.1",
2
+ "version": "1.50.0",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a secure dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -4,6 +4,7 @@ const { logger } = require('./../../shared/logger')
4
4
  const executeCommand = require('./../../lib/helpers/executeCommand')
5
5
  const Run = require('./../../lib/services/run')
6
6
  const Radar = require('./../../lib/services/radar')
7
+ const Ops = require('./../../lib/services/ops')
7
8
 
8
9
  const conventions = require('./../../lib/helpers/conventions')
9
10
  const DeprecationNotice = require('./../../lib/helpers/deprecationNotice')
@@ -51,6 +52,7 @@ async function run () {
51
52
  } = new Run(envs, options.overload, process.env.DOTENV_KEY, process.env, options.envKeysFile).run()
52
53
 
53
54
  try { new Radar().observe({ beforeEnv, processedEnvs, afterEnv }) } catch {}
55
+ try { new Ops().observe({ beforeEnv, processedEnvs, afterEnv }) } catch {}
54
56
 
55
57
  for (const processedEnv of processedEnvs) {
56
58
  if (processedEnv.type === 'envVaultFile') {
@@ -44,7 +44,7 @@ program
44
44
  setLogLevel(options)
45
45
  })
46
46
 
47
- // for dynamic loading of dotenvx-radar, etc
47
+ // for dynamic loading of dotenvx-ops, etc
48
48
  program
49
49
  .argument('[command]', 'dynamic command')
50
50
  .argument('[args...]', 'dynamic command arguments')
@@ -201,6 +201,7 @@ program.command('help [command]')
201
201
  program.addHelpText('after', ' ')
202
202
  program.addHelpText('after', 'Advanced: ')
203
203
  program.addHelpText('after', ' radar 📡 radar')
204
+ program.addHelpText('after', ' ops 🏰 ops')
204
205
  program.addHelpText('after', ' ext 🔌 extensions')
205
206
 
206
207
  // dotenvx ext
@@ -23,33 +23,33 @@ function executeDynamic (program, command, rawArgs) {
23
23
  const result = childProcess.spawnSync(`dotenvx-${command}`, forwardedArgs, { stdio: 'inherit', env })
24
24
  if (result.error) {
25
25
  if (command === 'pro') {
26
- const pro = `_______________________________________________________________
27
- | |
28
- | For small and medium businesses |
29
- | |
30
- | | | | | |
31
- | __| | ___ | |_ ___ _ ____ ____ __ _ __ _ __ ___ |
32
- | / _\` |/ _ \\| __/ _ \\ '_ \\ \\ / /\\ \\/ / | '_ \\| '__/ _ \\ |
33
- | | (_| | (_) | || __/ | | \\ V / > < | |_) | | | (_) | |
34
- | \\__,_|\\___/ \\__\\___|_| |_|\\_/ /_/\\_\\ | .__/|_| \\___/ |
35
- | | | |
36
- | |_| |
37
- | ## learn more on dotenvx 🟨 |
38
- | |
39
- | >> https://dotenvx.com/pricing |
40
- | |
41
- | ## subscribe on github to be notified 📣 |
42
- | |
43
- | >> https://github.com/dotenvx/dotenvx/issues/259 |
44
- | |
45
- | ----------------------------------------------------------- |
46
- | - thank you for using dotenvx! - @motdotla |
47
- |_____________________________________________________________|`
48
-
49
- console.log(pro)
50
- console.log('')
51
26
  logger.warn(`[INSTALLATION_NEEDED] install dotenvx-${command} to use [dotenvx ${command}] commands 🏆`)
52
27
  logger.help('? see installation instructions [https://github.com/dotenvx/dotenvx-pro]')
28
+ } else if (command === 'ops') {
29
+ const ops = ` _______________________________________________________________________
30
+ | |
31
+ | Dotenvx Ops: Commercial Tooling for Dotenvx |
32
+ | |
33
+ | ░▒▓██████▓▒░░▒▓███████▓▒░ ░▒▓███████▓▒░ |
34
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ |
35
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ |
36
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░ ░▒▓██████▓▒░ |
37
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ |
38
+ | ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ |
39
+ | ░▒▓██████▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ |
40
+ | |
41
+ | Use dotenvx across your team, infrastructure, agents, and more. |
42
+ | |
43
+ | Learn more at https://dotenvx.com/ops |
44
+ | |
45
+ | --------------------------------------------------------------------- |
46
+ | - thank you for using dotenvx! - @motdotla |
47
+ |_______________________________________________________________________|`
48
+
49
+ console.log(ops)
50
+ console.log('')
51
+ logger.warn(`[INSTALLATION_NEEDED] install dotenvx-${command} to use [dotenvx ${command}] 🏰`)
52
+ logger.help('? see installation instructions [https://dotenvx.com/ops]')
53
53
  } else if (command === 'radar') {
54
54
  const radar = ` _______________________________________________________________________
55
55
  | |
package/src/lib/main.js CHANGED
@@ -13,6 +13,7 @@ const Get = require('./services/get')
13
13
  const Keypair = require('./services/keypair')
14
14
  const Genexample = require('./services/genexample')
15
15
  const Radar = require('./services/radar')
16
+ const Ops = require('./services/ops')
16
17
 
17
18
  // helpers
18
19
  const buildEnvs = require('./helpers/buildEnvs')
@@ -63,6 +64,7 @@ const config = function (options = {}) {
63
64
  } = new Run(envs, overload, DOTENV_KEY, processEnv, envKeysFile).run()
64
65
 
65
66
  try { new Radar().observe({ beforeEnv, processedEnvs, afterEnv }) } catch {}
67
+ try { new Ops().observe({ beforeEnv, processedEnvs, afterEnv }) } catch {}
66
68
 
67
69
  let lastError
68
70
  /** @type {Record<string, string>} */
@@ -0,0 +1,79 @@
1
+ const path = require('path')
2
+ const childProcess = require('child_process')
3
+
4
+ const { logger } = require('./../../shared/logger')
5
+
6
+ class Ops {
7
+ constructor () {
8
+ this.opsLib = null
9
+
10
+ // check npm lib
11
+ try {
12
+ this.opsLib = this._opsNpm()
13
+ logger.successv(`📡 radar: ${this.opsLib.status}`)
14
+ } catch (e) {
15
+ // check binary cli
16
+ try {
17
+ this.opsLib = this._opsCli()
18
+ logger.successv(`📡 radar: ${this.opsLib.status}`)
19
+ } catch (_e2) {
20
+ // noop
21
+ }
22
+ // noop
23
+ }
24
+ }
25
+
26
+ observe (payload) {
27
+ if (this.opsLib && this.opsLib.status !== 'off') {
28
+ const encoded = this.encode(payload)
29
+ this.opsLib.observe(encoded)
30
+ }
31
+ }
32
+
33
+ encode (payload) {
34
+ return Buffer.from(JSON.stringify(payload)).toString('base64')
35
+ }
36
+
37
+ _opsNpm () {
38
+ const fallbackBin = path.resolve(process.cwd(), 'node_modules/.bin/dotenvx-ops')
39
+ const status = childProcess.execSync(`${fallbackBin} status`, { stdio: ['pipe', 'pipe', 'ignore'] })
40
+
41
+ return {
42
+ status: status.toString().trim(),
43
+ observe: (encoded) => {
44
+ try {
45
+ const subprocess = childProcess.spawn(fallbackBin, ['observe', encoded], {
46
+ stdio: 'ignore',
47
+ detached: true
48
+ })
49
+
50
+ subprocess.unref() // let it run independently
51
+ } catch (e) {
52
+ // noop
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+ _opsCli () {
59
+ const status = childProcess.execSync('dotenvx-ops status', { stdio: ['pipe', 'pipe', 'ignore'] })
60
+
61
+ return {
62
+ status: status.toString().trim(),
63
+ observe: (encoded) => {
64
+ try {
65
+ const subprocess = childProcess.spawn('dotenvx-ops', ['observe', encoded], {
66
+ stdio: 'ignore',
67
+ detached: true
68
+ })
69
+
70
+ subprocess.unref() // let it run independently
71
+ } catch (e) {
72
+ // noop
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+
79
+ module.exports = Ops