@dotenvx/dotenvx-ops 0.37.7 → 0.37.8

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.37.7...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.37.8...main)
6
+
7
+ ## [0.37.8](https://github.com/dotenvx/dotenvx-ops/compare/v0.37.7...v0.37.8) (2026-04-08)
8
+
9
+ ### Changed
10
+
11
+ * Improve `keypair` coldstart ([#35](https://github.com/dotenvx/dotenvx-ops/pull/35))
6
12
 
7
13
  ## [0.37.7](https://github.com/dotenvx/dotenvx-ops/compare/v0.37.6...v0.37.7) (2026-04-08)
8
14
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.37.7",
2
+ "version": "0.37.8",
3
3
  "name": "@dotenvx/dotenvx-ops",
4
4
  "description": "Secrets for agents–from the creator of `dotenv` and `dotenvx`",
5
5
  "author": "@motdotla",
@@ -1,17 +1,22 @@
1
1
  const { logger } = require('@dotenvx/dotenvx')
2
2
  const Session = require('./../../db/session')
3
-
4
- const main = require('./../../lib/main')
3
+ const createSpinner = require('../../lib/helpers/createSpinner2')
5
4
 
6
5
  async function keypair (publicKey) {
7
6
  // debug opts
8
7
  const options = this.opts()
8
+ const spinner = await createSpinner({ ...options, text: 'retrieving' })
9
+
9
10
  logger.debug(`options: ${JSON.stringify(options)}`)
11
+ if (publicKey) {
12
+ logger.debug(`publicKey: ${publicKey}`)
13
+ }
10
14
 
11
15
  const sesh = new Session()
12
16
  const hostname = options.hostname || sesh.hostname()
13
17
  const token = options.token
14
18
  try {
19
+ const main = require('./../../lib/main')
15
20
  const kp = await main.keypair(publicKey, { hostname, token })
16
21
  const output = {
17
22
  public_key: kp.publicKey,
@@ -23,16 +28,15 @@ async function keypair (publicKey) {
23
28
  space = 2
24
29
  }
25
30
 
31
+ if (spinner) spinner.stop()
26
32
  console.log(JSON.stringify(output, null, space))
27
33
  } catch (error) {
34
+ if (spinner) spinner.stop()
28
35
  if (error.message) {
29
36
  logger.error(error.message)
30
37
  } else {
31
38
  logger.error(error)
32
39
  }
33
- if (error.help) {
34
- logger.help(error.help)
35
- }
36
40
  if (error.stack) {
37
41
  logger.debug(error.stack)
38
42
  }
@@ -9,8 +9,6 @@ github
9
9
  .description('github')
10
10
  .allowUnknownOption()
11
11
 
12
- // dotenvx-ops rotate github connect
13
- const connectAction = require('./../../actions/rotate/github/connect')
14
12
  github
15
13
  .command('connect')
16
14
  .description('connect passcard')
@@ -20,6 +18,9 @@ github
20
18
  .option('--email <email>')
21
19
  .option('--hostname <url>', 'set hostname', sesh.hostname())
22
20
  .option('--token <token>', 'set token')
23
- .action(connectAction)
21
+ .action(async function (...args) {
22
+ const connectAction = require('./../../actions/rotate/github/connect')
23
+ await connectAction.apply(this, args)
24
+ })
24
25
 
25
26
  module.exports = github
@@ -9,8 +9,6 @@ npm
9
9
  .description('npm')
10
10
  .allowUnknownOption()
11
11
 
12
- // dotenvx-ops rotate npm connect
13
- const connectAction = require('./../../actions/rotate/npm/connect')
14
12
  npm
15
13
  .command('connect')
16
14
  .description('connect passcard')
@@ -20,6 +18,9 @@ npm
20
18
  .option('--email <email>')
21
19
  .option('--hostname <url>', 'set hostname', sesh.hostname())
22
20
  .option('--token <token>', 'set token')
23
- .action(connectAction)
21
+ .action(async function (...args) {
22
+ const connectAction = require('./../../actions/rotate/npm/connect')
23
+ await connectAction.apply(this, args)
24
+ })
24
25
 
25
26
  module.exports = npm
@@ -9,8 +9,6 @@ openai
9
9
  .description('openai')
10
10
  .allowUnknownOption()
11
11
 
12
- // dotenvx-ops rotate openai connect
13
- const connectAction = require('./../../actions/rotate/openai/connect')
14
12
  openai
15
13
  .command('connect')
16
14
  .description('connect passcard')
@@ -20,6 +18,9 @@ openai
20
18
  .option('--email <email>')
21
19
  .option('--hostname <url>', 'set hostname', sesh.hostname())
22
20
  .option('--token <token>', 'set token')
23
- .action(connectAction)
21
+ .action(async function (...args) {
22
+ const connectAction = require('./../../actions/rotate/openai/connect')
23
+ await connectAction.apply(this, args)
24
+ })
24
25
 
25
26
  module.exports = openai
@@ -90,7 +90,12 @@ program
90
90
  .action(setAction)
91
91
 
92
92
  // dotenvx-ops rotate
93
- program.addCommand(require('./commands/rotate'))
93
+ const argv = process.argv.slice(2)
94
+ const firstArg = argv[0]
95
+ const shouldLoadRotateCommand = firstArg === 'rotate' || firstArg === 'help' || firstArg === '--help' || firstArg === '-h'
96
+ if (shouldLoadRotateCommand) {
97
+ program.addCommand(require('./commands/rotate'))
98
+ }
94
99
 
95
100
  // dotenvx-ops login
96
101
  const loginAction = require('./actions/login')
@@ -1,6 +1,7 @@
1
1
  const { http } = require('../../lib/helpers/http')
2
2
  const buildApiError = require('../../lib/helpers/buildApiError')
3
3
  const packageJson = require('../../lib/helpers/packageJson')
4
+ const normalizeToken = require('../../lib/helpers/normalizeToken')
4
5
 
5
6
  class PostKeypair {
6
7
  constructor (hostname, token, devicePublicKey, publicKey) {
@@ -11,7 +12,7 @@ class PostKeypair {
11
12
  }
12
13
 
13
14
  async run () {
14
- const token = this.token
15
+ const token = normalizeToken(this.token)
15
16
  const devicePublicKey = this.devicePublicKey
16
17
  const publicKey = this.publicKey
17
18
  const url = `${this.hostname}/api/keypair`