@scalar/cli 2.7.1 → 2.10.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 (94) hide show
  1. package/README.md +475 -80
  2. package/chunks/action-4GZI2M5B.js +62 -0
  3. package/chunks/action-4W5GUGEG.js +63 -0
  4. package/chunks/{action-HJYZCPUN.js → action-5LF4XYHX.js} +10 -7
  5. package/chunks/{action-SRBN7N3R.js → action-5N3P43MD.js} +17 -12
  6. package/chunks/{action-RBOLLIGX.js → action-5RL4NWUZ.js} +17 -17
  7. package/chunks/{action-SNPOOW6S.js → action-657A4K2D.js} +16 -16
  8. package/chunks/{action-EOAVVL52.js → action-7XOHYWYM.js} +11 -14
  9. package/chunks/{action-AQRPFQKI.js → action-CABLS46Q.js} +9 -7
  10. package/chunks/{action-F7A2K74G.js → action-CB55NWAU.js} +9 -13
  11. package/chunks/{action-5SK5NE7E.js → action-DKDRAIKV.js} +11 -14
  12. package/chunks/{action-7PEQXDWT.js → action-DTEO4YNX.js} +127 -20
  13. package/chunks/{action-BAQYJ6UE.js → action-EAUTQ77U.js} +27 -23
  14. package/chunks/{action-QYGOPSTY.js → action-FBRY5JKU.js} +16 -16
  15. package/chunks/{action-VOFDW3U2.js → action-GFLRD7LO.js} +6 -5
  16. package/chunks/{action-LPVITMWA.js → action-GWYYTUTM.js} +4 -3
  17. package/chunks/{action-4NGK5XMD.js → action-HT42NUUX.js} +29 -24
  18. package/chunks/action-JEYDBB3P.js +147 -0
  19. package/chunks/{action-E4YSRFGT.js → action-KDUFU7TZ.js} +11 -13
  20. package/chunks/{action-BRSSC2SR.js → action-LYCNT3KA.js} +29 -10
  21. package/chunks/{action-CA4QYPI6.js → action-OJ2NK25F.js} +4 -8
  22. package/chunks/{action-NVI5DWFP.js → action-PAM2EZ22.js} +4 -8
  23. package/chunks/action-PPTFYZWD.js +1552 -0
  24. package/chunks/{action-OX2566BE.js → action-R4PGILN4.js} +30 -26
  25. package/chunks/{action-CPLH2CQ5.js → action-TOBU74JH.js} +23 -19
  26. package/chunks/action-U2L5DCFG.js +91 -0
  27. package/chunks/{action-H6OUJWWM.js → action-UUL6SWV4.js} +11 -14
  28. package/chunks/{action-T5XMJXPO.js → action-X7BA7PQQ.js} +10 -8
  29. package/chunks/{action-LVDU6YOI.js → action-XLE37MZL.js} +16 -16
  30. package/chunks/{action-BOZNBCNZ.js → action-XOADBXSX.js} +16 -12
  31. package/chunks/{action-SCOXTCPR.js → action-YSVTZVKV.js} +38 -19
  32. package/chunks/{action-YRX6SN5F.js → action-ZFI77WA5.js} +8 -6
  33. package/chunks/{action-ATGZOWSH.js → action-ZKA3RR3S.js} +15 -11
  34. package/chunks/actions-3SAMH7A5.js +182 -0
  35. package/chunks/{agent-ASPV3R5U.js → agent-2ESZI7NO.js} +7 -5
  36. package/chunks/{asyncapi-H4FU6GPC.js → asyncapi-4HGVM3PR.js} +14 -10
  37. package/chunks/{build.action-6V6GXI3X.js → build.action-VBGFGACM.js} +21 -19
  38. package/chunks/chunk-35Z7VTJT.js +453 -0
  39. package/chunks/chunk-36LXIJIZ.js +52 -0
  40. package/chunks/{chunk-BIKOD3SG.js → chunk-43WALAW3.js} +251 -103
  41. package/chunks/{chunk-C2KAWRIX.js → chunk-5ENKYZA4.js} +1 -1
  42. package/chunks/{chunk-ZJVYOZFB.js → chunk-5SMP756H.js} +2 -2
  43. package/chunks/{chunk-5JLVQVKO.js → chunk-6M7TL2G2.js} +146 -148
  44. package/chunks/chunk-6PSYZO3U.js +24 -0
  45. package/chunks/{chunk-ISXH6Q7I.js → chunk-ATNTXKMS.js} +45 -274
  46. package/chunks/{chunk-BDEPNGTO.js → chunk-BIMLCGKS.js} +1 -1
  47. package/chunks/{chunk-HGOD6THU.js → chunk-CWVYOXXM.js} +2 -19
  48. package/chunks/chunk-DFOZG7ZV.js +15 -0
  49. package/chunks/chunk-DHZW7Q7U.js +133 -0
  50. package/chunks/{chunk-R5LK6VPY.js → chunk-G4HRW2FZ.js} +13 -20
  51. package/chunks/{chunk-KCCFN4F7.js → chunk-GLWTVLKM.js} +29 -29
  52. package/chunks/{chunk-5UHLAJQD.js → chunk-GYRQPDTK.js} +24 -10
  53. package/chunks/chunk-H467HDVV.js +24 -0
  54. package/chunks/chunk-IPZP3VRA.js +327 -0
  55. package/chunks/{chunk-LG7IFACX.js → chunk-JXGF5EHC.js} +152 -18
  56. package/chunks/chunk-K2HIB5BA.js +92 -0
  57. package/chunks/{chunk-FDC2IESH.js → chunk-KHF2QXBG.js} +1352 -8327
  58. package/chunks/{chunk-IMG35UXX.js → chunk-KZNRQVMY.js} +1 -1
  59. package/chunks/{chunk-OJ2EWIJH.js → chunk-MC4EMNOR.js} +5 -1
  60. package/chunks/{chunk-YILQODZF.js → chunk-MMWSCTDB.js} +7 -4
  61. package/chunks/{chunk-6XWCMJDB.js → chunk-MNNGUUKJ.js} +12 -11
  62. package/chunks/chunk-NAC63XJF.js +10 -0
  63. package/chunks/{chunk-XXSQUBXS.js → chunk-UDBSV3CK.js} +107 -453
  64. package/chunks/{chunk-IKT5F47M.js → chunk-VVRUSQCY.js} +11 -11
  65. package/chunks/{chunk-2PPRO2QB.js → chunk-VYFGRLVQ.js} +1 -1
  66. package/chunks/{chunk-GPNB7ISG.js → chunk-WB6PWTMU.js} +5 -13
  67. package/chunks/{chunk-4X47MN6Q.js → chunk-WDIWLXLV.js} +3 -15
  68. package/chunks/{chunk-6YPQGVF4.js → chunk-WIEXQUTD.js} +1 -1
  69. package/chunks/{chunk-W24BETFG.js → chunk-XAGJJNQW.js} +3 -3
  70. package/chunks/{chunk-2DSVF5AD.js → chunk-ZGNDXPLU.js} +3 -3
  71. package/chunks/{chunk-XEDGMZJD.js → chunk-ZGVZU6L2.js} +81 -25
  72. package/chunks/{chunk-QXQZVEDC.js → chunk-ZKJPLWRJ.js} +2 -2
  73. package/chunks/{chunk-MLSZVVTT.js → chunk-ZYBLQ5CT.js} +13 -7
  74. package/chunks/{create.action-P6DLCK4W.js → create.action-DBNIS665.js} +21 -19
  75. package/chunks/{delete.action-HJKRRHE2.js → delete.action-GBOZC45K.js} +21 -19
  76. package/chunks/{delete.action-Z3GAA4ZN.js → delete.action-K7BLK7DK.js} +21 -19
  77. package/chunks/{get.action-IT4EHAV4.js → get.action-N3JOY3OU.js} +17 -12
  78. package/chunks/get.action-QHKMYZBK.js +91 -0
  79. package/chunks/{list.action-WLIAO5UW.js → list.action-6SSO3JVN.js} +45 -15
  80. package/chunks/{list.action-2FU5UZNH.js → list.action-TJCS6UEY.js} +41 -21
  81. package/chunks/{publish.action-T4J4DRXR.js → publish.action-T24VHRMR.js} +29 -24
  82. package/chunks/query-WKATAJJ6.js +129 -0
  83. package/chunks/scripts-VIBLGKYG.js +102 -0
  84. package/chunks/{update.action-3OVS3HWC.js → update.action-OGYNBXRU.js} +24 -19
  85. package/chunks/{update.action-MY7QPSSU.js → update.action-VOE6PH5F.js} +24 -19
  86. package/docs.html +1363 -320
  87. package/index.js +417 -174
  88. package/package.json +14 -13
  89. package/skills/scalar-cli/SKILL.md +13 -1
  90. package/template.md +157 -15
  91. package/chunks/action-JAHFRYWZ.js +0 -423
  92. package/chunks/action-N7BA5I3E.js +0 -229
  93. package/chunks/chunk-CWCETP6H.js +0 -610
  94. package/chunks/chunk-K74E42RV.js +0 -7311
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
3
3
  import {
4
4
  DownloadIsolateCommand
5
- } from "./chunks/chunk-2PPRO2QB.js";
5
+ } from "./chunks/chunk-VYFGRLVQ.js";
6
6
  import {
7
7
  openBrowser
8
8
  } from "./chunks/chunk-JFIXNSPP.js";
