vercel 59.3.0 → 59.5.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.
Files changed (122) hide show
  1. package/dist/chunks/{add-4L46WVRT.js → add-MH3WV6PV.js} +12 -8
  2. package/dist/chunks/{add-BBWVXE2R.js → add-W3FFMTX4.js} +15 -11
  3. package/dist/chunks/{add-KOD24LEM.js → add-Z5FM6TFI.js} +18 -14
  4. package/dist/chunks/{build-2SX3XIRI.js → build-VYYFBJL7.js} +13 -10
  5. package/dist/chunks/{chunk-F7OXZLY2.js → chunk-26XDDLXM.js} +2 -2
  6. package/dist/chunks/{chunk-RIB4S2IB.js → chunk-3HZLXCVL.js} +1 -1
  7. package/dist/chunks/{chunk-OISTYQGR.js → chunk-47VQ6H2S.js} +1 -1
  8. package/dist/chunks/{chunk-WODLA275.js → chunk-4JTF6RD7.js} +7 -7
  9. package/dist/chunks/{chunk-3KNPVXJ3.js → chunk-4KD5BYHB.js} +1 -1
  10. package/dist/chunks/{chunk-XLKFJPMT.js → chunk-57RHXXXG.js} +1 -1
  11. package/dist/chunks/chunk-5GGUB4EO.js +31 -0
  12. package/dist/chunks/chunk-5LX2JDZP.js +34 -0
  13. package/dist/chunks/chunk-7Q45OKWR.js +149 -0
  14. package/dist/chunks/{chunk-7PEQVFHI.js → chunk-7XX4ZEOV.js} +2 -2
  15. package/dist/chunks/{chunk-JKQWQA2T.js → chunk-AINIBIP4.js} +1 -1
  16. package/dist/chunks/{chunk-SOFC4MLS.js → chunk-AWCID36T.js} +8 -568
  17. package/dist/chunks/{chunk-KAYSW4CJ.js → chunk-AWSLWAOC.js} +1 -1
  18. package/dist/chunks/{chunk-KDYRLN6H.js → chunk-C5HKWXRR.js} +1 -1
  19. package/dist/chunks/{chunk-2MF3ZAVW.js → chunk-CJV7J7B5.js} +6 -6
  20. package/dist/chunks/chunk-CQJRLNTX.js +104 -0
  21. package/dist/chunks/{chunk-QKO2DGWR.js → chunk-CSCSGSQG.js} +4 -4
  22. package/dist/chunks/{chunk-3L2YLLHC.js → chunk-DWIC7MRV.js} +2 -2
  23. package/dist/chunks/{chunk-KDL2L4KL.js → chunk-E6LFKMI2.js} +13613 -14235
  24. package/dist/chunks/{chunk-GFCTRJI5.js → chunk-EZKW5YJ2.js} +1 -1
  25. package/dist/chunks/{chunk-DAA5RXUK.js → chunk-FA3MO56Q.js} +6 -4
  26. package/dist/chunks/{chunk-CURHMEJX.js → chunk-GUWPUX2Y.js} +5 -5
  27. package/dist/chunks/chunk-GY5I4AYD.js +122 -0
  28. package/dist/chunks/chunk-HGRWPPYB.js +18 -0
  29. package/dist/chunks/{chunk-D35JUCTC.js → chunk-JJQP3PYM.js} +7 -5
  30. package/dist/chunks/{chunk-KBUCAAG6.js → chunk-JNU3DTEV.js} +14 -12
  31. package/dist/chunks/{chunk-J5ZEHLFM.js → chunk-L7CEMAJG.js} +14 -3
  32. package/dist/chunks/{chunk-ANIKVXGZ.js → chunk-LLM3ZNXJ.js} +2 -2
  33. package/dist/chunks/{chunk-Z2G6SO5B.js → chunk-M3OSDZPY.js} +6 -4
  34. package/dist/chunks/{chunk-WNS53IOA.js → chunk-MRMNMFMD.js} +2 -2
  35. package/dist/chunks/{chunk-EG5BSAXD.js → chunk-MTWHQEXI.js} +1 -1
  36. package/dist/chunks/{chunk-WC7IINFV.js → chunk-NFU4XJIR.js} +1 -1
  37. package/dist/chunks/{chunk-6GWLC2IP.js → chunk-NSU2BTRS.js} +3 -3
  38. package/dist/chunks/chunk-OHER4DGX.js +451 -0
  39. package/dist/chunks/{chunk-BBSS3XIW.js → chunk-OQ3C5VXZ.js} +1 -1
  40. package/dist/chunks/{chunk-Q6QCRFTC.js → chunk-PBHBX6UL.js} +2 -2
  41. package/dist/chunks/{chunk-M22O6CYY.js → chunk-POOO7W47.js} +1 -1
  42. package/dist/chunks/{chunk-G55RLNFE.js → chunk-PPUWG2UB.js} +12 -8
  43. package/dist/chunks/chunk-Q2DGFCO7.js +579 -0
  44. package/dist/chunks/{chunk-7GE2K2WR.js → chunk-QG4PCM45.js} +334 -169
  45. package/dist/chunks/{chunk-VAFU7DXZ.js → chunk-RKDCNQ4S.js} +1 -91
  46. package/dist/chunks/{chunk-XI6NJLI4.js → chunk-RZ5NP6HN.js} +2 -2
  47. package/dist/chunks/{chunk-GMWRTZVZ.js → chunk-SLPSPYVR.js} +1 -1
  48. package/dist/chunks/{chunk-VTP6WIQA.js → chunk-TAZ5ZAKG.js} +257 -4
  49. package/dist/chunks/{chunk-ZHRZMQGN.js → chunk-TDXNNIZ6.js} +1 -1
  50. package/dist/chunks/{chunk-NN2W7WFC.js → chunk-TIWAL2YU.js} +6 -6
  51. package/dist/chunks/{chunk-P3BFTZXW.js → chunk-UUVMIXT4.js} +5 -5
  52. package/dist/chunks/{chunk-AAMJ4ZU4.js → chunk-V4YLY44R.js} +3 -17
  53. package/dist/chunks/{chunk-O5GNPPTU.js → chunk-VP5Y3SZG.js} +1 -1
  54. package/dist/chunks/{chunk-YPPWGI3F.js → chunk-VWYNSJXI.js} +7 -7
  55. package/dist/chunks/{chunk-7QVJTI5H.js → chunk-XDGOOW3K.js} +1 -1
  56. package/dist/chunks/{chunk-UMA66MKW.js → chunk-XM3LOQIX.js} +1 -1
  57. package/dist/chunks/{chunk-VDJN4WKH.js → chunk-XRWOTCDO.js} +1 -1
  58. package/dist/chunks/{chunk-MWYQ24FO.js → chunk-YIHOS3ZF.js} +2 -2
  59. package/dist/chunks/{chunk-STPH4Y62.js → chunk-YJUO3EKH.js} +1 -1
  60. package/dist/chunks/chunk-ZKUHCL6O.js +249 -0
  61. package/dist/chunks/{clear-2DMDKLWZ.js → clear-TNGRDA7D.js} +12 -8
  62. package/dist/chunks/{compile-vercel-config-7HZ4UN6R.js → compile-vercel-config-ERLXKKWW.js} +8 -5
  63. package/dist/chunks/config-7EDKML5Q.js +122 -0
  64. package/dist/chunks/{config-CVZ25C54.js → config-H22EE765.js} +15 -11
  65. package/dist/chunks/{delete-QNAGJM6C.js → delete-LORYIZHY.js} +10 -7
  66. package/dist/chunks/{delete-4LQKP5DG.js → delete-Q4S5F2AI.js} +12 -8
  67. package/dist/chunks/{disable-2RBFIZUB.js → disable-HKWCBDJC.js} +10 -7
  68. package/dist/chunks/{discard-UCOSPSUU.js → discard-UCCRF2JQ.js} +10 -7
  69. package/dist/chunks/{edit-QSAO74S4.js → edit-6IM6VRBR.js} +12 -8
  70. package/dist/chunks/{edit-JX73BG3V.js → edit-AWL35PYQ.js} +11 -8
  71. package/dist/chunks/{enable-NDSB4T26.js → enable-GN3D3L3V.js} +10 -7
  72. package/dist/chunks/{export-DB6BIYQJ.js → export-HHRVFALV.js} +10 -7
  73. package/dist/chunks/{image-MKB6II6L.js → image-4DCU4VPP.js} +6 -5
  74. package/dist/chunks/{import-builders-FIQ7QTVG.js → import-builders-DVG3HOTF.js} +9 -6
  75. package/dist/chunks/{inspect-REJXLWLL.js → inspect-B3OWUFLH.js} +12 -8
  76. package/dist/chunks/{inspect-XS2TC7TC.js → inspect-TGOJDKIT.js} +15 -11
  77. package/dist/chunks/{inspect-QWTWAYLS.js → inspect-TUW67CFZ.js} +15 -11
  78. package/dist/chunks/{inspect-IYRKEWTM.js → inspect-VLGKNHJW.js} +12 -8
  79. package/dist/chunks/{inspect-NY6QRX5W.js → inspect-VPME6UC7.js} +15 -11
  80. package/dist/chunks/{list-PXKVKXHG.js → list-2DPKDHRV.js} +15 -11
  81. package/dist/chunks/{list-VQHBVY3Q.js → list-K552ITMK.js} +15 -11
  82. package/dist/chunks/{list-CDCITV4K.js → list-TK2JO7BK.js} +12 -8
  83. package/dist/chunks/{login-PE4JK7A2.js → login-HRWEKW5P.js} +15 -11
  84. package/dist/chunks/{ls-DL2POAY2.js → ls-IOXGXEY4.js} +15 -11
  85. package/dist/chunks/{ls-S67TNMEG.js → ls-JSV2WZVF.js} +15 -10
  86. package/dist/chunks/{ls-SKOQOPK4.js → ls-M5TYGFP5.js} +15 -10
  87. package/dist/chunks/{ls-3GRHYFDM.js → ls-O2WYF5UL.js} +18 -13
  88. package/dist/chunks/ls-TM6NTZEB.js +176 -0
  89. package/dist/chunks/{ls-YHS5IEBJ.js → ls-YIF3KLF3.js} +15 -10
  90. package/dist/chunks/{open-DUN3BTDH.js → open-FWAVEWGU.js} +12 -8
  91. package/dist/chunks/{permissions-VLIZYINB.js → permissions-DPFYL47Z.js} +9 -8
  92. package/dist/chunks/{publish-36BIJPLN.js → publish-63CGFKQR.js} +10 -7
  93. package/dist/chunks/{push-5NTQV3EC.js → push-T5ZTBW3P.js} +13 -10
  94. package/dist/chunks/{query-ONR2W7HS.js → query-B6O3EMEV.js} +14 -10
  95. package/dist/chunks/{reorder-YKAT4XG3.js → reorder-ANV4NMKH.js} +10 -7
  96. package/dist/chunks/{reply-DH4ZPEXT.js → reply-C73KGOCG.js} +12 -8
  97. package/dist/chunks/{resolve-446IVH6V.js → resolve-IHSIVPEE.js} +12 -8
  98. package/dist/chunks/{restore-HA6TSOOE.js → restore-GSUNXP2O.js} +10 -7
  99. package/dist/chunks/{rm-BCPJUK2C.js → rm-4O74PS4Q.js} +12 -8
  100. package/dist/chunks/{rm-IKYJI7MP.js → rm-M7IJC2WZ.js} +12 -8
  101. package/dist/chunks/{rm-EG35766L.js → rm-PRINF4OU.js} +15 -11
  102. package/dist/chunks/rm-RV5SQFQA.js +317 -0
  103. package/dist/chunks/{rm-COV73VE4.js → rm-YDTK5ESZ.js} +13 -9
  104. package/dist/chunks/{rule-inspect-FQ2635LY.js → rule-inspect-ZZC53FLP.js} +15 -11
  105. package/dist/chunks/{rules-PBOQISWV.js → rules-SAOSSGFI.js} +10 -9
  106. package/dist/chunks/{schema-LUVFYPWN.js → schema-23ZFAKDU.js} +7 -5
  107. package/dist/chunks/{schema-4CDJVH7T.js → schema-2Q3QRMRO.js} +11 -8
  108. package/dist/chunks/set-L47ZCZBJ.js +243 -0
  109. package/dist/chunks/{tags-HNOL4JXL.js → tags-2TWLM77N.js} +5 -4
  110. package/dist/chunks/{types-AJHILHO5.js → types-G3PEUIJH.js} +11 -7
  111. package/dist/chunks/{update-ZIGVLUYG.js → update-SZH2VBD6.js} +16 -12
  112. package/dist/commands/build/index.js +30 -22
  113. package/dist/commands/deploy/index.js +41 -32
  114. package/dist/commands/dev/index.js +82 -39
  115. package/dist/commands/env/index.js +185 -253
  116. package/dist/commands/link/index.js +25 -20
  117. package/dist/commands/list/index.js +19 -12
  118. package/dist/commands-bulk.js +3672 -1717
  119. package/dist/help.js +1 -1
  120. package/dist/index.js +34 -28
  121. package/dist/version.mjs +1 -1
  122. package/package.json +48 -47
