You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support multiple name/value pairs in type command for batched secret resolution
The type command now accepts multiple --name and --value flags, allowing
fields from the same 1Password item to be resolved in a single op call
(one biometric prompt). SecretResolver groups secret:// references by
provider+vault+item and batches the resolution.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
`aux4 secret ${provider} get --ref "${ref}" --fields "${field}"`,
965
-
{encoding: "utf-8",stdio: ["pipe","pipe","pipe"]}
966
-
).trim();
967
-
968
-
constjson=JSON.parse(output);
969
-
returnjson[field];
970
-
}catch(e){
971
-
if(e.status===127){
972
-
thrownewError(`Secret provider 'aux4/secret-${provider}' is not installed. Install it with: aux4 aux4 pkger install aux4/secret-${provider}`);
976
+
for(const[,group]ofgroups){
977
+
constfields=group.fields.join(",");
978
+
try{
979
+
constoutput=execSync(
980
+
`aux4 secret ${group.provider} get --ref "${group.ref}" --fields "${fields}"`,
981
+
{encoding: "utf-8",stdio: ["pipe","pipe","pipe"]}
982
+
).trim();
983
+
984
+
constjson=JSON.parse(output);
985
+
for(letj=0;j<group.fields.length;j++){
986
+
results[group.indices[j]]=json[group.fields[j]];
987
+
}
988
+
}catch(e){
989
+
if(e.status===127){
990
+
thrownewError(`Secret provider 'aux4/secret-${group.provider}' is not installed. Install it with: aux4 aux4 pkger install aux4/secret-${group.provider}`);
991
+
}
992
+
thrownewError(`Failed to resolve secret: ${e.stderr ? e.stderr.trim() : e.message}`);
973
993
}
974
-
thrownewError(`Failed to resolve secret: ${e.stderr ? e.stderr.trim() : e.message}`);
`aux4 secret ${provider} get --ref "${ref}" --fields "${field}"`,
22
-
{encoding: "utf-8",stdio: ["pipe","pipe","pipe"]}
23
-
).trim();
24
-
25
-
constjson=JSON.parse(output);
26
-
returnjson[field];
27
-
}catch(e){
28
-
if(e.status===127){
29
-
thrownewError(`Secret provider 'aux4/secret-${provider}' is not installed. Install it with: aux4 aux4 pkger install aux4/secret-${provider}`);
37
+
for(const[,group]ofgroups){
38
+
constfields=group.fields.join(",");
39
+
try{
40
+
constoutput=execSync(
41
+
`aux4 secret ${group.provider} get --ref "${group.ref}" --fields "${fields}"`,
42
+
{encoding: "utf-8",stdio: ["pipe","pipe","pipe"]}
43
+
).trim();
44
+
45
+
constjson=JSON.parse(output);
46
+
for(letj=0;j<group.fields.length;j++){
47
+
results[group.indices[j]]=json[group.fields[j]];
48
+
}
49
+
}catch(e){
50
+
if(e.status===127){
51
+
thrownewError(`Secret provider 'aux4/secret-${group.provider}' is not installed. Install it with: aux4 aux4 pkger install aux4/secret-${group.provider}`);
52
+
}
53
+
thrownewError(`Failed to resolve secret: ${e.stderr ? e.stderr.trim() : e.message}`);
30
54
}
31
-
thrownewError(`Failed to resolve secret: ${e.stderr ? e.stderr.trim() : e.message}`);
0 commit comments