@@ -13,45 +13,55 @@ import {
13
13
  BundleCommand,
14
14
  parseFetchLimit,
15
15
  parsePort
16
- } from "./chunks/chunk-OJ2EWIJH.js";
16
+ } from "./chunks/chunk-MC4EMNOR.js";
17
+ import {
18
+ completeFiles
19
+ } from "./chunks/chunk-DFOZG7ZV.js";
20
+ import {
21
+ DOCUMENT_FORMATS,
22
+ PRIVACY_VALUES
23
+ } from "./chunks/chunk-NAC63XJF.js";
24
+ import "./chunks/chunk-KHF2QXBG.js";
17
25
  import {
18
26
  SdkLanguage
19
- } from "./chunks/chunk-FDC2IESH.js";
20
- import "./chunks/chunk-C2KAWRIX.js";
27
+ } from "./chunks/chunk-IPZP3VRA.js";
28
+ import "./chunks/chunk-5ENKYZA4.js";
29
+ import {
30
+ checkNodeVersion
31
+ } from "./chunks/chunk-36LXIJIZ.js";
21
32
  import {
22
- checkNodeVersion,
23
- clearAuthData,
24
33
  getAuthData,
25
34
  getMetadata,
35
+ logout,
26
36
  setMetadata
27
- } from "./chunks/chunk-CWCETP6H.js";
37
+ } from "./chunks/chunk-35Z7VTJT.js";
38
+ import "./chunks/chunk-WB6PWTMU.js";
28
39
  import {
29
40
  bin,
30
41
  name,
31
42
  version
32
- } from "./chunks/chunk-GPNB7ISG.js";
33
- import "./chunks/chunk-5UHLAJQD.js";
34
- import "./chunks/chunk-5JLVQVKO.js";
43
+ } from "./chunks/chunk-DHZW7Q7U.js";
44
+ import "./chunks/chunk-GYRQPDTK.js";
45
+ import "./chunks/chunk-6M7TL2G2.js";
35
46
  import {
36
47
  requireInteractive
37
48
  } from "./chunks/chunk-EGOXR5FB.js";
38
- import "./chunks/chunk-K74E42RV.js";
39
- import "./chunks/chunk-6XWCMJDB.js";
40
49
  import "./chunks/chunk-4ORL4MST.js";
50
+ import "./chunks/chunk-MNNGUUKJ.js";
41
51
  import {
42
52
  output
43
53
  } from "./chunks/chunk-T5HJUAWB.js";
44
- import "./chunks/chunk-XEDGMZJD.js";
54
+ import "./chunks/chunk-ZGVZU6L2.js";
45
55
  import {
46
56
  external_exports
47
- } from "./chunks/chunk-IKT5F47M.js";
57
+ } from "./chunks/chunk-VVRUSQCY.js";
48
58
  import "./chunks/chunk-3MZYUBJ6.js";
49
59
 
50
60
  // src/index.ts
51
61
  import { Agent, setGlobalDispatcher } from "undici";
52
62
 
53
63
  // src/program.ts
54
- import { Command as Command53 } from "commander";
64
+ import { Command as Command59 } from "commander";
55
65
 
56
66
  // src/domains/schema/index.ts
57
67
  import { Command as Command6 } from "commander";
@@ -64,24 +74,27 @@ var DeleteSchemaCommand = () => {
64
74
  cmd3.option("-s, --slug <slug>", "Schema slug");
65
75
  cmd3.option("-n, --namespace <namespace>", "Team namespace");
66
76
  cmd3.action(async (...args) => {
67
- const { deleteAction } = await import("./chunks/delete.action-Z3GAA4ZN.js");
77
+ const { deleteAction } = await import("./chunks/delete.action-K7BLK7DK.js");
68
78
  return deleteAction(...args);
69
79
  });
70
80
  return cmd3;
71
81
  };
72
82
 
73
83
  // src/domains/schema/get.ts