@@ -15,18 +15,20 @@ import {
15
15
  } from "../../chunks/chunk-VGIMO3ZK.js";
16
16
  import {
17
17
  ellipsis
18
- } from "../../chunks/chunk-KDYRLN6H.js";
18
+ } from "../../chunks/chunk-C5HKWXRR.js";
19
19
  import {
20
20
  formatTable
21
- } from "../../chunks/chunk-BBSS3XIW.js";
22
- import "../../chunks/chunk-VDJN4WKH.js";
21
+ } from "../../chunks/chunk-OQ3C5VXZ.js";
22
+ import "../../chunks/chunk-XRWOTCDO.js";
23
23
  import {
24
24
  suggestNextCommands
25
25
  } from "../../chunks/chunk-XBN2O34P.js";
26
26
  import {
27
- formatEnvironment,
27
+ formatEnvironment
28
+ } from "../../chunks/chunk-V4YLY44R.js";
29
+ import {
28
30
  validateLsArgs
29
- } from "../../chunks/chunk-AAMJ4ZU4.js";
31
+ } from "../../chunks/chunk-5LX2JDZP.js";
30
32
  import {
31
33
  validateJsonOutput
32
34
  } from "../../chunks/chunk-KXDWXXJH.js";
@@ -35,19 +37,21 @@ import {
35
37
  } from "../../chunks/chunk-YPQSDAEW.js";
