@dotenvx/dotenvx-ops 0.22.2 → 0.23.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-ops/compare/v0.22.2...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.23.0...main)
6
+
7
+ ## [0.23.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.22.2...v0.23.0) (2025-12-03)
8
+
9
+ ### Added
10
+
11
+ * Add new `rotate` command ([#9](https://github.com/dotenvx/dotenvx-ops/pull/9))
6
12
 
7
13
  ## [0.22.2](https://github.com/dotenvx/dotenvx-ops/compare/v0.22.1...v0.22.2) (2025-12-01)
8
14
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.22.2",
2
+ "version": "0.23.0",
3
3
  "name": "@dotenvx/dotenvx-ops",
4
4
  "description": "Dotenvx Ops – commercial tooling for .env files",
5
5
  "author": "@motdotla",
@@ -49,6 +49,7 @@
49
49
  "eciesjs": "^0.4.7",
50
50
  "execa": "^5.1.1",
51
51
  "open": "^8.4.2",
52
+ "playwright": "^1.57.0",
52
53
  "systeminformation": "^5.22.11",
53
54
  "undici": "^7.11.0"
54
55
  },
@@ -0,0 +1,19 @@
1
+ const { logger } = require('@dotenvx/dotenvx')
2
+ const playwrightConnect = require('./../../../../lib/helpers/playwrightConnect')
3
+
4
+ const TIMEOUT = 1200 // visibility timeout
5
+
6
+ async function login () {
7
+ const options = this.opts()
8
+ logger.debug(`options: ${JSON.stringify(options)}`)
9
+
10
+ const { browser, page } = await playwrightConnect()
11
+
12
+ await page.goto('https://npmjs.com/login', { waitUntil: 'domcontentloaded' })
13
+ await page.waitForTimeout(TIMEOUT)
14
+ await browser.close()
15
+
16
+ process.stdout.write('logged in')
17
+ }
18
+
19
+ module.exports = login
@@ -0,0 +1,40 @@
1
+ const { Command } = require('commander')
2
+
3
+ const npm = new Command('npm')
4
+
5
+ npm
6
+ .description('npmjs.com')
7
+ .allowUnknownOption()
8
+
9
+ // dotenvx-ops rotate npm login
10
+ const loginAction = require('./../../actions/rotate/npm/login')
11
+ npm
12
+ .command('login')
13
+ .description('interactive local login + cookie capture')
14
+ .action(loginAction)
15
+
16
+ //
17
+ // // dotenvx-ops settings token
18
+ // const tokenAction = require('./../actions/settings/token')
19
+ // settings
20
+ // .command('token')
21
+ // .description('print your access token (--unmask)')
22
+ // .option('--unmask', 'unmask access token')
23
+ // .action(tokenAction)
24
+ //
25
+ // // dotenvx-ops settings device
26
+ // const deviceAction = require('./../actions/settings/device')
27
+ // settings
28
+ // .command('device')
29
+ // .description('print your device pubkey (--unmask)')
30
+ // .option('--unmask', 'unmask device pubkey')
31
+ // .action(deviceAction)
32
+ //
33
+ // // dotenvx-ops settings hostname
34
+ // const hostnameAction = require('./../actions/settings/hostname')
35
+ // settings
36
+ // .command('hostname')
37
+ // .description('print hostname')
38
+ // .action(hostnameAction)
39
+ //
40
+ module.exports = npm
@@ -0,0 +1,11 @@
1
+ const { Command } = require('commander')
2
+
3
+ const rotate = new Command('rotate')
4
+
5
+ rotate
6
+ .description('rotate api keys')
7
+ .allowUnknownOption()
8
+
9
+ rotate.addCommand(require('./rotate/npm'))
10
+
11
+ module.exports = rotate
@@ -44,6 +44,18 @@ program.command('observe')
44
44
  observeAction.apply(this, args)
45
45
  })
46
46
 
47
+ // dotenvx-ops sync
48
+ const syncAction = require('./actions/sync')
49
+ program
50
+ .command('sync')
51
+ .description('sync .env file(s)')
52
+ .option('-h, --hostname <url>', 'set hostname', sesh.hostname())
53
+ .option('--force', 'force changes')
54
+ .action(syncAction)
55
+
56
+ // dotenvx-ops rotate
57
+ program.addCommand(require('./commands/rotate'))
58
+
47
59
  // dotenvx-ops get
48
60
  const getAction = require('./actions/get')
49
61
  program
@@ -54,15 +66,6 @@ program
54
66
  .option('--token <token>', 'set token')
55
67
  .action(getAction)
56
68
 
57
- // dotenvx-ops sync
58
- const syncAction = require('./actions/sync')
59
- program
60
- .command('sync')
61
- .description('sync .env file(s)')
62
- .option('-h, --hostname <url>', 'set hostname', sesh.hostname())
63
- .option('--force', 'force changes')
64
- .action(syncAction)
65
-
66
69
  // dotenvx-ops login
67
70
  const loginAction = require('./actions/login')
68
71
  program
@@ -0,0 +1,25 @@
1
+ const { logger } = require('@dotenvx/dotenvx')
2
+ const { chromium } = require('playwright')
3
+
4
+ async function playwrightConnect () {
5
+ const browser = await ensurePlaywrightBrowser()
6
+ const context = await browser.newContext()
7
+ const page = await context.newPage()
8
+
9
+ return { browser, context, page }
10
+ }
11
+
12
+ async function ensurePlaywrightBrowser () {
13
+ try {
14
+ return await chromium.launch({ headless: false })
15
+ } catch (err) {
16
+ if (String(err).includes('Executable doesn\'t exist')) {
17
+ logger.info('Installing chromium...')
18
+ const cp = require('child_process')
19
+ cp.execSync('npx playwright install chromium', { stdio: 'inherit' })
20
+ return await chromium.launch({ headless: false })
21
+ }
22
+ }
23
+ }
24
+
25
+ module.exports = playwrightConnect