74
- import { Command as Command2 } from "commander";
84
+ import { Command as Command2, Option } from "commander";
75
85
  var GetSchemaCommand = () => {
76
86
  const cmd3 = new Command2("get");
77
87
  cmd3.description("Get a schema document version from the Scalar registry");
78
88
  cmd3.argument("[namespace]", "Team namespace");
79
89
  cmd3.argument("[slug]", "Schema slug");
80
90
  cmd3.option("--version <version>", "Schema version (defaults to latest)");
81
- cmd3.option("--format <format>", "Output format (json or yaml)", "json");
91
+ cmd3.addOption(
92
+ new Option("--format <format>", "Output format (json or yaml)").choices([...DOCUMENT_FORMATS]).default("json")
93
+ );
82
94
  cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
95
+ completeFiles(cmd3, [], ["--output"]);
83
96
  cmd3.action(async (...args) => {
84
- const { getAction } = await import("./chunks/get.action-IT4EHAV4.js");
97
+ const { getAction } = await import("./chunks/get.action-N3JOY3OU.js");
85
98
  return getAction(...args);
86
99
  });
87
100
  return cmd3;
@@ -93,8 +106,9 @@ var ListSchemaCommand = () => {
93
106
  const cmd3 = new Command3("list");
94
107
  cmd3.description("List all schemas for a team namespace");
95
108
  cmd3.option("--namespace <namespace>", "Team namespace");
109
+ cmd3.option("--json", "Output schema metadata as JSON");
96
110
  cmd3.action(async (...args) => {
97
- const { listAction } = await import("./chunks/list.action-2FU5UZNH.js");
111
+ const { listAction } = await import("./chunks/list.action-TJCS6UEY.js");
98
112
  return listAction(...args);
99
113
  });
100
114
  return cmd3;
@@ -129,15 +143,16 @@ var PublishSchemaCommand = () => {
129
143
  "Maximum number of concurrent URLs to fetch when bundling the document",
130
144
  parseFetchLimit
131
145
  );
146
+ completeFiles(cmd3, ["file"], []);
132
147
  cmd3.action(async (...args) => {
133
- const { publishAction } = await import("./chunks/publish.action-T4J4DRXR.js");
148
+ const { publishAction } = await import("./chunks/publish.action-T24VHRMR.js");
134
149
  return publishAction(...args);
135
150
  });
136
151
  return cmd3;
137
152
  };
138
153
 
139
154
  // src/domains/schema/update.ts
140
- import { Command as Command5 } from "commander";
155
+ import { Command as Command5, Option as Option2 } from "commander";
141
156
  var UpdateSchemaCommand = () => {
142
157
  const cmd3 = new Command5("update");
143
158
  cmd3.description("Update schema metadata.");
@@ -145,12 +160,14 @@ var UpdateSchemaCommand = () => {
145
160
  cmd3.option("-n, --namespace <namespace>", "Team namespace");
146
161
  cmd3.option("--title <title>", "Title");
147
162
  cmd3.option("--description <description>", "Description");
148
- cmd3.option(
149
- "--isPrivate <isPrivate>",
150
- "Privacy (true/false or public/private)"
163
+ cmd3.addOption(
164
+ new Option2(
165
+ "--isPrivate <isPrivate>",
166
+ "Privacy (true/false or public/private)"
167
+ ).choices([...PRIVACY_VALUES])
151
168
  );
152
169
  cmd3.action(async (...args) => {
153
- const { updateAction } = await import("./chunks/update.action-MY7QPSSU.js");
170
+ const { updateAction } = await import("./chunks/update.action-VOE6PH5F.js");
154
171
  return updateAction(...args);
155
172
  });
156
173
  return cmd3;
@@ -170,7 +187,7 @@ schemaCommands.forEach((command) => void schemaDomain.addCommand(command()));
170
187
  var schema_default = schemaDomain;
171
188
 
172
189
  // src/domains/sdk/index.ts
173
- import { Command as Command12 } from "commander";
190
+ import { Command as Command13 } from "commander";
174
191
 
175
192
  // src/domains/sdk/build.ts
176
193
  import { Command as Command7 } from "commander";
@@ -180,14 +197,14 @@ var BuildSdkCommand = () => {
180
197
  cmd3.option("-s, --slug <slug>", "SDK slug");
181
198
  cmd3.option("-n, --namespace <namespace>", "Team namespace");
182
199
  cmd3.action(async (...args) => {
183
- const { buildAction } = await import("./chunks/build.action-6V6GXI3X.js");
200
+ const { buildAction } = await import("./chunks/build.action-VBGFGACM.js");
184
201
  return buildAction(...args);
185
202
  });
186
203
  return cmd3;
187
204
  };
188
205
 
189
206
  // src/domains/sdk/create.ts
190
- import { Command as Command8, Option } from "commander";
207
+ import { Command as Command8, Option as Option3 } from "commander";
191
208
  var CreateSdkCommand = () => {
192
209
  const cmd3 = new Command8("create");
193
210
  cmd3.description(
@@ -199,12 +216,12 @@ var CreateSdkCommand = () => {
199
216
  "Team namespace to look the API up in"
200
217
  );
201
218
  cmd3.addOption(
202
- new Option("-l, --language <language>", "Language of your SDK").choices(
219
+ new Option3("-l, --language <language>", "Language of your SDK").choices(
203
220
  Object.values(SdkLanguage)
204
221
  )
205
222
  );
206
223
  cmd3.action(async (...args) => {
207
- const { createAction } = await import("./chunks/create.action-P6DLCK4W.js");
224
+ const { createAction } = await import("./chunks/create.action-DBNIS665.js");
208
225
  return createAction(...args);
209
226
  });
210
227
  return cmd3;
@@ -218,39 +235,59 @@ var DeleteSdkCommand = () => {
218
235
  cmd3.option("-s, --slug <slug>", "SDK slug");
219
236
  cmd3.option("-n, --namespace <namespace>", "Team namespace");
220
237
  cmd3.action(async (...args) => {
221
- const { deleteAction } = await import("./chunks/delete.action-HJKRRHE2.js");
238
+ const { deleteAction } = await import("./chunks/delete.action-GBOZC45K.js");
222
239
  return deleteAction(...args);
223
240
  });
224
241
  return cmd3;
225
242
  };
226
243
 
227
244
  // src/domains/sdk/update.ts
228
- import { Command as Command10 } from "commander";
245
+ import { Command as Command10, Option as Option4 } from "commander";
229
246
  var UpdateSdkCommand = () => {
230
247
  const cmd3 = new Command10("update");
231
248
  cmd3.description("Update SDK metadata.");
232
249
  cmd3.option("-s, --slug <slug>", "SDK slug");
233
250
  cmd3.option("-n, --namespace <namespace>", "Team namespace");
234
251
  cmd3.option("--title <title>", "Title");
235
- cmd3.option(
236
- "--isPrivate <isPrivate>",
237
- "Privacy (true/false or public/private)"
252
+ cmd3.addOption(
253
+ new Option4(
254
+ "--isPrivate <isPrivate>",
255
+ "Privacy (true/false or public/private)"
256
+ ).choices([...PRIVACY_VALUES])
238
257
  );
239
258
  cmd3.action(async (...args) => {
240
- const { updateAction } = await import("./chunks/update.action-3OVS3HWC.js");
259
+ const { updateAction } = await import("./chunks/update.action-OGYNBXRU.js");
241
260
  return updateAction(...args);
242
261
  });
243
262
  return cmd3;
244
263
  };
245
264
 
246
- // src/domains/sdk/list.ts
265
+ // src/domains/sdk/get.ts
247
266
  import { Command as Command11 } from "commander";
267
+ var GetSdkCommand = () => {
268
+ const cmd3 = new Command11("get");
269
+ cmd3.description(
270
+ "Inspect SDK metadata, API source, versions, and build status"
271
+ );
272
+ cmd3.requiredOption("-s, --slug <slug>", "SDK slug");
273
+ cmd3.option("-n, --namespace <namespace>", "Team namespace");
274
+ cmd3.option("--json", "Output structured SDK metadata as JSON");
275
+ cmd3.action(async (...args) => {
276
+ const { getAction } = await import("./chunks/get.action-QHKMYZBK.js");
277
+ return getAction(...args);
278
+ });
279
+ return cmd3;
280
+ };
281
+
282
+ // src/domains/sdk/list.ts
283
+ import { Command as Command12 } from "commander";
248
284
  var ListSdkCommand = () => {
249
- const cmd3 = new Command11("list");
285
+ const cmd3 = new Command12("list");
250
286
  cmd3.description("List all SDKs for a team namespace");
287
+ cmd3.option("--json", "Output structured SDK metadata as JSON");
251
288
  cmd3.option("--namespace <namespace>", "Team namespace");
252
289
  cmd3.action(async (...args) => {
253
- const { listAction } = await import("./chunks/list.action-WLIAO5UW.js");
290
+ const { listAction } = await import("./chunks/list.action-6SSO3JVN.js");
254
291
  return listAction(...args);
255
292
  });
256
293
  return cmd3;
@@ -259,41 +296,98 @@ var ListSdkCommand = () => {
259
296
  // src/domains/sdk/index.ts
260
297
  var sdkCommands = [
261
298
  ListSdkCommand,
299
+ GetSdkCommand,
262
300
  CreateSdkCommand,
263
301
  UpdateSdkCommand,
264
302
  DeleteSdkCommand,
265
303
  BuildSdkCommand
266
304
  ];
267
- var sdkDomain = new Command12("sdk");
305
+ var sdkDomain = new Command13("sdk");
268
306
  sdkDomain.description("Manage your Scalar SDKs (Enterprise Only)");
269
- sdkCommands.forEach((command) => sdkDomain.addCommand(command()));
307
+ sdkCommands.forEach((command) => {
308
+ sdkDomain.addCommand(command());
309
+ });
270
310
  var sdk_default = sdkDomain;
271
311
 
312
+ // src/domains/access-group/index.ts
313
+ import { Command as Command14 } from "commander";
314
+ function createAccessGroupCommand() {
315
+ const command = new Command14("access-group").description(
316
+ "Manage access groups and allowed email domains for the current team"
317
+ );
318
+ command.command("list").description("List access groups for the current team").option("--json", "Print the result as JSON").action(async (options) => {
319
+ const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
320
+ await runAction({ operation: "list", ...options });
321
+ });
322
+ command.command("create").description("Create an access group (Pro or above)").argument("<slug>", "New access group slug").option("--name <name>", "Display name").option("--domain <domains...>", "Allowed email domains").option("--json", "Print the result as JSON").action(
323
+ async (slug, options) => {
324
+ const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
325
+ await runAction({ operation: "create", slug, ...options });
326
+ }
327
+ );
328
+ command.command("get").description("Get an access group and its allowlists").argument("<slug>", "Access group slug").option("--json", "Print the result as JSON").action(async (slug, options) => {
329
+ const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
330
+ await runAction({ operation: "get", slug, ...options });
331
+ });
332
+ command.command("update").description("Update access group metadata").argument("<slug>", "Current access group slug").option("--name <name>", "New display name").option("--new-slug <slug>", "New access group slug").option("--json", "Print the result as JSON").action(
333
+ async (slug, options) => {
334
+ const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
335
+ await runAction({ operation: "update", slug, ...options });
336
+ }
337
+ );
338
+ command.command("delete").description("Delete an access group and remove its project assignments").argument("<slug>", "Access group slug").option("-y, --yes", "Confirm deletion without prompting").option("--json", "Print the result as JSON (requires --yes)").action(
339
+ async (slug, options) => {
340
+ const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
341
+ await runAction({ operation: "delete", slug, ...options });
342
+ }
343
+ );
344
+ const domain = command.command("domain").description("Manage allowed email domains");
345
+ domain.command("add").description("Add an exact email domain to an access group").argument("<slug>", "Access group slug").argument("<domain>", "Email domain, such as example.com").option("--json", "Print the result as JSON").action(
346
+ async (slug, domain2, options) => {
347
+ const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
348
+ await runAction({ operation: "add-domain", slug, domain: domain2, ...options });
349
+ }
350
+ );
351
+ domain.command("remove").description("Remove an exact email domain from an access group").argument("<slug>", "Access group slug").argument("<domain>", "Email domain, such as example.com").option("--json", "Print the result as JSON").action(
352
+ async (slug, domain2, options) => {
353
+ const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
354
+ await runAction({
355
+ operation: "remove-domain",
356
+ slug,
357
+ domain: domain2,
358
+ ...options
359
+ });
360
+ }
361
+ );
362
+ return command;
363
+ }
364
+ var access_group_default = createAccessGroupCommand();
365
+
272
366
  // src/domains/auth/index.ts
273
- import { Command as Command16 } from "commander";
367
+ import { Command as Command18 } from "commander";
274
368
 
275
369
  // src/domains/auth/login/index.ts
276
- import { Command as Command13 } from "commander";
370
+ import { Command as Command15, Option as Option5 } from "commander";
277
371
  var LoginCommand = () => {
278
- const cmd3 = new Command13("login");
372
+ const cmd3 = new Command15("login");
279
373
  cmd3.description("Login to scalar");
280
- cmd3.option("--email <email>", "Email");
281
- cmd3.option("--password <password>", "Password");
282
374
  cmd3.option("--token <token>", "Personal token");
375
+ cmd3.addOption(new Option5("--email <email>").hideHelp());
376
+ cmd3.addOption(new Option5("--password <password>").hideHelp());
283
377
  cmd3.action(async (...args) => {
284
- const { loginAction } = await import("./chunks/action-N7BA5I3E.js");
378
+ const { loginAction } = await import("./chunks/action-JEYDBB3P.js");
285
379
  return loginAction(...args);
286
380
  });
287
381
  return cmd3;
288
382
  };
289
383
 
290
384
  // src/domains/auth/logout/index.ts
291
- import { Command as Command14 } from "commander";
385
+ import { Command as Command16 } from "commander";
292
386
  var LogoutCommand = () => {
293
- const cmd3 = new Command14("logout");
387
+ const cmd3 = new Command16("logout");
294
388
  cmd3.description("Logout from scalar");
295
389
  cmd3.action(async () => {
296
- await clearAuthData();
390
+ await logout();
297
391
  output.info().message("Successfully logged out.").print();
298
392
  });
299
393
  return cmd3;
@@ -301,9 +395,9 @@ var LogoutCommand = () => {
301
395
 
302
396
  // src/domains/auth/whoami/index.ts
303
397
  import as from "ansis";
304
- import { Command as Command15 } from "commander";
398
+ import { Command as Command17 } from "commander";
305
399
  var WhoAmICommand = () => {
306
- const cmd3 = new Command15("whoami");
400
+ const cmd3 = new Command17("whoami");
307
401
  cmd3.description("Display the current user");
308
402
  cmd3.action(async () => {
309
403
  const auth = await getAuthData();
@@ -316,14 +410,47 @@ var WhoAmICommand = () => {
316
410
 
317
411
  // src/domains/auth/index.ts
318
412
  var authCommands = [LoginCommand, WhoAmICommand, LogoutCommand];
319
- var authDomain = new Command16("auth");
413
+ var authDomain = new Command18("auth");
320
414
  authDomain.description("Manage authorization on scalar platform");
321
415
  authCommands.forEach((command) => authDomain.addCommand(command()));
322
416
  var auth_default = authDomain;
323
417
 
418
+ // src/domains/completion/index.ts
419
+ import { Argument, Command as Command19 } from "commander";
420
+
421
+ // src/helpers/completion/shells.ts
422
+ var COMPLETION_SHELLS = ["bash", "zsh", "fish"];
423
+
424
+ // src/domains/completion/index.ts
425
+ var createCompletionCommand = () => new Command19("completion").description("Generate shell completion definitions").addArgument(
426
+ new Argument("<shell>", "Shell to configure").choices([
427
+ ...COMPLETION_SHELLS
428
+ ])
429
+ ).action(async (shell) => {
430
+ const { renderCompletionScript } = await import("./chunks/scripts-VIBLGKYG.js");
431
+ process.stdout.write(renderCompletionScript(shell));
432
+ });
433
+ var createCompletionQueryCommand = () => new Command19("__complete").description("Query shell completion candidates").argument("<cursor>", "Zero-based cursor word index").argument("[words...]", "Shell words including the executable").action(
434
+ async (cursor, words, _options, command) => {
435
+ const { queryCompletion } = await import("./chunks/query-WKATAJJ6.js");
436
+ const index = Number(cursor);
437
+ if (!command.parent || !Number.isSafeInteger(index) || index < 1 || index > words.length) {
438
+ process.stdout.write("none\n-\n");
439
+ return;
440
+ }
441
+ const result = queryCompletion(command.parent, words, index);
442
+ process.stdout.write(
443
+ `${result.mode}
444
+ ${result.prefix ?? "-"}
445
+ ${result.candidates.map((candidate) => `${candidate}
446
+ `).join("")}`
447
+ );
448
+ }
449
+ );
450
+
324
451
  // src/domains/context/index.ts
325
- import { Command as Command17 } from "commander";
326
- var cmd = new Command17("context");
452
+ import { Command as Command20 } from "commander";
453
+ var cmd = new Command20("context");
327
454
  cmd.description(
328
455
  "Print every command, argument, and option as JSON for AI agents"
329
456
  );
@@ -334,32 +461,33 @@ cmd.action(async () => {
334
461
  var context_default = cmd;
335
462
 
336
463
  // src/domains/document/index.ts
337
- import { Command as Command30 } from "commander";
464
+ import { Command as Command33 } from "commander";
338
465
 
339
466
  // src/domains/document/join/index.ts
340
- import { Command as Command18 } from "commander";
467
+ import { Command as Command21 } from "commander";
341
468
  function JoinCommand() {
342
- const cmd3 = new Command18("join");
469
+ const cmd3 = new Command21("join");
343
470
  cmd3.description(
344
471
  "Merge multiple OpenAPI or AsyncAPI documents into a single unified document"
345
472
  );
346
473
  cmd3.argument("<files...>", "Paths to the OpenAPI or AsyncAPI files to merge");
347
- cmd3.option("--output -o <file>", "Path to save the merged output file");
474
+ cmd3.option("-o, --output <file>", "Path to save the merged output file");
348
475
  cmd3.option(
349
- "--prefix-components-with-path-value -p <path>",
476
+ "-p, --prefix-components-with-path-value <path>",
350
477
  "Dot-separated path to extract a prefix value from each input file for component names"
351
478
  );
479
+ completeFiles(cmd3, ["files"], ["--output"]);
352
480
  cmd3.action(async (...args) => {
353
- const { joinAction } = await import("./chunks/action-7PEQXDWT.js");
481
+ const { joinAction } = await import("./chunks/action-DTEO4YNX.js");
354
482
  return joinAction(...args);
355
483
  });
356
484
  return cmd3;
357
485
  }
358
486
 
359
487
  // src/domains/document/split/index.ts
360
- import { Command as Command19 } from "commander";
488
+ import { Command as Command22 } from "commander";
361
489
  function SplitCommand() {
362
- const cmd3 = new Command19("split");
490
+ const cmd3 = new Command22("split");
363
491
  cmd3.description("Split OpenAPI or AsyncAPI documents into small chunks");
364
492
  cmd3.argument("[file|url]", "Path to OpenAPI or AsyncAPI file or URL to split");
365
493
  cmd3.option("-o, --output <path>", "Path to save the chunks");
@@ -367,59 +495,101 @@ function SplitCommand() {
367
495
  "after",
368
496
  "\nAsyncAPI versions are preserved (including 2.6, 3.0, and 3.1). External references are bundled before splitting.\n"
369
497
  );
498
+ completeFiles(cmd3, ["file|url"], ["--output"]);
370
499
  cmd3.action(async (...args) => {
371
- const { splitAction } = await import("./chunks/action-YRX6SN5F.js");
500
+ const { splitAction } = await import("./chunks/action-ZFI77WA5.js");
372
501
  return splitAction(...args);
373
502
  });
374
503
  return cmd3;
375
504
  }
376
505
 
377
506
  // src/domains/document/format/index.ts
378
- import { Command as Command20 } from "commander";
507
+ import { Command as Command23 } from "commander";
379
508
  function FormatCommand() {
380
- const cmd3 = new Command20("format");
509
+ const cmd3 = new Command23("format");
381
510
  cmd3.description("Format an OpenAPI or AsyncAPI file");
382
511
  cmd3.argument("[file|url]", "File or URL to format");
383
512
  cmd3.option("-o, --output <file>", "Output file");
513
+ completeFiles(cmd3, ["file|url"], ["--output"]);
384
514
  cmd3.action(async (...args) => {
385
- const { formatAction } = await import("./chunks/action-H6OUJWWM.js");
515
+ const { formatAction } = await import("./chunks/action-UUL6SWV4.js");
386
516
  return formatAction(...args);
387
517
  });
388
518
  return cmd3;
389
519
  }
390
520
 
391
521
  // src/domains/document/lint/index.ts
392
- import { Command as Command21 } from "commander";
522
+ import { Command as Command24, InvalidArgumentError, Option as Option6 } from "commander";
523
+
524
+ // src/domains/document/lint/formats.ts
525
+ var reportFormats = [
526
+ "text",
527
+ "codeframe",
528
+ "markdown",
529
+ "summary",
530
+ "json",
531
+ "github-actions",
532
+ "junit"
533
+ ];
534
+
535
+ // src/domains/document/lint/index.ts
393
536
  function LintCommand() {
394
- const cmd3 = new Command21("lint");
537
+ const cmd3 = new Command24("lint");
395
538
  cmd3.description("Lint your OpenAPI or AsyncAPI file using spectral rules");
396
539
  cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file path or url");
397
540
  cmd3.option("-r, --rule <file|url>", "Rule path or url");
541
+ cmd3.addOption(
542
+ new Option6("--format <format>", "Report format").choices([...reportFormats]).default("codeframe")
543
+ );
544
+ cmd3.option(
545
+ "--max-problems <number>",
546
+ "Maximum displayed findings (totals and exit status include all findings)",
547
+ (value) => {
548
+ if (!/^\d+$/.test(value) || !Number.isSafeInteger(Number(value)))
549
+ throw new InvalidArgumentError("Expected a nonnegative integer");
550
+ return Number(value);
551
+ },
552
+ 100
553
+ );
554
+ cmd3.option(
555
+ "-o, --output <file>",
556
+ "Write the report to a file instead of stdout"
557
+ );
558
+ cmd3.option(
559
+ "--generate-ignore-file",
560
+ "Record current findings in the ignore baseline"
561
+ );
562
+ cmd3.option(
563
+ "--ignore-file <file>",
564
+ "Ignore baseline path (Scalar file takes priority over Redocly fallback in the current directory)"
565
+ );
566
+ completeFiles(cmd3, ["file|url"], ["--rule", "--output", "--ignore-file"]);
398
567
  cmd3.action(async (...args) => {
399
- const { lintAction } = await import("./chunks/action-JAHFRYWZ.js");
568
+ const { lintAction } = await import("./chunks/action-PPTFYZWD.js");
400
569
  return lintAction(...args);
401
570
  });
402
571
  return cmd3;
403
572
  }
404
573
 
405
574
  // src/domains/document/markdown/index.ts
406
- import { Command as Command22 } from "commander";
575
+ import { Command as Command25 } from "commander";
407
576
  function MarkdownCommand() {
408
- const cmd3 = new Command22("markdown");
577
+ const cmd3 = new Command25("markdown");
409
578
  cmd3.description("Generate Markdown from an OpenAPI file");
410
579
  cmd3.argument("[file|url]", "OpenAPI file path or URL to convert");
411
580
  cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
581
+ completeFiles(cmd3, ["file|url"], ["--output"]);
412
582
  cmd3.action(async (...args) => {
413
- const { markdownAction } = await import("./chunks/action-VOFDW3U2.js");
583
+ const { markdownAction } = await import("./chunks/action-GFLRD7LO.js");
414
584
  return markdownAction(...args);
415
585
  });
416
586
  return cmd3;
417
587
  }
418
588
 
419
589
  // src/domains/document/mock/index.ts
420
- import { Command as Command23 } from "commander";
590
+ import { Command as Command26 } from "commander";
421
591
  function MockCommand() {
422
- const cmd3 = new Command23("mock");
592
+ const cmd3 = new Command26("mock");
423
593
  cmd3.description("Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels");
424
594
  cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file or URL to mock");
425
595
  cmd3.option("-w, --watch", "watch the file for changes");
@@ -429,17 +599,18 @@ function MockCommand() {
429
599
  "set the HTTP port for the mock server",
430
600
  parsePort
431
601
  );
602
+ completeFiles(cmd3, ["file|url"], []);
432
603
  cmd3.action(async (...args) => {
433
- const { mockAction } = await import("./chunks/action-ATGZOWSH.js");
604
+ const { mockAction } = await import("./chunks/action-ZKA3RR3S.js");
434
605
  return mockAction(...args);
435
606
  });
436
607
  return cmd3;
437
608
  }
438
609
 
439
610
  // src/domains/document/postman/index.ts
440
- import { Command as Command24 } from "commander";
611
+ import { Command as Command27 } from "commander";
441
612
  function ConvertCommand() {
442
- const cmd3 = new Command24("convert");
613
+ const cmd3 = new Command27("convert");
443
614
  cmd3.description("Convert a Postman collection to an OpenAPI document");
444
615
  cmd3.argument("[file|url]", "Postman collection file path or URL to convert");
445
616
  cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
@@ -447,17 +618,18 @@ function ConvertCommand() {
447
618
  "--merge-operations",
448
619
  "Merge operations with shared path+method combinations"
449
620
  );
621
+ completeFiles(cmd3, ["file|url"], ["--output"]);
450
622
  cmd3.action(async (...args) => {
451
- const { convertAction } = await import("./chunks/action-F7A2K74G.js");
623
+ const { convertAction } = await import("./chunks/action-CB55NWAU.js");
452
624
  return convertAction(...args);
453
625
  });
454
626
  return cmd3;
455
627
  }
456
628
 
457
629
  // src/domains/document/serve/index.ts
458
- import { Command as Command25 } from "commander";
630
+ import { Command as Command28 } from "commander";
459
631
  function ServeCommand() {
460
- const cmd3 = new Command25("serve");
632
+ const cmd3 = new Command28("serve");
461
633
  cmd3.description("Serve an API Reference from an OpenAPI or AsyncAPI file");
462
634
  cmd3.argument(
463
635
  "[file|url]",
@@ -474,61 +646,65 @@ function ServeCommand() {
474
646
  "set the HTTP port for the API reference server",
475
647
  parsePort
476
648
  );
649
+ completeFiles(cmd3, ["file|url"], ["--config"]);
477
650
  cmd3.action(async (...args) => {
478
- const { serveAction } = await import("./chunks/action-BOZNBCNZ.js");
651
+ const { serveAction } = await import("./chunks/action-XOADBXSX.js");
479
652
  return serveAction(...args);
480
653
  });
481
654
  return cmd3;
482
655
  }
483
656
 
484
657
  // src/domains/document/share/index.ts
485
- import { Command as Command26 } from "commander";
658
+ import { Command as Command29 } from "commander";
486
659
  function ShareCommand() {
487
- const cmd3 = new Command26("share");
660
+ const cmd3 = new Command29("share");
488
661
  cmd3.description("Share an OpenAPI or AsyncAPI file");
489
662
  cmd3.argument("[file]", "file to share");
490
663
  cmd3.option(
491
664
  "-t, --token <token>",
492
665
  "pass a token to update an existing sandbox"
493
666
  );
667
+ completeFiles(cmd3, ["file"], []);
494
668
  cmd3.action(async (...args) => {
495
- const { shareAction } = await import("./chunks/action-HJYZCPUN.js");
669
+ const { shareAction } = await import("./chunks/action-5LF4XYHX.js");
496
670
  return shareAction(...args);
497
671
  });
498
672
  return cmd3;
499
673
  }
500
674
 
501
675
  // src/domains/document/upgrade/index.ts
502
- import { Command as Command27 } from "commander";
676
+ import { Command as Command30 } from "commander";
503
677
  function UpgradeCommand() {
504
- const cmd3 = new Command27("upgrade");
678
+ const cmd3 = new Command30("upgrade");
505
679
  cmd3.description("Upgrade an OpenAPI or AsyncAPI document to version 3.1");
506
680
  cmd3.argument("[file|url]", "File or URL to upgrade");
507
681
  cmd3.option("-o, --output <file>", "Path to save the upgraded output file");
682
+ completeFiles(cmd3, ["file|url"], ["--output"]);
508
683
  cmd3.action(async (...args) => {
509
- const { upgradeAction } = await import("./chunks/action-5SK5NE7E.js");
684
+ const { upgradeAction } = await import("./chunks/action-DKDRAIKV.js");
510
685
  return upgradeAction(...args);
511
686
  });
512
687
  return cmd3;
513
688
  }
514
689
 
515
690
  // src/domains/document/validate/index.ts
516
- import { Command as Command28 } from "commander";
691
+ import { Command as Command31 } from "commander";
517
692
  function ValidateCommand() {
518
- const cmd3 = new Command28("validate");
693
+ const cmd3 = new Command31("validate");
519
694
  cmd3.description("Validate an OpenAPI or AsyncAPI file");
520
695
  cmd3.argument("[file|url]", "File or URL to validate");
696
+ completeFiles(cmd3, ["file|url"], []);
521
697
  cmd3.action(async (...args) => {
522
- const { validateAction } = await import("./chunks/action-AQRPFQKI.js");
698
+ const { validateAction } = await import("./chunks/action-CABLS46Q.js");
523
699
  return validateAction(...args);
524
700
  });
525
701
  return cmd3;
526
702
  }
527
703
 
528
704
  // src/domains/document/void/index.ts
529
- import { Command as Command29 } from "commander";
705
+ import { Command as Command32 } from "commander";
530
706
  function VoidCommand() {
531
- const cmd3 = new Command29("void");
707
+ const cmd3 = new Command32("void");
532
708
  cmd3.description("Boot a server to mirror HTTP requests");
533
709
  cmd3.option("-o, --once", "run the server only once and exit after that");
534
710
  cmd3.option(
@@ -559,18 +735,18 @@ var documentCommands = [
559
735
  LintCommand,
560
736
  UpgradeCommand
561
737
  ];
562
- var documentDomain = new Command30("document");
738
+ var documentDomain = new Command33("document");
563
739
  documentDomain.description("Manage local openapi file");
564
740
  documentCommands.forEach((command) => documentDomain.addCommand(command()));
565
741
  var document_default = documentDomain;
566
742
 
567
743
  // src/domains/project/index.ts
568
- import { Command as Command40 } from "commander";
744
+ import { Command as Command45 } from "commander";
569
745
 
570
746
  // src/domains/project/preview/index.ts
571
- import { Command as Command31, Option as Option2 } from "commander";
747
+ import { Command as Command34, Option as Option7 } from "commander";
572
748
  var PreviewCommand = () => {
573
- const cmd3 = new Command31("preview");
749
+ const cmd3 = new Command34("preview");
574
750
  cmd3.description("Preview scalar guides");
575
751
  cmd3.argument(
576
752
  "[config]",
@@ -586,56 +762,58 @@ var PreviewCommand = () => {
586
762
  "Specify which IP addresses the server should listen on."
587
763
  );
588
764
  cmd3.addOption(
589
- new Option2("-L, --log-level <level>", "Set the log level").choices(["debug", "info"]).default("info")
765
+ new Option7("-L, --log-level <level>", "Set the log level").choices(["debug", "info"]).default("info")
590
766
  );
591
767
  cmd3.option("-N, --no-open", "Do not open the browser automatically", true);
768
+ completeFiles(cmd3, ["config"], []);
592
769
  cmd3.action(async (...args) => {
593
- const { previewAction } = await import("./chunks/action-E4YSRFGT.js");
770
+ const { previewAction } = await import("./chunks/action-KDUFU7TZ.js");
594
771
  return previewAction(...args);
595
772
  });
596
773
  return cmd3;
597
774
  };
598
775
 
599
776
  // src/domains/project/check-config/index.ts
600
- import { Command as Command32 } from "commander";
777
+ import { Command as Command35 } from "commander";
601
778
  function CheckConfigCommand() {
602
- const cmd3 = new Command32("check-config");
779
+ const cmd3 = new Command35("check-config");
603
780
  cmd3.description("Check a Scalar Configuration file");
604
781
  cmd3.argument("[file]", "File to check");
782
+ completeFiles(cmd3, ["file"], []);
605
783
  cmd3.action(async (...args) => {
606
- const { checkConfigAction } = await import("./chunks/action-NVI5DWFP.js");
784
+ const { checkConfigAction } = await import("./chunks/action-PAM2EZ22.js");
607
785
  return checkConfigAction(...args);
608
786
  });
609
787
  return cmd3;
610
788
  }
611
789
 
612
790
  // src/domains/project/create/index.ts
613
- import { Command as Command33 } from "commander";
791
+ import { Command as Command36 } from "commander";
614
792
  var CreateCommand = () => {
615
- const cmd3 = new Command33("create");
793
+ const cmd3 = new Command36("create");
616
794
  cmd3.description(
617
795
  "Create a new project that is not linked to a github project."
618
796
  );
619
797
  cmd3.option("-n, --name <name>", "name of your project");
620
798
  cmd3.option("-s, --slug <slug>", "project slug");
621
799
  cmd3.action(async (...args) => {
622
- const { createAction } = await import("./chunks/action-LVDU6YOI.js");
800
+ const { createAction } = await import("./chunks/action-XLE37MZL.js");
623
801
  return createAction(...args);
624
802
  });
625
803
  return cmd3;
626
804
  };
627
805
 
628
806
  // src/domains/project/deployments/index.ts
629
- import { Command as Command35 } from "commander";
807
+ import { Command as Command38 } from "commander";
630
808
 
631
809
  // src/domains/project/deployments/list/index.ts
632
- import { Command as Command34 } from "commander";
810
+ import { Command as Command37 } from "commander";
633
811
  var ListCommand = () => {
634
- const cmd3 = new Command34("list");
812
+ const cmd3 = new Command37("list");
635
813
  cmd3.description("List the production deployment history for a project.");
636
- cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
814
+ cmd3.option("-s, --slug [slug]", "Project slug from scalar project list");
637
815
  cmd3.action(async (...args) => {
638
- const { listAction } = await import("./chunks/action-CPLH2CQ5.js");
816
+ const { listAction } = await import("./chunks/action-TOBU74JH.js");
639
817
  return listAction(...args);
640
818
  });
641
819
  return cmd3;
@@ -643,78 +821,104 @@ var ListCommand = () => {
643
821
 
644
822
  // src/domains/project/deployments/index.ts
645
823
  var DeploymentsCommand = () => {
646
- const cmd3 = new Command35("deployments");
824
+ const cmd3 = new Command38("deployments");
647
825
  cmd3.description("Inspect a project deployment history.");
648
826
  cmd3.addCommand(ListCommand());
649
827
  return cmd3;
650
828
  };
651
829
 
830
+ // src/domains/project/get/index.ts
831
+ import { Command as Command39 } from "commander";
832
+ function GetCommand() {
833
+ const command = new Command39("get").description("Get project details for the current team.").argument("<slug>", "Project slug from scalar project list").option("--json", "Print project details as JSON");
834
+ command.action(
835
+ async (slug, options) => {
836
+ const { getAction } = await import("./chunks/action-4W5GUGEG.js");
837
+ await getAction(slug, options);
838
+ }
839
+ );
840
+ return command;
841
+ }
842
+
652
843
  // src/domains/project/init/index.ts
653
- import { Command as Command36 } from "commander";
844
+ import { Command as Command40 } from "commander";
654
845
  var InitCommand = () => {
655
- const cmd3 = new Command36("init");
846
+ const cmd3 = new Command40("init");
656
847
  cmd3.description("Create a new Scalar Docs project.");
657
848
  cmd3.option("-s, --subdomain [url]", "subdomain to publish on");
658
849
  cmd3.option("--force", "override existing configuration");
659
850
  cmd3.action(async (...args) => {
660
- const { initAction } = await import("./chunks/action-RBOLLIGX.js");
851
+ const { initAction } = await import("./chunks/action-5RL4NWUZ.js");
661
852
  return initAction(...args);
662
853
  });
663
854
  return cmd3;
664
855
  };
665
856
 
857
+ // src/domains/project/list/index.ts
858
+ import { Command as Command41 } from "commander";
859
+ function ListCommand2() {
860
+ const command = new Command41("list").description("List projects and their slugs for the current team.").option("--json", "Print project details as JSON");
861
+ command.action(async (options) => {
862
+ const { listAction } = await import("./chunks/action-U2L5DCFG.js");
863
+ await listAction(options);
864
+ });
865
+ return command;
866
+ }
867
+
666
868
  // src/domains/project/publish/index.ts
667
- import { Command as Command37 } from "commander";
869
+ import { Command as Command42 } from "commander";
668
870
  var PublishCommand = () => {
669
- const cmd3 = new Command37("publish");
871
+ const cmd3 = new Command42("publish");
670
872
  cmd3.description(
671
873
  "Publish new build for a github sync project that is not linked."
672
874
  );
673
- cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
875
+ cmd3.option("-s, --slug [slug]", "Project slug from scalar project list");
674
876
  cmd3.option("-c, --config [config]", "Your config file of the project");
675
877
  cmd3.option("-p, --preview", "Publish in preview mode");
676
878
  cmd3.option(
677
879
  "-g, --github",
678
880
  "Publish from your linked remote GitHub repository"
679
881
  );
882
+ completeFiles(cmd3, [], ["--config"]);
680
883
  cmd3.action(async (...args) => {
681
- const { publishAction } = await import("./chunks/action-OX2566BE.js");
884
+ const { publishAction } = await import("./chunks/action-R4PGILN4.js");
682
885
  return publishAction(...args);
683
886
  });
684
887
  return cmd3;
685
888
  };
686
889
 
687
890
  // src/domains/project/rollback/index.ts
688
- import { Command as Command38 } from "commander";
891
+ import { Command as Command43 } from "commander";
689
892
  var RollbackCommand = () => {
690
- const cmd3 = new Command38("rollback");
893
+ const cmd3 = new Command43("rollback");
691
894
  cmd3.description(
692
895
  "Roll the live deployment back to a previously deployed build."
693
896
  );
694
- cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
897
+ cmd3.option("-s, --slug [slug]", "Project slug from scalar project list");
695
898
  cmd3.option(
696
899
  "-t, --to <publishUid>",
697
900
  "Roll back to a specific build id (defaults to the next older deployed build)"
698
901
  );
699
902
  cmd3.option("-y, --yes", "Skip the confirmation prompt");
700
903
  cmd3.action(async (...args) => {
701
- const { rollbackAction } = await import("./chunks/action-BAQYJ6UE.js");
904
+ const { rollbackAction } = await import("./chunks/action-EAUTQ77U.js");
702
905
  return rollbackAction(...args);
703
906
  });
704
907
  return cmd3;
705
908
  };
706
909
 
707
910
  // src/domains/project/upgrade/index.ts
708
- import { Command as Command39 } from "commander";
911
+ import { Command as Command44 } from "commander";
709
912
  var UpgradeCommand2 = () => {
710
- const cmd3 = new Command39("upgrade");
913
+ const cmd3 = new Command44("upgrade");
711
914
  cmd3.description("Upgrade scalar project");
712
915
  cmd3.argument(
713
916
  "[config]",
714
917
  "Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
715
918
  );
919
+ completeFiles(cmd3, ["config"], []);
716
920
  cmd3.action(async (...args) => {
717
- const { upgradeAction } = await import("./chunks/action-CA4QYPI6.js");
921
+ const { upgradeAction } = await import("./chunks/action-OJ2NK25F.js");
718
922
  return upgradeAction(...args);
719
923
  });
720
924
  return cmd3;
@@ -722,6 +926,8 @@ var UpgradeCommand2 = () => {
722
926
 
723
927
  // src/domains/project/index.ts
724
928
  var projectCommands = [
929
+ ListCommand2,
930
+ GetCommand,
725
931
  InitCommand,
726
932
  CheckConfigCommand,
727
933
  CreateCommand,
@@ -731,19 +937,21 @@ var projectCommands = [
731
937
  DeploymentsCommand,
732
938
  UpgradeCommand2
733
939
  ];
734
- var projectDomain = new Command40("project");
940
+ var projectDomain = new Command45("project");
735
941
  projectDomain.description("Manage scalar project");
736
- projectCommands.forEach((command) => projectDomain.addCommand(command()));
942
+ for (const command of projectCommands) {
943
+ projectDomain.addCommand(command());
944
+ }
737
945
  projectDomain.addCommand(DownloadIsolateCommand(), { hidden: true });
738
946
  var project_default = projectDomain;
739
947
 
740
948
  // src/domains/readme/index.ts
741
- import { Command as Command42 } from "commander";
949
+ import { Command as Command47 } from "commander";
742
950
 
743
951
  // src/domains/readme/generate.ts
744
952
  import { text } from "@clack/prompts";
745
953
  import as2 from "ansis";
746
- import { Command as Command41 } from "commander";
954
+ import { Command as Command46 } from "commander";
747
955
 
748
956
  // src/helpers/documentation/index.ts
749
957
  import fs from "node:fs/promises";
@@ -790,12 +998,13 @@ var generateDocumentationFile = async (outputPath) => {
790
998
 
791
999
  // src/domains/readme/generate.ts
792
1000
  function GenerateReadmeCommand() {
793
- const cmd3 = new Command41("generate");
1001
+ const cmd3 = new Command46("generate");
794
1002
  cmd3.description("Self generate documentation for the cli");
795
1003
  cmd3.option(
796
1004
  "-o, --output [file]",
797
1005
  "Path where the documentation file will be written"
798
1006
  );
1007
+ completeFiles(cmd3, [], ["--output"]);
799
1008
  cmd3.action(async ({ output: __outputPath }) => {
800
1009
  const getOutputPath = async () => {
801
1010
  if (__outputPath !== void 0 && typeof __outputPath === "string") {
@@ -856,18 +1065,18 @@ function ServeReadmeCommand(cmd3) {
856
1065
  }
857
1066
 
858
1067
  // src/domains/readme/index.ts
859
- var readmeDomain = new Command42("readme");
1068
+ var readmeDomain = new Command47("readme");
860
1069
  readmeDomain.addCommand(GenerateReadmeCommand());
861
1070
  ServeReadmeCommand(readmeDomain);
862
1071
  var readme_default = readmeDomain;
863
1072
 
864
1073
  // src/domains/registry/index.ts
865
- import { Command as Command48 } from "commander";
1074
+ import { Command as Command53 } from "commander";
866
1075
 
867
1076
  // src/domains/registry/publish/index.ts
868
- import { Command as Command43 } from "commander";
1077
+ import { Command as Command48 } from "commander";
869
1078
  var PublishCommand2 = () => {
870
- const cmd3 = new Command43("publish");
1079
+ const cmd3 = new Command48("publish");
871
1080
  cmd3.description("Publish an OpenAPI document to the Scalar registry");
872
1081
  cmd3.argument("[file]", "OpenAPI file to upload");
873
1082
  cmd3.option(
@@ -893,68 +1102,73 @@ var PublishCommand2 = () => {
893
1102
  "Maximum number of concurrent URLs to fetch when bundling the document",
894
1103
  parseFetchLimit
895
1104
  );
1105
+ completeFiles(cmd3, ["file"], []);
896
1106
  cmd3.action(async (...args) => {
897
- const { publishAction } = await import("./chunks/action-4NGK5XMD.js");
1107
+ const { publishAction } = await import("./chunks/action-HT42NUUX.js");
898
1108
  return publishAction(...args);
899
1109
  });
900
1110
  return cmd3;
901
1111
  };
902
1112
 
903
1113
  // src/domains/registry/delete/index.ts
904
- import { Command as Command44 } from "commander";
1114
+ import { Command as Command49 } from "commander";
905
1115
  var DeleteCommand = () => {
906
- const cmd3 = new Command44("delete");
1116
+ const cmd3 = new Command49("delete");
907
1117
  cmd3.description("Delete a document from scalar registry");
908
1118
  cmd3.argument("[namespace]", "Team namespace");
909
1119
  cmd3.argument("[slug]", "Managed doc slug");
910
1120
  cmd3.action(async (...args) => {
911
- const { deleteAction } = await import("./chunks/action-QYGOPSTY.js");
1121
+ const { deleteAction } = await import("./chunks/action-FBRY5JKU.js");
912
1122
  return deleteAction(...args);
913
1123
  });
914
1124
  return cmd3;
915
1125
  };
916
1126
 
917
1127
  // src/domains/registry/get/index.ts
918
- import { Command as Command45 } from "commander";
919
- var GetCommand = () => {
920
- const cmd3 = new Command45("get");
1128
+ import { Command as Command50, Option as Option8 } from "commander";
1129
+ var GetCommand2 = () => {
1130
+ const cmd3 = new Command50("get");
921
1131
  cmd3.description("Get a document version from scalar registry");
922
1132
  cmd3.argument("[namespace]", "Team namespace");
923
1133
  cmd3.argument("[slug]", "Managed doc slug");
924
1134
  cmd3.option("--version <version>", "Document version (defaults to latest)");
925
- cmd3.option("--format <format>", "Output format (json or yaml)", "json");
1135
+ cmd3.addOption(
1136
+ new Option8("--format <format>", "Output format (json or yaml)").choices([...DOCUMENT_FORMATS]).default("json")
1137
+ );
926
1138
  cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
1139
+ completeFiles(cmd3, [], ["--output"]);
927
1140
  cmd3.action(async (...args) => {
928
- const { getAction } = await import("./chunks/action-SRBN7N3R.js");
1141
+ const { getAction } = await import("./chunks/action-5N3P43MD.js");
929
1142
  return getAction(...args);
930
1143
  });
931
1144
  return cmd3;
932
1145
  };
933
1146
 
934
1147
  // src/domains/registry/list/index.ts
935
- import { Command as Command46 } from "commander";
936
- var ListCommand2 = () => {
937
- const cmd3 = new Command46("list");
1148
+ import { Command as Command51 } from "commander";
1149
+ var ListCommand3 = () => {
1150
+ const cmd3 = new Command51("list");
938
1151
  cmd3.description("List all registry APIs for a team namespace");
939
1152
  cmd3.option("--namespace <namespace>", "Team namespace");
1153
+ cmd3.option("--json", "Output registry API metadata as JSON");
940
1154
  cmd3.action(async (...args) => {
941
- const { listAction } = await import("./chunks/action-SCOXTCPR.js");
1155
+ const { listAction } = await import("./chunks/action-YSVTZVKV.js");
942
1156
  return listAction(...args);
943
1157
  });
944
1158
  return cmd3;
945
1159
  };
946
1160
 
947
1161
  // src/domains/registry/update/index.ts
948
- import { Command as Command47 } from "commander";
1162
+ import { Command as Command52 } from "commander";
949
1163
  var UpdateCommand = () => {
950
- const cmd3 = new Command47("update");
1164
+ const cmd3 = new Command52("update");
951
1165
  cmd3.description("Update document metadata on scalar registry");
952
1166
  cmd3.argument("[namespace]", "namespace of document you want to update");
953
1167
  cmd3.argument("[slug]", "slug of document you want to update");
954
1168
  cmd3.option("--title <title>", "Document title");
955
1169
  cmd3.option("--description <description>", "Document description");
956
1170
  cmd3.action(async (...args) => {
957
- const { updateAction } = await import("./chunks/action-SNPOOW6S.js");
1171
+ const { updateAction } = await import("./chunks/action-657A4K2D.js");
958
1172
  return updateAction(...args);
959
1173
  });
960
1174
  return cmd3;
@@ -965,53 +1179,69 @@ var registryCommands = [
965
1179
  PublishCommand2,
966
1180
  UpdateCommand,
967
1181
  DeleteCommand,
968
- ListCommand2,
969
- GetCommand
1182
+ ListCommand3,
1183
+ GetCommand2
970
1184
  ];
971
- var registryDomain = new Command48("registry");
1185
+ var registryDomain = new Command53("registry");
972
1186
  registryDomain.description("Manage your scalar registry");
973
1187
  registryCommands.forEach((command) => registryDomain.addCommand(command()));
974
1188
  var registry_default = registryDomain;
975
1189
 
976
1190
  // src/domains/team/index.ts
977
- import { Command as Command51 } from "commander";
1191
+ import { Command as Command57 } from "commander";
1192
+
1193
+ // src/domains/team/get/index.ts
1194
+ import { Command as Command54 } from "commander";
1195
+ var GetCommand3 = () => {
1196
+ const cmd3 = new Command54("get");
1197
+ cmd3.description("Get the current team and its namespaces");
1198
+ cmd3.option("--json", "Output the current team as JSON");
1199
+ cmd3.action(async (...args) => {
1200
+ const { getAction } = await import("./chunks/action-4GZI2M5B.js");
1201
+ return getAction(...args);
1202
+ });
1203
+ return cmd3;
1204
+ };
978
1205
 
979
1206
  // src/domains/team/list/index.ts
980
- import { Command as Command49 } from "commander";
981
- var ListCommand3 = () => {
982
- const cmd3 = new Command49("list");
1207
+ import { Command as Command55 } from "commander";
1208
+ var ListCommand4 = () => {
1209
+ const cmd3 = new Command55("list");
983
1210
  cmd3.description("List all teams current user is part of");
1211
+ cmd3.option("--json", "Output teams as JSON");
984
1212
  cmd3.action(async (...args) => {
985
- const { listAction } = await import("./chunks/action-BRSSC2SR.js");
1213
+ const { listAction } = await import("./chunks/action-LYCNT3KA.js");
986
1214
  return listAction(...args);
987
1215
  });
988
1216
  return cmd3;
989
1217
  };
990
1218
 
991
1219
  // src/domains/team/set/index.ts
992
- import { Command as Command50 } from "commander";
1220
+ import { Command as Command56 } from "commander";
993
1221
  var SetCommand = () => {
994
- const cmd3 = new Command50("set");
1222
+ const cmd3 = new Command56("set");
995
1223
  cmd3.description("Set current active team for the user");
996
1224
  cmd3.option("--team <team>", "Team uid");
997
1225
  cmd3.action(async (...args) => {
998
- const { setAction } = await import("./chunks/action-T5XMJXPO.js");
1226
+ const { setAction } = await import("./chunks/action-X7BA7PQQ.js");
999
1227
  return setAction(...args);
1000
1228
  });
1001
1229
  return cmd3;
1002
1230
  };
1003
1231
 
1004
1232
  // src/domains/team/index.ts
1005
- var teamCommands = [ListCommand3, SetCommand];
1006
- var teamDomain = new Command51("team");
1233
+ var teamCommands = [ListCommand4, GetCommand3, SetCommand];
1234
+ var teamDomain = new Command57("team");
1007
1235
  teamDomain.description("Manage user teams");
1008
- teamCommands.forEach((command) => teamDomain.addCommand(command()));
1236
+ teamCommands.forEach((command) => {
1237
+ teamDomain.addCommand(command());
1238
+ });
1009
1239
  var team_default = teamDomain;
1010
1240
 
1011
1241
  // src/domains/upgrade/index.ts
1012
1242
  import { execSync } from "node:child_process";
1013
1243
  import as5 from "ansis";
1014
- import { Command as Command52 } from "commander";
1244
+ import { Command as Command58 } from "commander";
1015
1245
 
1016
1246
  // src/helpers/upgrade.ts
1017
1247
  import as4 from "ansis";
@@ -1050,10 +1280,18 @@ async function getUpgradeInformation(timeoutMs = USER_INITIATED_TIMEOUT_MS) {
1050
1280
  latestVersion
1051
1281
  };
1052
1282
  }
1053
- async function checkUpgrade() {
1054
- const emitOutput = () => output.info().message(
1055
- `New version available! Run ${as4.cyan("`scalar upgrade`")} to install the latest version`
1056
- ).print();
1283
+ async function checkUpgrade(stream = "stdout") {
1284
+ const emitOutput = () => {
1285
+ if (stream === "stderr") {
1286
+ process.stderr.write(
1287
+ "New version available! Run `scalar upgrade` to install the latest version\n"
1288
+ );
1289
+ return;
1290
+ }
1291
+ return output.info().message(
1292
+ `New version available! Run ${as4.cyan("`scalar upgrade`")} to install the latest version`
1293
+ ).print();
1294
+ };
1057
1295
  const now = Date.now();
1058
1296
  const delay = 1 * 60 * 60 * 1e3;
1059
1297
  const {
@@ -1078,7 +1316,7 @@ async function checkUpgrade() {
1078
1316
  }
1079
1317
 
1080
1318
  // src/domains/upgrade/index.ts
1081
- var cmd2 = new Command52("upgrade");
1319
+ var cmd2 = new Command58("upgrade");
1082
1320
  cmd2.description("Upgrade current version of your cli");
1083
1321
  cmd2.action(async () => {
1084
1322
  if (process.env.SCALAR_CLI_DISTRIBUTION === "portable") {
@@ -1111,7 +1349,9 @@ var domains = [
1111
1349
  readme_default,
1112
1350
  upgrade_default,
1113
1351
  context_default,
1352
+ createCompletionCommand(),
1114
1353
  auth_default,
1354
+ access_group_default,
1115
1355
  document_default,
1116
1356
  project_default,
1117
1357
  registry_default,
@@ -1123,10 +1363,11 @@ var domains_default = domains;
1123
1363
 
1124
1364
  // src/program.ts
1125
1365
  var getProgram = () => {
1126
- const program2 = new Command53();
1366
+ const program2 = new Command59();
1127
1367
  program2.enablePositionalOptions().name(Object.keys(bin)[0]).description("CLI to work with your OpenAPI files").version(version, "-v, --version");
1128
1368
  program2.showHelpAfterError();
1129
1369
  domains_default.forEach((domain) => program2.addCommand(domain));
1370
+ program2.addCommand(createCompletionQueryCommand(), { hidden: true });
1130
1371
  return program2;
1131
1372
  };
1132
1373
 
@@ -1141,8 +1382,10 @@ var program = getProgram();
1141
1382
  if (process.argv.length === 2) {
1142
1383
  program.help();
1143
1384
  }
1144
- if (process.argv[2] !== "upgrade" && process.argv[2] !== "context" && process.env.SCALAR_CLI_DISTRIBUTION !== "portable") {
1145
- checkUpgrade().catch(() => {
1385
+ if (process.argv[2] !== "upgrade" && process.argv[2] !== "context" && process.argv[2] !== "completion" && process.argv[2] !== "__complete" && !process.argv.includes("--json") && process.env.SCALAR_CLI_DISTRIBUTION !== "portable") {
1386
+ checkUpgrade(
1387
+ process.argv[2] === "document" && process.argv[3] === "lint" ? "stderr" : "stdout"
1388
+ ).catch(() => {
1146
1389
  });
1147
1390
  }
1148
1391
  program.parse();