@qui-cli/env-1password 1.1.0 → 1.2.1
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 +19 -0
- package/dist/1Password.d.ts +9 -3
- package/dist/1Password.js +12 -9
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.2.1](https://github.com/battis/qui-cli/compare/env-1password/1.2.0...env-1password/1.2.1) (2025-12-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* fix crucial typo in documentation ([5fca554](https://github.com/battis/qui-cli/commit/5fca55433d9c8261122614c7786954bde779d63a))
|
|
11
|
+
|
|
12
|
+
## [1.2.0](https://github.com/battis/qui-cli/compare/env-1password/1.1.0...env-1password/1.2.0) (2025-12-23)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* load 1Password credentials from environment ([d5de5ae](https://github.com/battis/qui-cli/commit/d5de5aeeddc75364cde33621efc60bf3fbb36ad8))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* successfully use `op item get` to look up service account token ([07cdaff](https://github.com/battis/qui-cli/commit/07cdaffda9a4ab39b95ad1f482596a46481f754e))
|
|
23
|
+
|
|
5
24
|
## [1.1.0](https://github.com/battis/qui-cli/compare/env-1password/1.0.5...env-1password/1.1.0) (2025-12-19)
|
|
6
25
|
|
|
7
26
|
|
package/dist/1Password.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Env } from '@qui-cli/env';
|
|
2
2
|
import * as Plugin from '@qui-cli/plugin';
|
|
3
3
|
export type Configuration = Plugin.Configuration & Env.Configuration & {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* 1Password service account token; will use the environment variable
|
|
6
|
+
* OP_TOKEN if present
|
|
7
|
+
*/
|
|
5
8
|
opToken?: string;
|
|
6
9
|
/**
|
|
7
10
|
* Name or ID of the 1Password API Credential item storing the 1Password
|
|
8
|
-
* service account token
|
|
11
|
+
* service account token; will use environment variable OP_ITEM if present
|
|
9
12
|
*/
|
|
10
13
|
opItem?: string;
|
|
11
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* 1Password account to use (if signed into multiple); will use environment
|
|
16
|
+
* variable OP_ACCOUNT if present
|
|
17
|
+
*/
|
|
12
18
|
opAccount?: string;
|
|
13
19
|
/** @deprecated Use {@link opToken} */
|
|
14
20
|
serviceAccountToken?: string;
|
package/dist/1Password.js
CHANGED
|
@@ -20,9 +20,9 @@ export async function configure(proposal = {}) {
|
|
|
20
20
|
const silent = Shell.isSilent();
|
|
21
21
|
const showCommands = Shell.commandsShown();
|
|
22
22
|
Shell.configure({ silent: true, showCommands: false });
|
|
23
|
-
const { stdout, stderr } = Shell.exec(`op item get ${config.opAccount ? `--account "${config.opAccount}" ` : ''}--reveal "${config.opItem}"`);
|
|
23
|
+
const { stdout, stderr } = Shell.exec(`op item get ${config.opAccount ? `--account "${config.opAccount}" ` : ''}--reveal --fields credential "${config.opItem}"`);
|
|
24
24
|
if (stdout.length) {
|
|
25
|
-
config.opToken = stdout;
|
|
25
|
+
config.opToken = stdout.trim();
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
Log.fatal(stderr);
|
|
@@ -56,28 +56,30 @@ export function options() {
|
|
|
56
56
|
text: 'Store 1Password secret references in your environment, rather than the actual secrets.'
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
text: `If 1Password secret references are stored in the environment, a 1Password service account token is required to access the secret values, which will be loaded into ${Colors.value('process.env')}. The service account token can be passed directly as the ${Colors.optionArg('--opToken')} argument (e.g. ${Colors.command(`${Colors.keyword('example')} --opToken "(${Colors.keyword('op')} item get
|
|
59
|
+
text: `If 1Password secret references are stored in the environment, a 1Password service account token is required to access the secret values, which will be loaded into ${Colors.value('process.env')}. The service account token can be passed directly as the ${Colors.optionArg('--opToken')} argument (e.g. ${Colors.command(`${Colors.keyword('example')} --opToken "$(${Colors.keyword('op')} item get myToken)"`)}) or, if the 1Password CLI tool is also installed, by simply passing the name or ID of the API Credential in your 1Password vault that holds the service account token (e.g. ${Colors.command(`${Colors.keyword('example')} --opItem myToken`)}). If you are signed into multiple 1Password account, use the ${Colors.optionArg('--opAccount')} argument to specify the account containing the token.`
|
|
60
60
|
},
|
|
61
61
|
{ text: Colors.url('https://developer.1password.com/docs/cli') }
|
|
62
62
|
],
|
|
63
63
|
opt: {
|
|
64
64
|
opAccount: {
|
|
65
|
-
description: `1Password account to use (if signed into multiple)`,
|
|
65
|
+
description: `1Password account to use (if signed into multiple); will use environment variable ${Colors.varName('OP_ACCOUNT')} if present`,
|
|
66
66
|
hint: 'example.1password.com',
|
|
67
67
|
default: config.opAccount
|
|
68
68
|
},
|
|
69
69
|
opItem: {
|
|
70
|
-
description: `Name or ID of the 1Password API Credential item storing the 1Password service account token`,
|
|
70
|
+
description: `Name or ID of the 1Password API Credential item storing the 1Password service account token; will use environmen variable ${Colors.varName('OP_ITEM')} if present`,
|
|
71
|
+
hint: '1Password unique identifier',
|
|
71
72
|
default: config.opItem
|
|
72
73
|
},
|
|
73
74
|
opToken: {
|
|
74
|
-
description: `1Password service account token`,
|
|
75
|
+
description: `1Password service account token; will use environment variable ${Colors.varName('OP_TOKEN')} if present`,
|
|
76
|
+
hint: 'token value',
|
|
75
77
|
secret: true,
|
|
76
78
|
default: config.opToken || config.serviceAccountToken
|
|
77
79
|
},
|
|
78
80
|
serviceAccountToken: {
|
|
79
|
-
description: `1Password service account token`,
|
|
80
|
-
hint: '
|
|
81
|
+
description: `1Password service account token (deprecated, use ${Colors.optionArg('--opToken')})`,
|
|
82
|
+
hint: 'token value',
|
|
81
83
|
secret: true,
|
|
82
84
|
default: config.serviceAccountToken
|
|
83
85
|
}
|
|
@@ -85,7 +87,8 @@ export function options() {
|
|
|
85
87
|
};
|
|
86
88
|
}
|
|
87
89
|
export async function init({ values }) {
|
|
88
|
-
|
|
90
|
+
const { opAccount = process.env.OP_ACCOUNT, opItem = process.env.OP_ITEM, opToken = process.env.OP_TOKEN } = values;
|
|
91
|
+
await configure({ opAccount, opItem, opToken, ...values });
|
|
89
92
|
parse();
|
|
90
93
|
}
|
|
91
94
|
function isSecretReference(value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qui-cli/env-1password",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "@qui-cli Plugin: Standardized environment configuration",
|
|
5
5
|
"homepage": "https://github.com/battis/qui-cli/tree/main/packages/env-1password#readme",
|
|
6
6
|
"repository": {
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@tsconfig/node20": "^20.1.8",
|
|
26
|
-
"@types/node": "^24.10.
|
|
26
|
+
"@types/node": "^24.10.4",
|
|
27
27
|
"commit-and-tag-version": "^12.6.1",
|
|
28
28
|
"del-cli": "^6.0.0",
|
|
29
29
|
"npm-run-all": "^4.1.5",
|
|
30
30
|
"typescript": "^5.9.3",
|
|
31
|
-
"@qui-cli/env": "5.0.2",
|
|
32
31
|
"@qui-cli/colors": "3.1.1",
|
|
33
|
-
"@qui-cli/plugin": "4.0.0",
|
|
34
32
|
"@qui-cli/log": "4.0.1",
|
|
33
|
+
"@qui-cli/env": "5.0.2",
|
|
34
|
+
"@qui-cli/plugin": "4.0.0",
|
|
35
35
|
"@qui-cli/root": "3.0.4",
|
|
36
36
|
"@qui-cli/shell": "3.0.3"
|
|
37
37
|
},
|