@dotenvx/dotenvx-ops 0.37.6 → 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 +13 -1
- package/package.json +4 -1
- package/src/cli/actions/keypair.js +9 -5
- package/src/cli/commands/rotate/github.js +4 -3
- package/src/cli/commands/rotate/npm.js +4 -3
- package/src/cli/commands/rotate/openai.js +4 -3
- package/src/cli/dotenvx-ops.js +6 -1
- package/src/lib/api/postKeypair.js +2 -1
- package/src/lib/helpers/createSpinner2.js +1 -1
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-ops/compare/v0.37.
|
|
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))
|
|
12
|
+
|
|
13
|
+
## [0.37.7](https://github.com/dotenvx/dotenvx-ops/compare/v0.37.6...v0.37.7) (2026-04-08)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Add esbuild ([#34](https://github.com/dotenvx/dotenvx-ops/pull/34))
|
|
6
18
|
|
|
7
19
|
## [0.37.6](https://github.com/dotenvx/dotenvx-ops/compare/v0.37.5...v0.37.6) (2026-04-08)
|
|
8
20
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.37.
|
|
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",
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"dotenvx-ops": "./src/cli/dotenvx-ops.js"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
+
"build": "node esbuild.js",
|
|
36
|
+
"build:minify": "node esbuild.js --minify",
|
|
35
37
|
"standard": "standard",
|
|
36
38
|
"standard:fix": "standard --fix",
|
|
37
39
|
"test": "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
@@ -59,6 +61,7 @@
|
|
|
59
61
|
"devDependencies": {
|
|
60
62
|
"@yao-pkg/pkg": "^6.14.2",
|
|
61
63
|
"capture-console": "^1.0.2",
|
|
64
|
+
"esbuild": "^0.25.8",
|
|
62
65
|
"sinon": "^14.0.1",
|
|
63
66
|
"standard": "^17.1.2",
|
|
64
67
|
"standard-version": "^9.5.0",
|
|
@@ -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(
|
|
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(
|
|
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(
|
|
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
|
package/src/cli/dotenvx-ops.js
CHANGED
|
@@ -90,7 +90,12 @@ program
|
|
|
90
90
|
.action(setAction)
|
|
91
91
|
|
|
92
92
|
// dotenvx-ops rotate
|
|
93
|
-
|
|
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`
|
|
@@ -10,7 +10,7 @@ async function createSpinner2 (options = {}) {
|
|
|
10
10
|
const text = options.text || 'thinking'
|
|
11
11
|
const frames = options.frames || FRAMES
|
|
12
12
|
|
|
13
|
-
const { default: yoctoSpinner } = await import('yocto-spinner
|
|
13
|
+
const { default: yoctoSpinner } = await import('yocto-spinner')
|
|
14
14
|
return yoctoSpinner({
|
|
15
15
|
text,
|
|
16
16
|
spinner: {
|