36
38
  import {
37
39
  getCommandAliases
38
- } from "../../chunks/chunk-7GE2K2WR.js";
39
- import "../../chunks/chunk-2MF3ZAVW.js";
40
- import "../../chunks/chunk-WC7IINFV.js";
41
- import "../../chunks/chunk-RIB4S2IB.js";
42
- import "../../chunks/chunk-GFCTRJI5.js";
43
- import "../../chunks/chunk-EG5BSAXD.js";
44
- import "../../chunks/chunk-M22O6CYY.js";
45
- import "../../chunks/chunk-GMWRTZVZ.js";
46
- import "../../chunks/chunk-3KNPVXJ3.js";
47
- import "../../chunks/chunk-3L2YLLHC.js";
48
- import "../../chunks/chunk-UMA66MKW.js";
49
- import "../../chunks/chunk-7QVJTI5H.js";
50
- import "../../chunks/chunk-O5GNPPTU.js";
40
+ } from "../../chunks/chunk-QG4PCM45.js";
41
+ import "../../chunks/chunk-7Q45OKWR.js";
42
+ import "../../chunks/chunk-GY5I4AYD.js";
43
+ import "../../chunks/chunk-CJV7J7B5.js";
44
+ import "../../chunks/chunk-EZKW5YJ2.js";
45
+ import "../../chunks/chunk-NFU4XJIR.js";
46
+ import "../../chunks/chunk-3HZLXCVL.js";
47
+ import "../../chunks/chunk-MTWHQEXI.js";
48
+ import "../../chunks/chunk-POOO7W47.js";
49
+ import "../../chunks/chunk-SLPSPYVR.js";
50
+ import "../../chunks/chunk-4KD5BYHB.js";
51
+ import "../../chunks/chunk-DWIC7MRV.js";
52
+ import "../../chunks/chunk-XM3LOQIX.js";
53
+ import "../../chunks/chunk-XDGOOW3K.js";
54
+ import "../../chunks/chunk-VP5Y3SZG.js";
51
55
  import {
52
56
  require_execa
53
57
  } from "../../chunks/chunk-R6IGDGX3.js";
@@ -58,34 +62,36 @@ import {
58
62
  stamp_default
59
63
  } from "../../chunks/chunk-64IF634X.js";
60
64
  import "../../chunks/chunk-VXYGCOKL.js";
61
- import "../../chunks/chunk-7PEQVFHI.js";
65
+ import "../../chunks/chunk-7XX4ZEOV.js";
62
66
  import {
63
67
  help
64
- } from "../../chunks/chunk-XI6NJLI4.js";
68
+ } from "../../chunks/chunk-RZ5NP6HN.js";
65
69
  import {
66
70
  STANDARD_ENVIRONMENTS,
67
- addSubcommand,
68
- envCommand,
69
- envTargetChoices,
70
71
  formatProject,
71
72
  getEnvRecords,
72
- getEnvTargetPlaceholder,
73
73
  getTeamById,
74
- isValidEnvTarget,
75
- listSubcommand,
76
74
  param,
77
- parseEnvTargetArg,
78
75
  parseTarget,
79
76
  printAlignedLabel,
80
77
  pull,
81
78
  pullEnvRecords,
79
+ require_frameworks,
80
+ resolveProjectContext
81
+ } from "../../chunks/chunk-E6LFKMI2.js";
82
+ import {
83
+ addSubcommand,
84
+ envCommand,
85
+ envTargetChoices,
86
+ getEnvTargetPlaceholder,
87
+ isValidEnvTarget,
88
+ listSubcommand,
89
+ parseEnvTargetArg,
82
90
  pullSubcommand,
83
91
  removeSubcommand,
84
- require_frameworks,
85
- resolveProjectContext,
86
92
  runSubcommand,
87
93
  updateSubcommand
88
- } from "../../chunks/chunk-KDL2L4KL.js";
94
+ } from "../../chunks/chunk-OHER4DGX.js";
89
95
  import {
90
96
  TelemetryClient,
91
97
  require_dist as require_dist2
@@ -100,24 +106,27 @@ import {
100
106
  getPreservedArgsForEnvUpdate,
101
107
  outputActionRequired,
102
108
  outputAgentError
103
- } from "../../chunks/chunk-J5ZEHLFM.js";
109
+ } from "../../chunks/chunk-L7CEMAJG.js";
104
110
  import {
105
111
  require_ms
106
112
  } from "../../chunks/chunk-GGP5R3FU.js";
107
113
  import {
108
114
  printError
109
- } from "../../chunks/chunk-VAFU7DXZ.js";
115
+ } from "../../chunks/chunk-CQJRLNTX.js";
110
116
  import {
111
117
  parseArguments
112
- } from "../../chunks/chunk-XLKFJPMT.js";
118
+ } from "../../chunks/chunk-57RHXXXG.js";
119
+ import "../../chunks/chunk-RKDCNQ4S.js";
120
+ import {
121
+ isAPIError
122
+ } from "../../chunks/chunk-AWCID36T.js";
113
123
  import {
114
124
  getCommandName,
115
125
  getCommandNamePlain,
116
126
  getFlagsSpecification,
117
127
  getGlobalFlagsFromArgs,
118
- isAPIError,
119
128
  require_lib
120
- } from "../../chunks/chunk-SOFC4MLS.js";
129
+ } from "../../chunks/chunk-Q2DGFCO7.js";
121
130
  import "../../chunks/chunk-P4QNYOFB.js";
122
131
  import "../../chunks/chunk-52QYYTM5.js";
123
132
  import {
@@ -460,13 +469,6 @@ var EnvAddTelemetryClient = class extends TelemetryClient {
460
469
  import { determineAgent } from "@vercel/detect-agent";
461
470
 
462
471
  // src/util/env/env-var-config-secret-ui.ts
463
- function isEnvVarConfigSecretUiEnabled() {
464
- const raw = process.env.VERCEL_ENV_VAR_CONFIG_SECRET_UI;
465
- return raw === "1" || raw?.toLowerCase() === "true" || raw?.toLowerCase() === "on";
466
- }
467
- function shouldEnforceSensitiveEnvVarPolicy(policyOn) {
468
- return policyOn && !isEnvVarConfigSecretUiEnabled();
469
- }
470
472
  function formatVisibilityLabel(visibility, type) {
471
473
  const resolved = visibility ?? visibilityFromEnvType(type);
472
474
  if (resolved === "config") {
@@ -504,23 +506,6 @@ function getPublicPrefixSecretVisibilityError(key, options) {
504
506
  }
505
507
  return `Environment variables with a public framework prefix (${prefixLabel}) cannot use secret visibility. Rename to remove the public prefix or use \`--visibility config\` with \`--no-sensitive\`.`;
506
508
  }
507
- function getDevelopmentSecretVisibilityError(envTargets, options) {
508
- if (options.configSecretUiEnabled) {
509
- return null;
510
- }
511
- if (!envTargets.includes("development")) {
512
- return null;
513
- }
514
- const wouldBeSecret = options.type === "sensitive" || options.visibility === "secret";
515
- if (!wouldBeSecret) {
516
- return null;
517
- }
518
- const hasNonDevelopment = envTargets.some((target) => target !== "development");
519
- if (hasNonDevelopment) {
520
- return `Sensitive Environment Variables are not supported on the Development Environment. Add --no-sensitive to store a non-sensitive value for all selected Environments, or run \`vercel env add\` separately for Development.`;
521
- }
522
- return `--sensitive is not allowed with the Development Environment. Sensitive Environment Variables are only supported on Production and Preview.`;
523
- }
524
509
  function shouldOmitInferredVisibility(key, envTargets, teamSensitivePolicyOn) {
525
510
  if (!getPublicPrefix(key)) {
526
511
  return false;
@@ -531,9 +516,6 @@ function shouldOmitInferredVisibility(key, envTargets, teamSensitivePolicyOn) {
531
516
  return teamSensitivePolicyOn;
532
517
  }
533
518
  function resolveEnvVarVisibility(options) {
534
- if (!options.configSecretUiEnabled) {
535
- return {};
536
- }
537
519
  if (options.explicitVisibility !== void 0) {
538
520
  if (options.explicitVisibility !== "config" && options.explicitVisibility !== "secret") {
539
521
  return {
@@ -551,34 +533,12 @@ function resolveEnvVarVisibility(options) {
551
533
  if (publicPrefixError2) {
552
534
  return { error: publicPrefixError2 };
553
535
  }
554
- const developmentError2 = getDevelopmentSecretVisibilityError(
555
- options.envTargets,
556
- {
557
- type: options.type,
558
- visibility: options.explicitVisibility,
559
- configSecretUiEnabled: options.configSecretUiEnabled
560
- }
561
- );
562
- if (developmentError2) {
563
- return { error: developmentError2 };
564
- }
565
536
  return { visibility: options.explicitVisibility };
566
537
  }
567
538
  const inferred = visibilityFromEnvType(options.type);
568
539
  if (inferred === void 0) {
569
540
  return {};
570
541
  }
571
- const developmentError = getDevelopmentSecretVisibilityError(
572
- options.envTargets,
573
- {
574
- type: options.type,
575
- visibility: inferred,
576
- configSecretUiEnabled: options.configSecretUiEnabled
577
- }
578
- );
579
- if (developmentError) {
580
- return { error: developmentError };
581
- }
582
542
  if (shouldOmitInferredVisibility(
583
543
  options.key,
584
544
  options.envTargets,
@@ -603,22 +563,13 @@ var SENSITIVE_SECRET_PROMPT = `Store as sensitive? ${import_chalk.default.dim(
603
563
  SENSITIVE_VALUE_HINT
604
564
  )}`;
605
565
  function filterEnvChoicesForSensitivity(choices, opts) {
606
- if (opts.isSensitive && !opts.configSecretUiEnabled) {
607
- return choices.filter((c) => c.value !== "development");
608
- }
609
566
  if (opts.policyOn) {
610
567
  return choices.filter((c) => c.value === "development");
611
568
  }
612
569
  return choices;
613
570
  }
614
- function getTargetCompatibilityError(envTargets, isSensitive, policyOn, configSecretUiEnabled) {
615
- const hasDevelopment = envTargets.includes("development");
571
+ function getTargetCompatibilityError(envTargets, isSensitive, policyOn) {
616
572
  const hasSensitiveCapable = envTargets.some((t) => t !== "development");
617
- if (isSensitive && hasDevelopment && !configSecretUiEnabled) {
618
- return `Sensitive Environment Variables are not supported on the Development Environment. Add --no-sensitive to store a non-sensitive value for all selected Environments, or run ${getCommandName(
619
- "env add"
620
- )} separately for Development.`;
621
- }
622
573
  if (!isSensitive && policyOn && hasSensitiveCapable) {
623
574
  return `Your team requires sensitive Environment Variables for Production and Preview. To add a non-sensitive value, target the Development Environment only. Run ${getCommandName(
624
575
  "env add"
@@ -628,7 +579,7 @@ function getTargetCompatibilityError(envTargets, isSensitive, policyOn, configSe
628
579
  }
629
580
  function resolveFinalType(envTargets, isSensitive, opts) {
630
581
  const hasDevelopment = envTargets.includes("development");
631
- if (hasDevelopment && !(opts.configSecretUiEnabled && isSensitive)) {
582
+ if (hasDevelopment && !isSensitive) {
632
583
  return "encrypted";
633
584
  }
634
585
  if (opts.forceEncrypted && !opts.policyOn) {
@@ -641,8 +592,7 @@ function resolveFinalType(envTargets, isSensitive, opts) {
641
592
  }
642
593
  function fillEnvAddTemplate(template, opts) {
643
594
  const targetPlaceholder = getEnvTargetPlaceholder();
644
- const out = template.replace(/<name>/g, opts.envName ?? "<name>").split(targetPlaceholder).join(opts.envTargetArg ?? targetPlaceholder);
645
- return out.replace(/<value>/g, "<value>");
595
+ return template.replace(/<name>/g, opts.envName ?? "<name>").split(targetPlaceholder).join(opts.envTargetArg ?? targetPlaceholder).replace(/<git-branch>/g, opts.envGitBranch ?? "<git-branch>").replace(/<gitbranch>/g, opts.envGitBranch ?? "<gitbranch>").replace(/<value>/g, "<value>");
646
596
  }
647
597
  function redactEnvValueArgs(argv) {
648
598
  const redacted = [...argv];
@@ -666,9 +616,8 @@ function multiTargetSuggestion(argv, envName, targets, addNoSensitive) {
666
616
  when: addNoSensitive ? "Add one non-sensitive variable to all listed environments" : "Add one variable to multiple environments"
667
617
  };
668
618
  }
669
- function filterSensitiveMultiTargetSuggestionTargets(targets, opts) {
670
- const excludeDevelopment = opts.forceSensitive || opts.policyOn;
671
- return excludeDevelopment ? targets.filter((target) => target !== "development") : targets;
619
+ function filterSensitiveMultiTargetSuggestionTargets(targets, _opts) {
620
+ return targets;
672
621
  }
673
622
  function projectLabel(link) {
674
623
  return `${link.org.slug}/${link.project.name}`;
@@ -703,11 +652,9 @@ function printEnvAddResult(link, envName, envTargets, envGitBranch, customEnviro
703
652
  printAlignedLabel("Branch", envGitBranch);
704
653
  }
705
654
  printAlignedLabel("Type", typeLabel(finalType));
706
- if (isEnvVarConfigSecretUiEnabled()) {
707
- const visibilityLabel = formatVisibilityLabel(visibility, finalType);
708
- if (visibilityLabel) {
709
- printAlignedLabel("Visibility", visibilityLabel);
710
- }
655
+ const visibilityLabel = formatVisibilityLabel(visibility, finalType);
656
+ if (visibilityLabel) {
657
+ printAlignedLabel("Visibility", visibilityLabel);
711
658
  }
712
659
  }
713
660
  function printEnvAddWarning(message) {
@@ -741,7 +688,6 @@ async function add(client, argv) {
741
688
  return 1;
742
689
  }
743
690
  const { args, flags: opts } = parsedArgs;
744
- const configSecretUiEnabled = isEnvVarConfigSecretUiEnabled();
745
691
  const stdInput = await readStandardInput(client.stdin);
746
692
  const valueFromFlag = typeof opts["--value"] === "string" ? opts["--value"] : void 0;
747
693
  let [envName, envTargetArg] = args;
@@ -771,14 +717,14 @@ async function add(client, argv) {
771
717
  telemetryClient.trackCliOptionProject(opts["--project"]);
772
718
  if (positionalGitBranch && optionGitBranch) {
773
719
  output_manager_default.error(
774
- "Git branch was provided twice. Use either `--git-branch <name>` or the legacy third argument."
720
+ "Git branch was provided twice. Use either `--git-branch <git-branch>` or the legacy third argument."
775
721
  );
776
722
  return 1;
777
723
  }
778
724
  if (args.length > 3) {
779
725
  output_manager_default.error(
780
726
  `Invalid number of arguments. Usage: ${getCommandName(
781
- `env add <name> ${getEnvTargetPlaceholder()} --git-branch <name>`
727
+ `env add <name> ${getEnvTargetPlaceholder()} --git-branch <git-branch>`
782
728
  )}`
783
729
  );
784
730
  return 1;
@@ -786,7 +732,7 @@ async function add(client, argv) {
786
732
  if (stdInput && (!envName || !envTargetArg)) {
787
733
  output_manager_default.error(
788
734
  `Invalid number of arguments. Usage: ${getCommandName(
789
- `env add <name> <target> --git-branch <name> < <file>`
735
+ `env add <name> <target> --git-branch <git-branch> < <file>`
790
736
  )}`
791
737
  );
792
738
  return 1;
@@ -818,7 +764,25 @@ async function add(client, argv) {
818
764
  "<scope>",
819
765
  ...linkPreserved
820
766
  ];
821
- const envAddRetryArgv = redactEnvValueArgs(client.argv);
767
+ let envAddRetryArgv = redactEnvValueArgs(client.argv);
768
+ if (envTargetArg === "preview" && envGitBranch === void 0) {
769
+ const argvArgs = client.argv.slice(2);
770
+ const addIdx = argvArgs.indexOf("add");
771
+ if (addIdx !== -1) {
772
+ let pos = addIdx + 1;
773
+ let positionals = 0;
774
+ while (pos < argvArgs.length && positionals < 3 && !argvArgs[pos].startsWith("-")) {
775
+ positionals++;
776
+ pos++;
777
+ }
778
+ const insertAt = 2 + pos;
779
+ envAddRetryArgv = redactEnvValueArgs([
780
+ ...client.argv.slice(0, insertAt),
781
+ "<gitbranch>",
782
+ ...client.argv.slice(insertAt)
783
+ ]);
784
+ }
785
+ }
822
786
  outputAgentError(
823
787
  client,
824
788
  {
@@ -875,6 +839,9 @@ async function add(client, argv) {
875
839
  missing.push("missing_value");
876
840
  if (!envTargetArg && choices2.length > 0)
877
841
  missing.push("missing_environment");
842
+ if (envTargetArg === "preview" && envGitBranch === void 0 && !(client.nonInteractive && args.length === 2)) {
843
+ missing.push("git_branch_required");
844
+ }
878
845
  if (missing.length > 0) {
879
846
  const parts = missing.map((m) => {
880
847
  if (m === "missing_name")
@@ -883,20 +850,52 @@ async function add(client, argv) {
883
850
  return "--value or stdin";
884
851
  if (m === "missing_environment")
885
852
  return "environment (production, preview, development, or a comma-separated list)";
853
+ if (m === "git_branch_required")
854
+ return "`--git-branch <git-branch>` for Preview, or omit for all Preview branches";
886
855
  return m;
887
856
  });
888
857
  const fullTemplate = `env add <name> ${getEnvTargetPlaceholder()} --value "<value>" --yes`;
889
858
  const filledTemplate = fillEnvAddTemplate(fullTemplate, {
890
859
  envName,
891
- envTargetArg
860
+ envTargetArg,
861
+ envGitBranch
892
862
  });
893
863
  const next = [];
894
- next.push({
895
- command: buildEnvAddCommandWithPreservedArgs(
896
- client.argv,
897
- filledTemplate
898
- )
899
- });
864
+ const onlyGitBranchMissing = missing.length === 1 && missing[0] === "git_branch_required";
865
+ if (!onlyGitBranchMissing) {
866
+ next.push({
867
+ command: buildEnvAddCommandWithPreservedArgs(
868
+ client.argv,
869
+ filledTemplate
870
+ )
871
+ });
872
+ }
873
+ if (missing.includes("git_branch_required") && envName && (valueFromFlag !== void 0 || stdInput)) {
874
+ const branchSpecific = fillEnvAddTemplate(
875
+ 'env add <name> preview --git-branch <git-branch> --value "<value>" --yes',
876
+ { envName, envTargetArg: "preview" }
877
+ );
878
+ const branchAll = fillEnvAddTemplate(
879
+ 'env add <name> preview --value "<value>" --yes',
880
+ { envName, envTargetArg: "preview" }
881
+ );
882
+ next.push(
883
+ {
884
+ command: buildEnvAddCommandWithPreservedArgs(
885
+ client.argv,
886
+ branchSpecific
887
+ ),
888
+ when: "Add to a specific Git branch"
889
+ },
890
+ {
891
+ command: buildEnvAddCommandWithPreservedArgs(
892
+ client.argv,
893
+ branchAll
894
+ ),
895
+ when: "Add to all Preview branches"
896
+ }
897
+ );
898
+ }
900
899
  if (missing.includes("missing_environment")) {
901
900
  const standardAvailable = choices2.map((c) => c.value).filter((v) => isValidEnvTarget(v));
902
901
  const multiTargets = filterSensitiveMultiTargetSuggestionTargets(
@@ -1032,7 +1031,25 @@ async function add(client, argv) {
1032
1031
  ...link.status === "not_linked" ? ["--scope", "<scope>"] : [],
1033
1032
  ...linkPreserved
1034
1033
  ];
1035
- const envAddRetryArgv = redactEnvValueArgs(client.argv);
1034
+ let envAddRetryArgv = redactEnvValueArgs(client.argv);
1035
+ if (envTargetArg === "preview" && envGitBranch === void 0) {
1036
+ const argvArgs = client.argv.slice(2);
1037
+ const addIdx = argvArgs.indexOf("add");
1038
+ if (addIdx !== -1) {
1039
+ let pos = addIdx + 1;
1040
+ let positionals = 0;
1041
+ while (pos < argvArgs.length && positionals < 3 && !argvArgs[pos].startsWith("-")) {
1042
+ positionals++;
1043
+ pos++;
1044
+ }
1045
+ const insertAt = 2 + pos;
1046
+ envAddRetryArgv = redactEnvValueArgs([
1047
+ ...client.argv.slice(0, insertAt),
1048
+ "<gitbranch>",
1049
+ ...client.argv.slice(insertAt)
1050
+ ]);
1051
+ }
1052
+ }
1036
1053
  outputAgentError(
1037
1054
  client,
1038
1055
  {
@@ -1167,13 +1184,12 @@ async function add(client, argv) {
1167
1184
  );
1168
1185
  return 1;
1169
1186
  }
1170
- let policyOn = false;
1187
+ const policyOn = false;
1171
1188
  let teamSensitivePolicyOn = false;
1172
1189
  if (link.org.type === "team") {
1173
1190
  try {
1174
1191
  const team = await getTeamById(client, link.org.id);
1175
1192
  teamSensitivePolicyOn = team?.sensitiveEnvironmentVariablePolicy === "on";
1176
- policyOn = shouldEnforceSensitiveEnvVarPolicy(teamSensitivePolicyOn);
1177
1193
  } catch {
1178
1194
  }
1179
1195
  }
@@ -1191,93 +1207,31 @@ async function add(client, argv) {
1191
1207
  isSensitive = true;
1192
1208
  } else {
1193
1209
  isSensitive = await client.input.confirm(SENSITIVE_SECRET_PROMPT, true);
1194
- if (policyOn && !isSensitive) {
1195
- output_manager_default.print(
1196
- ` ${import_chalk.default.dim(
1197
- "Team policy limits non-sensitive values to Development."
1198
- )}
1199
- `
1200
- );
1201
- }
1202
- }
1203
- if (!client.nonInteractive && skipSensitivePrompt && policyOn && !isSensitive && envTargets.length === 0) {
1204
- output_manager_default.print(
1205
- ` ${import_chalk.default.dim(
1206
- "Team policy limits non-sensitive values to Development."
1207
- )}
1208
- `
1209
- );
1210
- }
1211
- if (forceSensitive && envTargets.includes("development") && !configSecretUiEnabled) {
1212
- const msg = `--sensitive is not allowed with the Development Environment. Sensitive Environment Variables are only supported on Production and Preview.`;
1213
- if (client.nonInteractive) {
1214
- const nonDev = envTargets.filter((t) => t !== "development");
1215
- outputAgentError(
1216
- client,
1217
- {
1218
- status: "error",
1219
- reason: "sensitive_not_allowed_on_development",
1220
- message: msg,
1221
- ...nonDev.length > 0 ? {
1222
- next: [
1223
- {
1224
- command: buildEnvAddCommandWithPreservedArgs(
1225
- client.argv,
1226
- `env add ${envName} ${nonDev.join(",")} --value "<value>" --yes`
1227
- ),
1228
- when: "Keep sensitive and skip Development"
1229
- }
1230
- ]
1231
- } : {}
1232
- },
1233
- 1
1234
- );
1235
- }
1236
- output_manager_default.error(msg);
1237
- return 1;
1238
1210
  }
1239
1211
  if (envTargets.length > 0) {
1240
1212
  const compatibilityError = getTargetCompatibilityError(
1241
1213
  envTargets,
1242
1214
  isSensitive,
1243
- policyOn,
1244
- configSecretUiEnabled
1215
+ policyOn
1245
1216
  );
1246
1217
  if (compatibilityError) {
1247
1218
  if (client.nonInteractive) {
1248
- const next = [];
1249
- if (isSensitive) {
1250
- if (!policyOn) {
1251
- next.push(
1252
- multiTargetSuggestion(client.argv, envName, envTargets, true)
1253
- );
1254
- }
1255
- const nonDev = envTargets.filter((t) => t !== "development");
1256
- if (nonDev.length > 0) {
1257
- next.push({
1258
- command: buildEnvAddCommandWithPreservedArgs(
1259
- client.argv,
1260
- `env add ${envName} ${nonDev.join(",")} --value "<value>" --yes`
1261
- ),
1262
- when: "Keep sensitive and skip Development"
1263
- });
1264
- }
1265
- } else {
1266
- next.push({
1219
+ const next = [
1220
+ {
1267
1221
  command: buildEnvAddCommandWithPreservedArgs(
1268
1222
  client.argv,
1269
1223
  `env add ${envName} development --value "<value>" --yes`
1270
1224
  ),
1271
1225
  when: "Add as non-sensitive to Development only"
1272
- });
1273
- }
1226
+ }
1227
+ ];
1274
1228
  outputAgentError(
1275
1229
  client,
1276
1230
  {
1277
1231
  status: "error",
1278
- reason: isSensitive ? "sensitive_not_allowed_on_development" : "non_sensitive_not_allowed_on_production_preview",
1232
+ reason: "non_sensitive_not_allowed_on_production_preview",
1279
1233
  message: compatibilityError,
1280
- ...next.length > 0 ? { next } : {}
1234
+ next
1281
1235
  },
1282
1236
  1
1283
1237
  );
@@ -1288,8 +1242,7 @@ async function add(client, argv) {
1288
1242
  }
1289
1243
  const envChoices = filterEnvChoicesForSensitivity(choices, {
1290
1244
  isSensitive,
1291
- policyOn,
1292
- configSecretUiEnabled
1245
+ policyOn
1293
1246
  });
1294
1247
  if (policyOn && isSensitive) {
1295
1248
  for (const choice of envChoices) {
@@ -1302,7 +1255,7 @@ async function add(client, argv) {
1302
1255
  }
1303
1256
  if (!envGitBranch && envChoices.length === 0 && envTargets.length === 0 && !opts["--force"]) {
1304
1257
  output_manager_default.error(
1305
- `No Environments are available for this variable with the selected sensitivity. ${isSensitive ? "Sensitive Environment Variables cannot be added to Development." : "Your team requires sensitive Environment Variables for Production and Preview."}`
1258
+ `No Environments are available for this variable with the selected sensitivity. Your team requires sensitive Environment Variables for Production and Preview.`
1306
1259
  );
1307
1260
  return 1;
1308
1261
  }
@@ -1397,28 +1350,54 @@ async function add(client, argv) {
1397
1350
  const postSelectionError = getTargetCompatibilityError(
1398
1351
  envTargets,
1399
1352
  isSensitive,
1400
- policyOn,
1401
- configSecretUiEnabled
1353
+ policyOn
1402
1354
  );
1403
1355
  if (postSelectionError) {
1404
1356
  output_manager_default.error(postSelectionError);
1405
1357
  return 1;
1406
1358
  }
1407
- if (envGitBranch === void 0 && envTargets.length === 1 && envTargets[0] === "preview" && !client.nonInteractive && !opts["--yes"]) {
1408
- output_manager_default.print(
1409
- ` ${import_chalk.default.dim("Leave empty to apply to all Preview branches.")}
1359
+ if (envGitBranch === void 0 && envTargets.length === 1 && envTargets[0] === "preview" && !opts["--yes"] && !(client.nonInteractive && args.length === 2)) {
1360
+ if (client.nonInteractive) {
1361
+ outputActionRequired(
1362
+ client,
1363
+ {
1364
+ status: "action_required",
1365
+ reason: "git_branch_required",
1366
+ message: `Add ${envName} to which Git branch for Preview? Pass branch as third argument, or omit for all Preview branches.`,
1367
+ next: [
1368
+ {
1369
+ command: buildEnvAddCommandWithPreservedArgs(
1370
+ client.argv,
1371
+ `env add ${envName} preview --git-branch <git-branch> --value "<value>" --yes`
1372
+ ),
1373
+ when: "Add to a specific Git branch"
1374
+ },
1375
+ {
1376
+ command: buildEnvAddCommandWithPreservedArgs(
1377
+ client.argv,
1378
+ `env add ${envName} preview --value "<value>" --yes`
1379
+ ),
1380
+ when: "Add to all Preview branches"
1381
+ }
1382
+ ]
1383
+ },
1384
+ 1
1385
+ );
1386
+ } else {
1387
+ output_manager_default.print(
1388
+ ` ${import_chalk.default.dim("Leave empty to apply to all Preview branches.")}
1410
1389
  `
1411
- );
1412
- envGitBranch = await client.input.text({
1413
- message: `Git branch?`
1414
- });
1390
+ );
1391
+ envGitBranch = await client.input.text({
1392
+ message: `Git branch?`
1393
+ });
1394
+ }
1415
1395
  }
1416
1396
  const hasDevelopment = envTargets.includes("development");
1417
1397
  let finalType = resolveFinalType(envTargets, isSensitive, {
1418
1398
  forceSensitive,
1419
1399
  forceEncrypted,
1420
- policyOn,
1421
- configSecretUiEnabled
1400
+ policyOn
1422
1401
  });
1423
1402
  if (policyOn && !hasDevelopment) {
1424
1403
  if (forceEncrypted) {
@@ -1430,7 +1409,6 @@ async function add(client, argv) {
1430
1409
  }
1431
1410
  const upsert = opts["--force"] ? "true" : "";
1432
1411
  const { visibility, error: visibilityError } = resolveEnvVarVisibility({
1433
- configSecretUiEnabled,
1434
1412
  explicitVisibility,
1435
1413
  type: finalType,
1436
1414
  key: envName,
@@ -2184,13 +2162,6 @@ var EnvUpdateTelemetryClient = class extends TelemetryClient {
2184
2162
  };
2185
2163
 
2186
2164
  // src/commands/env/update.ts
2187
- function selectedEnvTargetsDevelopment(env) {
2188
- if (typeof env.target === "string")
2189
- return env.target === "development";
2190
- if (Array.isArray(env.target))
2191
- return env.target.includes("development");
2192
- return false;
2193
- }
2194
2165
  async function update(client, argv) {
2195
2166
  let parsedArgs;
2196
2167
  const flagsSpecification = getFlagsSpecification(updateSubcommand.options);
@@ -2489,50 +2460,14 @@ async function update(client, argv) {
2489
2460
  });
2490
2461
  selectedEnv = matchingEnvs[selectedIndex];
2491
2462
  }
2492
- const configSecretUiEnabled = isEnvVarConfigSecretUiEnabled();
2493
- let policyOn = false;
2494
2463
  let teamSensitivePolicyOn = false;
2495
2464
  if (link.org.type === "team") {
2496
2465
  try {
2497
2466
  const team = await getTeamById(client, link.org.id);
2498
2467
  teamSensitivePolicyOn = team?.sensitiveEnvironmentVariablePolicy === "on";
2499
- policyOn = shouldEnforceSensitiveEnvVarPolicy(teamSensitivePolicyOn);
2500
2468
  } catch {
2501
2469
  }
2502
2470
  }
2503
- const selectedIsDevelopment = selectedEnvTargetsDevelopment(selectedEnv);
2504
- if (policyOn && selectedIsDevelopment && !configSecretUiEnabled) {
2505
- const msg = `Your team has enabled the Sensitive Environment Variables Policy and the Development Environment does not support sensitive values. https://vercel.com/docs/environment-variables/sensitive-environment-variables#environment-variables-policy`;
2506
- if (client.nonInteractive) {
2507
- outputAgentError(
2508
- client,
2509
- {
2510
- status: "error",
2511
- reason: "development_disallowed_by_team_policy",
2512
- message: msg
2513
- },
2514
- 1
2515
- );
2516
- }
2517
- output_manager_default.error(msg);
2518
- return 1;
2519
- }
2520
- if (opts["--sensitive"] && selectedIsDevelopment && !configSecretUiEnabled) {
2521
- const msg = `--sensitive is not allowed with the Development Environment. Sensitive Environment Variables are only supported on Production and Preview.`;
2522
- if (client.nonInteractive) {
2523
- outputAgentError(
2524
- client,
2525
- {
2526
- status: "error",
2527
- reason: "sensitive_not_allowed_on_development",
2528
- message: msg
2529
- },
2530
- 1
2531
- );
2532
- }
2533
- output_manager_default.error(msg);
2534
- return 1;
2535
- }
2536
2471
  let envValue;
2537
2472
  if (stdInput) {
2538
2473
  const normalizedStdinValue = normalizeStdinEnvValue(stdInput);
@@ -2618,7 +2553,6 @@ async function update(client, argv) {
2618
2553
  );
2619
2554
  const allTargets = [...targets, ...selectedEnv.customEnvironmentIds || []];
2620
2555
  const { visibility, error: visibilityError } = resolveEnvVarVisibility({
2621
- configSecretUiEnabled,
2622
2556
  explicitVisibility,
2623
2557
  type,
2624
2558
  key: envName,
@@ -2683,11 +2617,9 @@ async function update(client, argv) {
2683
2617
  )}
2684
2618
  `
2685
2619
  );
2686
- if (configSecretUiEnabled) {
2687
- const visibilityLabel = formatVisibilityLabel(visibility, type);
2688
- if (visibilityLabel) {
2689
- printAlignedLabel("Visibility", visibilityLabel);
2690
- }
2620
+ const visibilityLabel = formatVisibilityLabel(visibility, type);
2621
+ if (visibilityLabel) {
2622
+ printAlignedLabel("Visibility", visibilityLabel);
2691
2623
  }
2692
2624
  return 0;
2693
2625
  }