@scalar/cli 2.5.1 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +113 -28
  2. package/chunks/{action-VTVFY2MP.js → action-4NGK5XMD.js} +38 -21
  3. package/chunks/{action-FDB7NEOK.js → action-5SK5NE7E.js} +10 -4
  4. package/chunks/{action-QE2ZQQX7.js → action-7PEQXDWT.js} +4 -4
  5. package/chunks/action-AQRPFQKI.js +231 -0
  6. package/chunks/{action-R7IMFHQ5.js → action-ATGZOWSH.js} +49 -26
  7. package/chunks/{action-XMNX5ZYT.js → action-BAQYJ6UE.js} +25 -21
  8. package/chunks/{action-M7RQKBSB.js → action-BOZNBCNZ.js} +89 -14
  9. package/chunks/{action-QPUSPD5M.js → action-BRSSC2SR.js} +7 -7
  10. package/chunks/{action-37EV4UHW.js → action-CA4QYPI6.js} +6 -6
  11. package/chunks/{action-JZLZ7ZAD.js → action-CPLH2CQ5.js} +17 -17
  12. package/chunks/{action-SQG3JAII.js → action-E4YSRFGT.js} +34 -20
  13. package/chunks/{action-CH24QGTE.js → action-EOAVVL52.js} +11 -5
  14. package/chunks/action-F2ZJNURT.js +72 -0
  15. package/chunks/{action-5IU77OII.js → action-F7A2K74G.js} +4 -4
  16. package/chunks/{action-SH4UUXPL.js → action-H6OUJWWM.js} +4 -4
  17. package/chunks/{action-SNLCIBQC.js → action-HJYZCPUN.js} +5 -5
  18. package/chunks/{action-LA6KVAXQ.js → action-JAHFRYWZ.js} +58 -9
  19. package/chunks/{action-UZQJNYK4.js → action-LPVITMWA.js} +3 -3
  20. package/chunks/{action-VC4DCVST.js → action-LVDU6YOI.js} +32 -23
  21. package/chunks/{action-4XI7XJR4.js → action-N7BA5I3E.js} +37 -12
  22. package/chunks/{action-NVSZT2ZD.js → action-NVI5DWFP.js} +6 -6
  23. package/chunks/{action-F3UX5E3M.js → action-OX2566BE.js} +32 -25
  24. package/chunks/{action-OGQSTRMX.js → action-QYGOPSTY.js} +13 -13
  25. package/chunks/{action-IUE4IOWO.js → action-RBOLLIGX.js} +82 -16
  26. package/chunks/{action-MSLBC2SO.js → action-SCOXTCPR.js} +15 -15
  27. package/chunks/{action-WFWYGY7O.js → action-SNPOOW6S.js} +20 -15
  28. package/chunks/{action-HGBBV353.js → action-SRBN7N3R.js} +10 -10
  29. package/chunks/{action-PAGJ5PWC.js → action-T5XMJXPO.js} +11 -7
  30. package/chunks/{action-G26LSVZ7.js → action-VOFDW3U2.js} +4 -4
  31. package/chunks/{action-FIXBOJEW.js → action-YRX6SN5F.js} +10 -4
  32. package/chunks/{agent-HCQRMHQ5.js → agent-ASPV3R5U.js} +4 -4
  33. package/chunks/{asyncapi-QM76O55R.js → asyncapi-H4FU6GPC.js} +10 -11
  34. package/chunks/{build.action-P7FCIMYU.js → build.action-6V6GXI3X.js} +35 -31
  35. package/chunks/{chunk-PT5TI77I.js → chunk-2DSVF5AD.js} +3 -3
  36. package/chunks/{chunk-X5T526CE.js → chunk-2PPRO2QB.js} +1 -1
  37. package/chunks/{chunk-Z2KMGFE6.js → chunk-4X47MN6Q.js} +2 -2
  38. package/chunks/{chunk-OQKDBLOZ.js → chunk-5JLVQVKO.js} +8 -0
  39. package/chunks/{chunk-VNYE4R7N.js → chunk-5UHLAJQD.js} +2 -1
  40. package/chunks/{chunk-Q7DOQHZN.js → chunk-6XWCMJDB.js} +1 -1
  41. package/chunks/{chunk-6ZMT63IV.js → chunk-6YPQGVF4.js} +1 -1
  42. package/chunks/{chunk-UGGNHILG.js → chunk-BDEPNGTO.js} +1 -1
  43. package/chunks/{chunk-HCPN3KNF.js → chunk-BIKOD3SG.js} +134 -1
  44. package/chunks/{chunk-P7H7GY5A.js → chunk-C2KAWRIX.js} +1 -1
  45. package/chunks/{chunk-M37TP6U2.js → chunk-CWCETP6H.js} +170 -5
  46. package/chunks/chunk-EGOXR5FB.js +15 -0
  47. package/chunks/{chunk-3L6DLIXJ.js → chunk-FDC2IESH.js} +3474 -1319
  48. package/chunks/{chunk-4ZDQXWBT.js → chunk-GPNB7ISG.js} +14 -1
  49. package/chunks/{chunk-24WAOKGG.js → chunk-HGOD6THU.js} +27 -18
  50. package/chunks/{chunk-4NHMAG6F.js → chunk-IMG35UXX.js} +1 -1
  51. package/chunks/{chunk-AO3F5XWR.js → chunk-ISXH6Q7I.js} +253 -9
  52. package/chunks/{chunk-CISTON3A.js → chunk-KCCFN4F7.js} +2 -2
  53. package/chunks/{chunk-F467BYYR.js → chunk-LG7IFACX.js} +38 -87
  54. package/chunks/{chunk-B2MHTD3R.js → chunk-MLSZVVTT.js} +1 -1
  55. package/chunks/{chunk-K4DTP5TV.js → chunk-OJ2EWIJH.js} +21 -2
  56. package/chunks/{chunk-LFU5ZUAP.js → chunk-QXQZVEDC.js} +105 -15
  57. package/chunks/{chunk-HPL3ZZ2P.js → chunk-R5LK6VPY.js} +72 -7
  58. package/chunks/{chunk-T7B6WNZC.js → chunk-TSURUX4A.js} +12 -3
  59. package/chunks/{chunk-7AGLC7WV.js → chunk-W24BETFG.js} +2 -2
  60. package/chunks/{chunk-GSGZHE26.js → chunk-XEDGMZJD.js} +19 -5
  61. package/chunks/{chunk-PBXZN65A.js → chunk-XXSQUBXS.js} +82 -6
  62. package/chunks/{chunk-XCSR4RIT.js → chunk-YILQODZF.js} +2 -2
  63. package/chunks/{chunk-COBPBRQF.js → chunk-ZJVYOZFB.js} +2 -2
  64. package/chunks/{create.action-HDD2WUON.js → create.action-P6DLCK4W.js} +27 -15
  65. package/chunks/{delete.action-VE66JFDS.js → delete.action-HJKRRHE2.js} +24 -15
  66. package/chunks/{delete.action-7GOZY7ID.js → delete.action-Z3GAA4ZN.js} +24 -15
  67. package/chunks/{get.action-2745EB4N.js → get.action-IT4EHAV4.js} +10 -10
  68. package/chunks/{list.action-4QDCZLSZ.js → list.action-2FU5UZNH.js} +15 -15
  69. package/chunks/{list.action-3VTXQJRA.js → list.action-WLIAO5UW.js} +13 -13
  70. package/chunks/{publish.action-ULQLZKWU.js → publish.action-T4J4DRXR.js} +48 -22
  71. package/chunks/{update.action-OROQSP2S.js → update.action-3OVS3HWC.js} +25 -16
  72. package/chunks/{update.action-6QEFP7NA.js → update.action-MY7QPSSU.js} +25 -16
  73. package/docs.html +294 -99
  74. package/index.js +436 -401
  75. package/package.json +15 -23
  76. package/skills/scalar-cli/SKILL.md +71 -0
  77. package/template.md +81 -3
  78. package/chunks/action-B3KKREWQ.js +0 -64
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-X5T526CE.js";
5
+ } from "./chunks/chunk-2PPRO2QB.js";
6
6
  import {
7
7
  openBrowser
8
8
  } from "./chunks/chunk-JFIXNSPP.js";
@@ -10,29 +10,38 @@ import {
10
10
  measureTime
11
11
  } from "./chunks/chunk-KHDYYVYF.js";
12
12
  import {
13
- BundleCommand
14
- } from "./chunks/chunk-K4DTP5TV.js";
13
+ BundleCommand,
14
+ parseFetchLimit,
15
+ parsePort
16
+ } from "./chunks/chunk-OJ2EWIJH.js";
15
17
  import {
16
18
  SdkLanguage
17
- } from "./chunks/chunk-3L6DLIXJ.js";
18
- import "./chunks/chunk-P7H7GY5A.js";
19
+ } from "./chunks/chunk-FDC2IESH.js";
20
+ import "./chunks/chunk-C2KAWRIX.js";
19
21
  import {
20
22
  checkNodeVersion,
21
23
  clearAuthData,
22
24
  getAuthData,
23
25
  getMetadata,
24
26
  setMetadata
25
- } from "./chunks/chunk-M37TP6U2.js";
26
- import "./chunks/chunk-4ZDQXWBT.js";
27
- import "./chunks/chunk-VNYE4R7N.js";
28
- import "./chunks/chunk-OQKDBLOZ.js";
27
+ } from "./chunks/chunk-CWCETP6H.js";
28
+ import {
29
+ bin,
30
+ name,
31
+ version
32
+ } from "./chunks/chunk-GPNB7ISG.js";
33
+ import "./chunks/chunk-5UHLAJQD.js";
34
+ import "./chunks/chunk-5JLVQVKO.js";
35
+ import {
36
+ requireInteractive
37
+ } from "./chunks/chunk-EGOXR5FB.js";
29
38
  import "./chunks/chunk-K74E42RV.js";
30
- import "./chunks/chunk-Q7DOQHZN.js";
39
+ import "./chunks/chunk-6XWCMJDB.js";
31
40
  import "./chunks/chunk-4ORL4MST.js";
32
41
  import {
33
42
  output
34
43
  } from "./chunks/chunk-T5HJUAWB.js";
35
- import "./chunks/chunk-GSGZHE26.js";
44
+ import "./chunks/chunk-XEDGMZJD.js";
36
45
  import {
37
46
  external_exports
38
47
  } from "./chunks/chunk-IKT5F47M.js";
@@ -42,15 +51,7 @@ import "./chunks/chunk-3MZYUBJ6.js";
42
51
  import { Agent, setGlobalDispatcher } from "undici";
43
52
 
44
53
  // src/program.ts
45
- import { Command as Command52 } from "commander";
46
-
47
- // package.json
48
- var name = "@scalar/cli";
49
- var version = "2.5.1";
50
- var bin = {
51
- scalar: "./dist/index.js",
52
- "scalar-cli": "./dist/index.js"
53
- };
54
+ import { Command as Command53 } from "commander";
54
55
 
55
56
  // src/domains/schema/index.ts
56
57
  import { Command as Command6 } from "commander";
@@ -58,97 +59,101 @@ import { Command as Command6 } from "commander";
58
59
  // src/domains/schema/delete.ts
59
60
  import { Command } from "commander";
60
61
  var DeleteSchemaCommand = () => {
61
- const cmd2 = new Command("delete");
62
- cmd2.description("Delete a schema.");
63
- cmd2.option("-s, --slug <slug>", "Schema slug");
64
- cmd2.option("-n, --namespace <namespace>", "Team namespace");
65
- cmd2.action(async (...args) => {
66
- const { deleteAction } = await import("./chunks/delete.action-7GOZY7ID.js");
62
+ const cmd3 = new Command("delete");
63
+ cmd3.description("Delete a schema.");
64
+ cmd3.option("-s, --slug <slug>", "Schema slug");
65
+ cmd3.option("-n, --namespace <namespace>", "Team namespace");
66
+ cmd3.action(async (...args) => {
67
+ const { deleteAction } = await import("./chunks/delete.action-Z3GAA4ZN.js");
67
68
  return deleteAction(...args);
68
69
  });
69
- return cmd2;
70
+ return cmd3;
70
71
  };
71
72
 
72
73
  // src/domains/schema/get.ts
73
74
  import { Command as Command2 } from "commander";
74
75
  var GetSchemaCommand = () => {
75
- const cmd2 = new Command2("get");
76
- cmd2.description("Get a schema document version from the Scalar registry");
77
- cmd2.argument("[namespace]", "Team namespace");
78
- cmd2.argument("[slug]", "Schema slug");
79
- cmd2.option("--version <version>", "Schema version (defaults to latest)");
80
- cmd2.option("--format <format>", "Output format (json or yaml)", "json");
81
- cmd2.option("-o, --output <file>", "Output file (defaults to stdout)");
82
- cmd2.action(async (...args) => {
83
- const { getAction } = await import("./chunks/get.action-2745EB4N.js");
76
+ const cmd3 = new Command2("get");
77
+ cmd3.description("Get a schema document version from the Scalar registry");
78
+ cmd3.argument("[namespace]", "Team namespace");
79
+ cmd3.argument("[slug]", "Schema slug");
80
+ cmd3.option("--version <version>", "Schema version (defaults to latest)");
81
+ cmd3.option("--format <format>", "Output format (json or yaml)", "json");
82
+ cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
83
+ cmd3.action(async (...args) => {
84
+ const { getAction } = await import("./chunks/get.action-IT4EHAV4.js");
84
85
  return getAction(...args);
85
86
  });
86
- return cmd2;
87
+ return cmd3;
87
88
  };
88
89
 
89
90
  // src/domains/schema/list.ts
90
91
  import { Command as Command3 } from "commander";
91
92
  var ListSchemaCommand = () => {
92
- const cmd2 = new Command3("list");
93
- cmd2.description("List all schemas for a team namespace");
94
- cmd2.option("--namespace <namespace>", "Team namespace");
95
- cmd2.action(async (...args) => {
96
- const { listAction } = await import("./chunks/list.action-4QDCZLSZ.js");
93
+ const cmd3 = new Command3("list");
94
+ cmd3.description("List all schemas for a team namespace");
95
+ cmd3.option("--namespace <namespace>", "Team namespace");
96
+ cmd3.action(async (...args) => {
97
+ const { listAction } = await import("./chunks/list.action-2FU5UZNH.js");
97
98
  return listAction(...args);
98
99
  });
99
- return cmd2;
100
+ return cmd3;
100
101
  };
101
102
 
102
103
  // src/domains/schema/publish.ts
103
104
  import { Command as Command4 } from "commander";
104
105
  var PublishSchemaCommand = () => {
105
- const cmd2 = new Command4("publish");
106
- cmd2.description("Publish a shared schema to the Scalar registry");
107
- cmd2.argument("[file]", "OpenAPI file to upload");
108
- cmd2.option(
106
+ const cmd3 = new Command4("publish");
107
+ cmd3.description("Publish a shared schema to the Scalar registry");
108
+ cmd3.argument("[file]", "OpenAPI file to upload");
109
+ cmd3.option(
109
110
  "--slug <slug>",
110
111
  "Slug identifier for the registry entry. Defaults to title."
111
112
  );
112
- cmd2.option("--title <title>", "Schema title");
113
- cmd2.option("--namespace <namespace>", "Scalar team namespace");
114
- cmd2.option("--version <version>", "API version (e.g. 0.1.0)");
115
- cmd2.option("--private", "Make API private", false);
116
- cmd2.option("--force", "Force override an existing version", false);
117
- cmd2.option("--bundle", "Bundle all external references before uploading");
118
- cmd2.option(
113
+ cmd3.option("--title <title>", "Schema title");
114
+ cmd3.option("--namespace <namespace>", "Scalar team namespace");
115
+ cmd3.option("--version <version>", "API version (e.g. 0.1.0)");
116
+ cmd3.option("--private", "Make API private", false);
117
+ cmd3.option("--force", "Force override an existing version", false);
118
+ cmd3.option("--bundle", "Bundle all external references before uploading");
119
+ cmd3.option(
119
120
  "--treeShake",
120
121
  "Remove unused components from the bundled document"
121
122
  );
122
- cmd2.option(
123
+ cmd3.option(
123
124
  "--urlMap",
124
125
  "Generate a map of resolved URLs when bundling the document"
125
126
  );
126
- cmd2.option(
127
+ cmd3.option(
127
128
  "--fetchLimit <limit>",
128
- "Maximum number of concurrent URLs to fetch when bundling the document"
129
+ "Maximum number of concurrent URLs to fetch when bundling the document",
130
+ parseFetchLimit
129
131
  );
130
- cmd2.action(async (...args) => {
131
- const { publishAction } = await import("./chunks/publish.action-ULQLZKWU.js");
132
+ cmd3.action(async (...args) => {
133
+ const { publishAction } = await import("./chunks/publish.action-T4J4DRXR.js");
132
134
  return publishAction(...args);
133
135
  });
134
- return cmd2;
136
+ return cmd3;
135
137
  };
136
138
 
137
139
  // src/domains/schema/update.ts
138
140
  import { Command as Command5 } from "commander";
139
141
  var UpdateSchemaCommand = () => {
140
- const cmd2 = new Command5("update");
141
- cmd2.description("Update schema metadata.");
142
- cmd2.option("-s, --slug <slug>", "Schema slug");
143
- cmd2.option("-n, --namespace <namespace>", "Team namespace");
144
- cmd2.option("--title <title>", "Title");
145
- cmd2.option("--description <description>", "Description");
146
- cmd2.option("--isPrivate <isPrivate>", "Privacy (public/private)");
147
- cmd2.action(async (...args) => {
148
- const { updateAction } = await import("./chunks/update.action-6QEFP7NA.js");
142
+ const cmd3 = new Command5("update");
143
+ cmd3.description("Update schema metadata.");
144
+ cmd3.option("-s, --slug <slug>", "Schema slug");
145
+ cmd3.option("-n, --namespace <namespace>", "Team namespace");
146
+ cmd3.option("--title <title>", "Title");
147
+ cmd3.option("--description <description>", "Description");
148
+ cmd3.option(
149
+ "--isPrivate <isPrivate>",
150
+ "Privacy (true/false or public/private)"
151
+ );
152
+ cmd3.action(async (...args) => {
153
+ const { updateAction } = await import("./chunks/update.action-MY7QPSSU.js");
149
154
  return updateAction(...args);
150
155
  });
151
- return cmd2;
156
+ return cmd3;
152
157
  };
153
158
 
154
159
  // src/domains/schema/index.ts
@@ -170,78 +175,85 @@ import { Command as Command12 } from "commander";
170
175
  // src/domains/sdk/build.ts
171
176
  import { Command as Command7 } from "commander";
172
177
  var BuildSdkCommand = () => {
173
- const cmd2 = new Command7("build");
174
- cmd2.description("Create an SDK build.");
175
- cmd2.option("-s, --slug <slug>", "SDK slug");
176
- cmd2.option("-n, --namespace <namespace>", "Team namespace");
177
- cmd2.option("-v, --version <version>", "SDK Version");
178
- cmd2.action(async (...args) => {
179
- const { buildAction } = await import("./chunks/build.action-P7FCIMYU.js");
178
+ const cmd3 = new Command7("build");
179
+ cmd3.description("Build an SDK.");
180
+ cmd3.option("-s, --slug <slug>", "SDK slug");
181
+ cmd3.option("-n, --namespace <namespace>", "Team namespace");
182
+ cmd3.action(async (...args) => {
183
+ const { buildAction } = await import("./chunks/build.action-6V6GXI3X.js");
180
184
  return buildAction(...args);
181
185
  });
182
- return cmd2;
186
+ return cmd3;
183
187
  };
184
188
 
185
189
  // src/domains/sdk/create.ts
186
190
  import { Command as Command8, Option } from "commander";
187
191
  var CreateSdkCommand = () => {
188
- const cmd2 = new Command8("create");
189
- cmd2.description("Create a new SDK.");
190
- cmd2.option("-a, --api <api>", "Registry API slug");
191
- cmd2.option("-n, --namespace <namespace>", "Team namespace");
192
- cmd2.addOption(
192
+ const cmd3 = new Command8("create");
193
+ cmd3.description(
194
+ "Create a new SDK. The SDK is created in the namespace of the API it is built from."
195
+ );
196
+ cmd3.option("-a, --api <api>", "Registry API slug");
197
+ cmd3.option(
198
+ "-n, --namespace <namespace>",
199
+ "Team namespace to look the API up in"
200
+ );
201
+ cmd3.addOption(
193
202
  new Option("-l, --language <language>", "Language of your SDK").choices(
194
203
  Object.values(SdkLanguage)
195
204
  )
196
205
  );
197
- cmd2.action(async (...args) => {
198
- const { createAction } = await import("./chunks/create.action-HDD2WUON.js");
206
+ cmd3.action(async (...args) => {
207
+ const { createAction } = await import("./chunks/create.action-P6DLCK4W.js");
199
208
  return createAction(...args);
200
209
  });
201
- return cmd2;
210
+ return cmd3;
202
211
  };
203
212
 
204
213
  // src/domains/sdk/delete.ts
205
214
  import { Command as Command9 } from "commander";
206
215
  var DeleteSdkCommand = () => {
207
- const cmd2 = new Command9("delete");
208
- cmd2.description("Delete an SDK.");
209
- cmd2.option("-s, --slug <slug>", "SDK slug");
210
- cmd2.option("-n, --namespace <namespace>", "Team namespace");
211
- cmd2.action(async (...args) => {
212
- const { deleteAction } = await import("./chunks/delete.action-VE66JFDS.js");
216
+ const cmd3 = new Command9("delete");
217
+ cmd3.description("Delete an SDK.");
218
+ cmd3.option("-s, --slug <slug>", "SDK slug");
219
+ cmd3.option("-n, --namespace <namespace>", "Team namespace");
220
+ cmd3.action(async (...args) => {
221
+ const { deleteAction } = await import("./chunks/delete.action-HJKRRHE2.js");
213
222
  return deleteAction(...args);
214
223
  });
215
- return cmd2;
224
+ return cmd3;
216
225
  };
217
226
 
218
227
  // src/domains/sdk/update.ts
219
228
  import { Command as Command10 } from "commander";
220
229
  var UpdateSdkCommand = () => {
221
- const cmd2 = new Command10("update");
222
- cmd2.description("Update SDK metadata.");
223
- cmd2.option("-s, --slug <slug>", "SDK slug");
224
- cmd2.option("-n, --namespace <namespace>", "Team namespace");
225
- cmd2.option("--title <title>", "Title");
226
- cmd2.option("--isPrivate <isPrivate>", "Privacy (public/private)");
227
- cmd2.action(async (...args) => {
228
- const { updateAction } = await import("./chunks/update.action-OROQSP2S.js");
230
+ const cmd3 = new Command10("update");
231
+ cmd3.description("Update SDK metadata.");
232
+ cmd3.option("-s, --slug <slug>", "SDK slug");
233
+ cmd3.option("-n, --namespace <namespace>", "Team namespace");
234
+ cmd3.option("--title <title>", "Title");
235
+ cmd3.option(
236
+ "--isPrivate <isPrivate>",
237
+ "Privacy (true/false or public/private)"
238
+ );
239
+ cmd3.action(async (...args) => {
240
+ const { updateAction } = await import("./chunks/update.action-3OVS3HWC.js");
229
241
  return updateAction(...args);
230
242
  });
231
- return cmd2;
243
+ return cmd3;
232
244
  };
233
245
 
234
246
  // src/domains/sdk/list.ts
235
247
  import { Command as Command11 } from "commander";
236
248
  var ListSdkCommand = () => {
237
- const cmd2 = new Command11("list");
238
- cmd2.description("List all SDKs for a team namespace");
239
- cmd2.option("--namespace <namespace>", "Team namespace");
240
- cmd2.action(async (...args) => {
241
- const { listAction } = await import("./chunks/list.action-3VTXQJRA.js");
249
+ const cmd3 = new Command11("list");
250
+ cmd3.description("List all SDKs for a team namespace");
251
+ cmd3.option("--namespace <namespace>", "Team namespace");
252
+ cmd3.action(async (...args) => {
253
+ const { listAction } = await import("./chunks/list.action-WLIAO5UW.js");
242
254
  return listAction(...args);
243
255
  });
244
- return cmd2;
256
+ return cmd3;
245
257
  };
246
258
 
247
259
  // src/domains/sdk/index.ts
@@ -263,43 +275,43 @@ import { Command as Command16 } from "commander";
263
275
  // src/domains/auth/login/index.ts
264
276
  import { Command as Command13 } from "commander";
265
277
  var LoginCommand = () => {
266
- const cmd2 = new Command13("login");
267
- cmd2.description("Login to scalar");
268
- cmd2.option("--email <email>", "Email");
269
- cmd2.option("--password <password>", "Password");
270
- cmd2.option("--token <token>", "Personal token");
271
- cmd2.action(async (...args) => {
272
- const { loginAction } = await import("./chunks/action-4XI7XJR4.js");
278
+ const cmd3 = new Command13("login");
279
+ cmd3.description("Login to scalar");
280
+ cmd3.option("--email <email>", "Email");
281
+ cmd3.option("--password <password>", "Password");
282
+ cmd3.option("--token <token>", "Personal token");
283
+ cmd3.action(async (...args) => {
284
+ const { loginAction } = await import("./chunks/action-N7BA5I3E.js");
273
285
  return loginAction(...args);
274
286
  });
275
- return cmd2;
287
+ return cmd3;
276
288
  };
277
289
 
278
290
  // src/domains/auth/logout/index.ts
279
291
  import { Command as Command14 } from "commander";
280
292
  var LogoutCommand = () => {
281
- const cmd2 = new Command14("logout");
282
- cmd2.description("Logout from scalar");
283
- cmd2.action(async () => {
293
+ const cmd3 = new Command14("logout");
294
+ cmd3.description("Logout from scalar");
295
+ cmd3.action(async () => {
284
296
  await clearAuthData();
285
297
  output.info().message("Successfully logged out.").print();
286
298
  });
287
- return cmd2;
299
+ return cmd3;
288
300
  };
289
301
 
290
302
  // src/domains/auth/whoami/index.ts
291
303
  import as from "ansis";
292
304
  import { Command as Command15 } from "commander";
293
305
  var WhoAmICommand = () => {
294
- const cmd2 = new Command15("whoami");
295
- cmd2.description("Display the current user");
296
- cmd2.action(async () => {
306
+ const cmd3 = new Command15("whoami");
307
+ cmd3.description("Display the current user");
308
+ cmd3.action(async () => {
297
309
  const auth = await getAuthData();
298
310
  output.info().message(
299
311
  `You are logged in as ${as.cyan(auth.email ?? "")} (role: ${as.cyan(auth.role ?? "Owner")})`
300
312
  ).line().print();
301
313
  });
302
- return cmd2;
314
+ return cmd3;
303
315
  };
304
316
 
305
317
  // src/domains/auth/index.ts
@@ -309,201 +321,226 @@ authDomain.description("Manage authorization on scalar platform");
309
321
  authCommands.forEach((command) => authDomain.addCommand(command()));
310
322
  var auth_default = authDomain;
311
323
 
324
+ // src/domains/context/index.ts
325
+ import { Command as Command17 } from "commander";
326
+ var cmd = new Command17("context");
327
+ cmd.description(
328
+ "Print every command, argument, and option as JSON for AI agents"
329
+ );
330
+ cmd.action(async () => {
331
+ const { contextAction } = await import("./chunks/action-F2ZJNURT.js");
332
+ return contextAction(cmd);
333
+ });
334
+ var context_default = cmd;
335
+
312
336
  // src/domains/document/index.ts
313
- import { Command as Command29 } from "commander";
337
+ import { Command as Command30 } from "commander";
314
338
 
315
339
  // src/domains/document/join/index.ts
316
- import { Command as Command17 } from "commander";
340
+ import { Command as Command18 } from "commander";
317
341
  function JoinCommand() {
318
- const cmd2 = new Command17("join");
319
- cmd2.description(
342
+ const cmd3 = new Command18("join");
343
+ cmd3.description(
320
344
  "Merge multiple OpenAPI or AsyncAPI documents into a single unified document"
321
345
  );
322
- cmd2.argument("<files...>", "Paths to the OpenAPI or AsyncAPI files to merge");
323
- cmd2.option("--output -o <file>", "Path to save the merged output file");
324
- cmd2.option(
346
+ 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");
348
+ cmd3.option(
325
349
  "--prefix-components-with-path-value -p <path>",
326
350
  "Dot-separated path to extract a prefix value from each input file for component names"
327
351
  );
328
- cmd2.action(async (...args) => {
329
- const { joinAction } = await import("./chunks/action-QE2ZQQX7.js");
352
+ cmd3.action(async (...args) => {
353
+ const { joinAction } = await import("./chunks/action-7PEQXDWT.js");
330
354
  return joinAction(...args);
331
355
  });
332
- return cmd2;
356
+ return cmd3;
333
357
  }
334
358
 
335
359
  // src/domains/document/split/index.ts
336
- import { Command as Command18 } from "commander";
360
+ import { Command as Command19 } from "commander";
337
361
  function SplitCommand() {
338
- const cmd2 = new Command18("split");
339
- cmd2.description("Split OpenAPI or AsyncAPI documents into small chunks");
340
- cmd2.argument("[file|url]", "Path to OpenAPI or AsyncAPI file or URL to split");
341
- cmd2.option("-o, --output <path>", "Path to save the chunks");
342
- cmd2.addHelpText(
362
+ const cmd3 = new Command19("split");
363
+ cmd3.description("Split OpenAPI or AsyncAPI documents into small chunks");
364
+ cmd3.argument("[file|url]", "Path to OpenAPI or AsyncAPI file or URL to split");
365
+ cmd3.option("-o, --output <path>", "Path to save the chunks");
366
+ cmd3.addHelpText(
343
367
  "after",
344
368
  "\nAsyncAPI versions are preserved (including 2.6, 3.0, and 3.1). External references are bundled before splitting.\n"
345
369
  );
346
- cmd2.action(async (...args) => {
347
- const { splitAction } = await import("./chunks/action-FIXBOJEW.js");
370
+ cmd3.action(async (...args) => {
371
+ const { splitAction } = await import("./chunks/action-YRX6SN5F.js");
348
372
  return splitAction(...args);
349
373
  });
350
- return cmd2;
374
+ return cmd3;
351
375
  }
352
376
 
353
377
  // src/domains/document/format/index.ts
354
- import { Command as Command19 } from "commander";
378
+ import { Command as Command20 } from "commander";
355
379
  function FormatCommand() {
356
- const cmd2 = new Command19("format");
357
- cmd2.description("Format an OpenAPI or AsyncAPI file");
358
- cmd2.argument("[file|url]", "File or URL to format");
359
- cmd2.option("-o, --output <file>", "Output file");
360
- cmd2.action(async (...args) => {
361
- const { formatAction } = await import("./chunks/action-SH4UUXPL.js");
380
+ const cmd3 = new Command20("format");
381
+ cmd3.description("Format an OpenAPI or AsyncAPI file");
382
+ cmd3.argument("[file|url]", "File or URL to format");
383
+ cmd3.option("-o, --output <file>", "Output file");
384
+ cmd3.action(async (...args) => {
385
+ const { formatAction } = await import("./chunks/action-H6OUJWWM.js");
362
386
  return formatAction(...args);
363
387
  });
364
- return cmd2;
388
+ return cmd3;
365
389
  }
366
390
 
367
391
  // src/domains/document/lint/index.ts
368
- import { Command as Command20 } from "commander";
392
+ import { Command as Command21 } from "commander";
369
393
  function LintCommand() {
370
- const cmd2 = new Command20("lint");
371
- cmd2.description("Lint your OpenAPI or AsyncAPI file using spectral rules");
372
- cmd2.argument("[file|url]", "OpenAPI or AsyncAPI file path or url");
373
- cmd2.option("-r, --rule <file|url>", "Rule path or url");
374
- cmd2.action(async (...args) => {
375
- const { lintAction } = await import("./chunks/action-LA6KVAXQ.js");
394
+ const cmd3 = new Command21("lint");
395
+ cmd3.description("Lint your OpenAPI or AsyncAPI file using spectral rules");
396
+ cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file path or url");
397
+ cmd3.option("-r, --rule <file|url>", "Rule path or url");
398
+ cmd3.action(async (...args) => {
399
+ const { lintAction } = await import("./chunks/action-JAHFRYWZ.js");
376
400
  return lintAction(...args);
377
401
  });
378
- return cmd2;
402
+ return cmd3;
379
403
  }
380
404
 
381
405
  // src/domains/document/markdown/index.ts
382
- import { Command as Command21 } from "commander";
406
+ import { Command as Command22 } from "commander";
383
407
  function MarkdownCommand() {
384
- const cmd2 = new Command21("markdown");
385
- cmd2.description("Generate Markdown from an OpenAPI file");
386
- cmd2.argument("[file|url]", "OpenAPI file path or URL to convert");
387
- cmd2.option("-o, --output <file>", "Output file (defaults to stdout)");
388
- cmd2.action(async (...args) => {
389
- const { markdownAction } = await import("./chunks/action-G26LSVZ7.js");
408
+ const cmd3 = new Command22("markdown");
409
+ cmd3.description("Generate Markdown from an OpenAPI file");
410
+ cmd3.argument("[file|url]", "OpenAPI file path or URL to convert");
411
+ cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
412
+ cmd3.action(async (...args) => {
413
+ const { markdownAction } = await import("./chunks/action-VOFDW3U2.js");
390
414
  return markdownAction(...args);
391
415
  });
392
- return cmd2;
416
+ return cmd3;
393
417
  }
394
418
 
395
419
  // src/domains/document/mock/index.ts
396
- import { Command as Command22 } from "commander";
420
+ import { Command as Command23 } from "commander";
397
421
  function MockCommand() {
398
- const cmd2 = new Command22("mock");
399
- cmd2.description("Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels");
400
- cmd2.argument("[file|url]", "OpenAPI or AsyncAPI file or URL to mock");
401
- cmd2.option("-w, --watch", "watch the file for changes");
402
- cmd2.option("-o, --once", "run the server only once and exit after that");
403
- cmd2.option("-p, --port <port>", "set the HTTP port for the mock server");
404
- cmd2.action(async (...args) => {
405
- const { mockAction } = await import("./chunks/action-R7IMFHQ5.js");
422
+ const cmd3 = new Command23("mock");
423
+ cmd3.description("Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels");
424
+ cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file or URL to mock");
425
+ cmd3.option("-w, --watch", "watch the file for changes");
426
+ cmd3.option("-o, --once", "run the server only once and exit after that");
427
+ cmd3.option(
428
+ "-p, --port <port>",
429
+ "set the HTTP port for the mock server",
430
+ parsePort
431
+ );
432
+ cmd3.action(async (...args) => {
433
+ const { mockAction } = await import("./chunks/action-ATGZOWSH.js");
406
434
  return mockAction(...args);
407
435
  });
408
- return cmd2;
436
+ return cmd3;
409
437
  }
410
438
 
411
439
  // src/domains/document/postman/index.ts
412
- import { Command as Command23 } from "commander";
440
+ import { Command as Command24 } from "commander";
413
441
  function ConvertCommand() {
414
- const cmd2 = new Command23("convert");
415
- cmd2.description("Convert a Postman collection to an OpenAPI document");
416
- cmd2.argument("[file|url]", "Postman collection file path or URL to convert");
417
- cmd2.option("-o, --output <file>", "Output file (defaults to stdout)");
418
- cmd2.option(
442
+ const cmd3 = new Command24("convert");
443
+ cmd3.description("Convert a Postman collection to an OpenAPI document");
444
+ cmd3.argument("[file|url]", "Postman collection file path or URL to convert");
445
+ cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
446
+ cmd3.option(
419
447
  "--merge-operations",
420
448
  "Merge operations with shared path+method combinations"
421
449
  );
422
- cmd2.action(async (...args) => {
423
- const { convertAction } = await import("./chunks/action-5IU77OII.js");
450
+ cmd3.action(async (...args) => {
451
+ const { convertAction } = await import("./chunks/action-F7A2K74G.js");
424
452
  return convertAction(...args);
425
453
  });
426
- return cmd2;
454
+ return cmd3;
427
455
  }
428
456
 
429
457
  // src/domains/document/serve/index.ts
430
- import { Command as Command24 } from "commander";
458
+ import { Command as Command25 } from "commander";
431
459
  function ServeCommand() {
432
- const cmd2 = new Command24("serve");
433
- cmd2.description("Serve an API Reference from an OpenAPI or AsyncAPI file");
434
- cmd2.argument(
460
+ const cmd3 = new Command25("serve");
461
+ cmd3.description("Serve an API Reference from an OpenAPI or AsyncAPI file");
462
+ cmd3.argument(
435
463
  "[file|url]",
436
464
  "OpenAPI or AsyncAPI file or URL to show the reference for"
437
465
  );
438
- cmd2.option("-w, --watch", "watch the file for changes");
439
- cmd2.option("-o, --once", "run the server only once and exit after that");
440
- cmd2.option(
466
+ cmd3.option(
467
+ "-c, --config <file>",
468
+ "JSON file with API Reference configuration"
469
+ );
470
+ cmd3.option("-w, --watch", "watch the file for changes");
471
+ cmd3.option("-o, --once", "run the server only once and exit after that");
472
+ cmd3.option(
441
473
  "-p, --port <port>",
442
- "set the HTTP port for the API reference server"
474
+ "set the HTTP port for the API reference server",
475
+ parsePort
443
476
  );
444
- cmd2.action(async (...args) => {
445
- const { serveAction } = await import("./chunks/action-M7RQKBSB.js");
477
+ cmd3.action(async (...args) => {
478
+ const { serveAction } = await import("./chunks/action-BOZNBCNZ.js");
446
479
  return serveAction(...args);
447
480
  });
448
- return cmd2;
481
+ return cmd3;
449
482
  }
450
483
 
451
484
  // src/domains/document/share/index.ts
452
- import { Command as Command25 } from "commander";
485
+ import { Command as Command26 } from "commander";
453
486
  function ShareCommand() {
454
- const cmd2 = new Command25("share");
455
- cmd2.description("Share an OpenAPI or AsyncAPI file");
456
- cmd2.argument("[file]", "file to share");
457
- cmd2.option(
487
+ const cmd3 = new Command26("share");
488
+ cmd3.description("Share an OpenAPI or AsyncAPI file");
489
+ cmd3.argument("[file]", "file to share");
490
+ cmd3.option(
458
491
  "-t, --token <token>",
459
492
  "pass a token to update an existing sandbox"
460
493
  );
461
- cmd2.action(async (...args) => {
462
- const { shareAction } = await import("./chunks/action-SNLCIBQC.js");
494
+ cmd3.action(async (...args) => {
495
+ const { shareAction } = await import("./chunks/action-HJYZCPUN.js");
463
496
  return shareAction(...args);
464
497
  });
465
- return cmd2;
498
+ return cmd3;
466
499
  }
467
500
 
468
501
  // src/domains/document/upgrade/index.ts
469
- import { Command as Command26 } from "commander";
502
+ import { Command as Command27 } from "commander";
470
503
  function UpgradeCommand() {
471
- const cmd2 = new Command26("upgrade");
472
- cmd2.description("Upgrade an OpenAPI or AsyncAPI document to version 3.1");
473
- cmd2.argument("[file|url]", "File or URL to upgrade");
474
- cmd2.option("-o, --output <file>", "Path to save the upgraded output file");
475
- cmd2.action(async (...args) => {
476
- const { upgradeAction } = await import("./chunks/action-FDB7NEOK.js");
504
+ const cmd3 = new Command27("upgrade");
505
+ cmd3.description("Upgrade an OpenAPI or AsyncAPI document to version 3.1");
506
+ cmd3.argument("[file|url]", "File or URL to upgrade");
507
+ cmd3.option("-o, --output <file>", "Path to save the upgraded output file");
508
+ cmd3.action(async (...args) => {
509
+ const { upgradeAction } = await import("./chunks/action-5SK5NE7E.js");
477
510
  return upgradeAction(...args);
478
511
  });
479
- return cmd2;
512
+ return cmd3;
480
513
  }
481
514
 
482
515
  // src/domains/document/validate/index.ts
483
- import { Command as Command27 } from "commander";
516
+ import { Command as Command28 } from "commander";
484
517
  function ValidateCommand() {
485
- const cmd2 = new Command27("validate");
486
- cmd2.description("Validate an OpenAPI or AsyncAPI file");
487
- cmd2.argument("[file|url]", "File or URL to validate");
488
- cmd2.action(async (...args) => {
489
- const { validateAction } = await import("./chunks/action-B3KKREWQ.js");
518
+ const cmd3 = new Command28("validate");
519
+ cmd3.description("Validate an OpenAPI or AsyncAPI file");
520
+ cmd3.argument("[file|url]", "File or URL to validate");
521
+ cmd3.action(async (...args) => {
522
+ const { validateAction } = await import("./chunks/action-AQRPFQKI.js");
490
523
  return validateAction(...args);
491
524
  });
492
- return cmd2;
525
+ return cmd3;
493
526
  }
494
527
 
495
528
  // src/domains/document/void/index.ts
496
- import { Command as Command28 } from "commander";
529
+ import { Command as Command29 } from "commander";
497
530
  function VoidCommand() {
498
- const cmd2 = new Command28("void");
499
- cmd2.description("Boot a server to mirror HTTP requests");
500
- cmd2.option("-o, --once", "run the server only once and exit after that");
501
- cmd2.option("-p, --port <port>", "set the HTTP port for the mock server");
502
- cmd2.action(async (...args) => {
531
+ const cmd3 = new Command29("void");
532
+ cmd3.description("Boot a server to mirror HTTP requests");
533
+ cmd3.option("-o, --once", "run the server only once and exit after that");
534
+ cmd3.option(
535
+ "-p, --port <port>",
536
+ "set the HTTP port for the mock server",
537
+ parsePort
538
+ );
539
+ cmd3.action(async (...args) => {
503
540
  const { voidAction } = await import("./chunks/action-H3RTILLM.js");
504
541
  return voidAction(...args);
505
542
  });
506
- return cmd2;
543
+ return cmd3;
507
544
  }
508
545
 
509
546
  // src/domains/document/index.ts
@@ -522,172 +559,165 @@ var documentCommands = [
522
559
  LintCommand,
523
560
  UpgradeCommand
524
561
  ];
525
- var documentDomain = new Command29("document");
562
+ var documentDomain = new Command30("document");
526
563
  documentDomain.description("Manage local openapi file");
527
564
  documentCommands.forEach((command) => documentDomain.addCommand(command()));
528
565
  var document_default = documentDomain;
529
566
 
530
567
  // src/domains/project/index.ts
531
- import { Command as Command39 } from "commander";
568
+ import { Command as Command40 } from "commander";
532
569
 
533
570
  // src/domains/project/preview/index.ts
534
- import { Command as Command30 } from "commander";
571
+ import { Command as Command31, Option as Option2 } from "commander";
535
572
  var PreviewCommand = () => {
536
- const cmd2 = new Command30("preview");
537
- cmd2.description("Preview scalar guides");
538
- cmd2.argument(
573
+ const cmd3 = new Command31("preview");
574
+ cmd3.description("Preview scalar guides");
575
+ cmd3.argument(
539
576
  "[config]",
540
577
  "Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
541
578
  );
542
- cmd2.option(
579
+ cmd3.option(
543
580
  "-p, --port [port]",
544
581
  "port to run the server on. If the port is not available, it will select another one.",
545
582
  "7970"
546
583
  );
547
- cmd2.option(
548
- "-h, --host [host]",
584
+ cmd3.option(
585
+ "-H, --host [host]",
549
586
  "Specify which IP addresses the server should listen on."
550
587
  );
551
- cmd2.option(
552
- "-L, --log-level <level>",
553
- "Set the log level (debug, info, warn, error, trace)",
554
- "info"
555
- );
556
- cmd2.option(
557
- "-F, --log-formatting <formatting>",
558
- "Set the log formatting (pretty|none). Defaults to pretty formatting outside of CI.",
559
- "pretty"
588
+ cmd3.addOption(
589
+ new Option2("-L, --log-level <level>", "Set the log level").choices(["debug", "info"]).default("info")
560
590
  );
561
- cmd2.option("-N, --no-open", "Do not open the browser automatically", true);
562
- cmd2.action(async (...args) => {
563
- const { previewAction } = await import("./chunks/action-SQG3JAII.js");
591
+ cmd3.option("-N, --no-open", "Do not open the browser automatically", true);
592
+ cmd3.action(async (...args) => {
593
+ const { previewAction } = await import("./chunks/action-E4YSRFGT.js");
564
594
  return previewAction(...args);
565
595
  });
566
- return cmd2;
596
+ return cmd3;
567
597
  };
568
598
 
569
599
  // src/domains/project/check-config/index.ts
570
- import { Command as Command31 } from "commander";
600
+ import { Command as Command32 } from "commander";
571
601
  function CheckConfigCommand() {
572
- const cmd2 = new Command31("check-config");
573
- cmd2.description("Check a Scalar Configuration file");
574
- cmd2.argument("[file]", "File to check");
575
- cmd2.action(async (...args) => {
576
- const { checkConfigAction } = await import("./chunks/action-NVSZT2ZD.js");
602
+ const cmd3 = new Command32("check-config");
603
+ cmd3.description("Check a Scalar Configuration file");
604
+ cmd3.argument("[file]", "File to check");
605
+ cmd3.action(async (...args) => {
606
+ const { checkConfigAction } = await import("./chunks/action-NVI5DWFP.js");
577
607
  return checkConfigAction(...args);
578
608
  });
579
- return cmd2;
609
+ return cmd3;
580
610
  }
581
611
 
582
612
  // src/domains/project/create/index.ts
583
- import { Command as Command32 } from "commander";
613
+ import { Command as Command33 } from "commander";
584
614
  var CreateCommand = () => {
585
- const cmd2 = new Command32("create");
586
- cmd2.description(
615
+ const cmd3 = new Command33("create");
616
+ cmd3.description(
587
617
  "Create a new project that is not linked to a github project."
588
618
  );
589
- cmd2.option("-n, --name [name]", "name of your project");
590
- cmd2.option("-s, --slug [slug]", "project slug");
591
- cmd2.action(async (...args) => {
592
- const { createAction } = await import("./chunks/action-VC4DCVST.js");
619
+ cmd3.option("-n, --name <name>", "name of your project");
620
+ cmd3.option("-s, --slug <slug>", "project slug");
621
+ cmd3.action(async (...args) => {
622
+ const { createAction } = await import("./chunks/action-LVDU6YOI.js");
593
623
  return createAction(...args);
594
624
  });
595
- return cmd2;
625
+ return cmd3;
596
626
  };
597
627
 
598
628
  // src/domains/project/deployments/index.ts
599
- import { Command as Command34 } from "commander";
629
+ import { Command as Command35 } from "commander";
600
630
 
601
631
  // src/domains/project/deployments/list/index.ts
602
- import { Command as Command33 } from "commander";
632
+ import { Command as Command34 } from "commander";
603
633
  var ListCommand = () => {
604
- const cmd2 = new Command33("list");
605
- cmd2.description("List the production deployment history for a project.");
606
- cmd2.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
607
- cmd2.action(async (...args) => {
608
- const { listAction } = await import("./chunks/action-JZLZ7ZAD.js");
634
+ const cmd3 = new Command34("list");
635
+ cmd3.description("List the production deployment history for a project.");
636
+ cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
637
+ cmd3.action(async (...args) => {
638
+ const { listAction } = await import("./chunks/action-CPLH2CQ5.js");
609
639
  return listAction(...args);
610
640
  });
611
- return cmd2;
641
+ return cmd3;
612
642
  };
613
643
 
614
644
  // src/domains/project/deployments/index.ts
615
645
  var DeploymentsCommand = () => {
616
- const cmd2 = new Command34("deployments");
617
- cmd2.description("Inspect a project deployment history.");
618
- cmd2.addCommand(ListCommand());
619
- return cmd2;
646
+ const cmd3 = new Command35("deployments");
647
+ cmd3.description("Inspect a project deployment history.");
648
+ cmd3.addCommand(ListCommand());
649
+ return cmd3;
620
650
  };
621
651
 
622
652
  // src/domains/project/init/index.ts
623
- import { Command as Command35 } from "commander";
653
+ import { Command as Command36 } from "commander";
624
654
  var InitCommand = () => {
625
- const cmd2 = new Command35("init");
626
- cmd2.description("Create a new Scalar Docs project.");
627
- cmd2.option("-s, --subdomain [url]", "subdomain to publish on");
628
- cmd2.option("--force", "override existing configuration");
629
- cmd2.action(async (...args) => {
630
- const { initAction } = await import("./chunks/action-IUE4IOWO.js");
655
+ const cmd3 = new Command36("init");
656
+ cmd3.description("Create a new Scalar Docs project.");
657
+ cmd3.option("-s, --subdomain [url]", "subdomain to publish on");
658
+ cmd3.option("--force", "override existing configuration");
659
+ cmd3.action(async (...args) => {
660
+ const { initAction } = await import("./chunks/action-RBOLLIGX.js");
631
661
  return initAction(...args);
632
662
  });
633
- return cmd2;
663
+ return cmd3;
634
664
  };
635
665
 
636
666
  // src/domains/project/publish/index.ts
637
- import { Command as Command36 } from "commander";
667
+ import { Command as Command37 } from "commander";
638
668
  var PublishCommand = () => {
639
- const cmd2 = new Command36("publish");
640
- cmd2.description(
669
+ const cmd3 = new Command37("publish");
670
+ cmd3.description(
641
671
  "Publish new build for a github sync project that is not linked."
642
672
  );
643
- cmd2.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
644
- cmd2.option("-c, --config [config]", "Your config file of the project");
645
- cmd2.option("-p, --preview", "Publish in preview mode");
646
- cmd2.option(
673
+ cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
674
+ cmd3.option("-c, --config [config]", "Your config file of the project");
675
+ cmd3.option("-p, --preview", "Publish in preview mode");
676
+ cmd3.option(
647
677
  "-g, --github",
648
678
  "Publish from your linked remote GitHub repository"
649
679
  );
650
- cmd2.action(async (...args) => {
651
- const { publishAction } = await import("./chunks/action-F3UX5E3M.js");
680
+ cmd3.action(async (...args) => {
681
+ const { publishAction } = await import("./chunks/action-OX2566BE.js");
652
682
  return publishAction(...args);
653
683
  });
654
- return cmd2;
684
+ return cmd3;
655
685
  };
656
686
 
657
687
  // src/domains/project/rollback/index.ts
658
- import { Command as Command37 } from "commander";
688
+ import { Command as Command38 } from "commander";
659
689
  var RollbackCommand = () => {
660
- const cmd2 = new Command37("rollback");
661
- cmd2.description(
690
+ const cmd3 = new Command38("rollback");
691
+ cmd3.description(
662
692
  "Roll the live deployment back to a previously deployed build."
663
693
  );
664
- cmd2.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
665
- cmd2.option(
694
+ cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
695
+ cmd3.option(
666
696
  "-t, --to <publishUid>",
667
697
  "Roll back to a specific build id (defaults to the next older deployed build)"
668
698
  );
669
- cmd2.option("-y, --yes", "Skip the confirmation prompt");
670
- cmd2.action(async (...args) => {
671
- const { rollbackAction } = await import("./chunks/action-XMNX5ZYT.js");
699
+ cmd3.option("-y, --yes", "Skip the confirmation prompt");
700
+ cmd3.action(async (...args) => {
701
+ const { rollbackAction } = await import("./chunks/action-BAQYJ6UE.js");
672
702
  return rollbackAction(...args);
673
703
  });
674
- return cmd2;
704
+ return cmd3;
675
705
  };
676
706
 
677
707
  // src/domains/project/upgrade/index.ts
678
- import { Command as Command38 } from "commander";
708
+ import { Command as Command39 } from "commander";
679
709
  var UpgradeCommand2 = () => {
680
- const cmd2 = new Command38("upgrade");
681
- cmd2.description("Upgrade scalar project");
682
- cmd2.argument(
710
+ const cmd3 = new Command39("upgrade");
711
+ cmd3.description("Upgrade scalar project");
712
+ cmd3.argument(
683
713
  "[config]",
684
714
  "Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
685
715
  );
686
- cmd2.action(async (...args) => {
687
- const { upgradeAction } = await import("./chunks/action-37EV4UHW.js");
716
+ cmd3.action(async (...args) => {
717
+ const { upgradeAction } = await import("./chunks/action-CA4QYPI6.js");
688
718
  return upgradeAction(...args);
689
719
  });
690
- return cmd2;
720
+ return cmd3;
691
721
  };
692
722
 
693
723
  // src/domains/project/index.ts
@@ -701,19 +731,19 @@ var projectCommands = [
701
731
  DeploymentsCommand,
702
732
  UpgradeCommand2
703
733
  ];
704
- var projectDomain = new Command39("project");
734
+ var projectDomain = new Command40("project");
705
735
  projectDomain.description("Manage scalar project");
706
736
  projectCommands.forEach((command) => projectDomain.addCommand(command()));
707
737
  projectDomain.addCommand(DownloadIsolateCommand(), { hidden: true });
708
738
  var project_default = projectDomain;
709
739
 
710
740
  // src/domains/readme/index.ts
711
- import { Command as Command41 } from "commander";
741
+ import { Command as Command42 } from "commander";
712
742
 
713
743
  // src/domains/readme/generate.ts
714
744
  import { text } from "@clack/prompts";
715
745
  import as2 from "ansis";
716
- import { Command as Command40 } from "commander";
746
+ import { Command as Command41 } from "commander";
717
747
 
718
748
  // src/helpers/documentation/index.ts
719
749
  import fs from "node:fs/promises";
@@ -760,17 +790,20 @@ var generateDocumentationFile = async (outputPath) => {
760
790
 
761
791
  // src/domains/readme/generate.ts
762
792
  function GenerateReadmeCommand() {
763
- const cmd2 = new Command40("generate");
764
- cmd2.description("Self generate documentation for the cli");
765
- cmd2.option(
793
+ const cmd3 = new Command41("generate");
794
+ cmd3.description("Self generate documentation for the cli");
795
+ cmd3.option(
766
796
  "-o, --output [file]",
767
797
  "Path where the documentation file will be written"
768
798
  );
769
- cmd2.action(async ({ output: __outputPath }) => {
799
+ cmd3.action(async ({ output: __outputPath }) => {
770
800
  const getOutputPath = async () => {
771
801
  if (__outputPath !== void 0 && typeof __outputPath === "string") {
772
802
  return __outputPath;
773
803
  }
804
+ requireInteractive(
805
+ "Pass --output <file> to generate documentation without a terminal."
806
+ );
774
807
  const outputPath2 = await text({
775
808
  message: "Where should the documentation file be written?",
776
809
  defaultValue: "./README.md",
@@ -789,7 +822,7 @@ function GenerateReadmeCommand() {
789
822
  `\u23F1\uFE0F Generation completed in ${as2.yellow(executionTimeMs.toFixed(2))}ms`
790
823
  ).line("").exit("success");
791
824
  });
792
- return cmd2;
825
+ return cmd3;
793
826
  }
794
827
 
795
828
  // src/domains/readme/serve.ts
@@ -804,9 +837,9 @@ var fileExists = async (filePath) => {
804
837
  return false;
805
838
  }
806
839
  };
807
- function ServeReadmeCommand(cmd2) {
808
- cmd2.description("Open documentation for the CLI");
809
- cmd2.action(async () => {
840
+ function ServeReadmeCommand(cmd3) {
841
+ cmd3.description("Open documentation for the CLI");
842
+ cmd3.action(async () => {
810
843
  const docsPath = path2.join(import.meta.dirname, "docs.html");
811
844
  if (await fileExists(docsPath) === false) {
812
845
  return output.error().title("Documentation not found").message(
@@ -819,111 +852,112 @@ function ServeReadmeCommand(cmd2) {
819
852
  "Documentation is being opened in your default browser. If it does not open automatically, please visit the following URL:"
820
853
  ).line(as3.blue(docsUrl)).line().exit("success");
821
854
  });
822
- return cmd2;
855
+ return cmd3;
823
856
  }
824
857
 
825
858
  // src/domains/readme/index.ts
826
- var readmeDomain = new Command41("readme");
859
+ var readmeDomain = new Command42("readme");
827
860
  readmeDomain.addCommand(GenerateReadmeCommand());
828
861
  ServeReadmeCommand(readmeDomain);
829
862
  var readme_default = readmeDomain;
830
863
 
831
864
  // src/domains/registry/index.ts
832
- import { Command as Command47 } from "commander";
865
+ import { Command as Command48 } from "commander";
833
866
 
834
867
  // src/domains/registry/publish/index.ts
835
- import { Command as Command42 } from "commander";
868
+ import { Command as Command43 } from "commander";
836
869
  var PublishCommand2 = () => {
837
- const cmd2 = new Command42("publish");
838
- cmd2.description("Publish an OpenAPI document to the Scalar registry");
839
- cmd2.argument("[file]", "OpenAPI file to upload");
840
- cmd2.option(
870
+ const cmd3 = new Command43("publish");
871
+ cmd3.description("Publish an OpenAPI document to the Scalar registry");
872
+ cmd3.argument("[file]", "OpenAPI file to upload");
873
+ cmd3.option(
841
874
  "--slug <slug>",
842
875
  "Slug identifier for the registry entry. Defaults to title."
843
876
  );
844
- cmd2.option("--namespace <namespace>", "Scalar team namespace");
845
- cmd2.option("--version <version>", "API version (e.g. 0.1.0)");
846
- cmd2.option("--private", "Make API private", false);
847
- cmd2.option("--no-current", "Do not set as the current version");
848
- cmd2.option("--force", "Force override an existing version", false);
849
- cmd2.option("--bundle", "Bundle all external references before uploading");
850
- cmd2.option(
877
+ cmd3.option("--namespace <namespace>", "Scalar team namespace");
878
+ cmd3.option("--version <version>", "API version (e.g. 0.1.0)");
879
+ cmd3.option("--private", "Make API private", false);
880
+ cmd3.option("--no-current", "Do not set as the current version");
881
+ cmd3.option("--force", "Force override an existing version", false);
882
+ cmd3.option("--bundle", "Bundle all external references before uploading");
883
+ cmd3.option(
851
884
  "--treeShake",
852
885
  "Remove unused components from the bundled document"
853
886
  );
854
- cmd2.option(
887
+ cmd3.option(
855
888
  "--urlMap",
856
889
  "Generate a map of resolved URLs when bundling the document"
857
890
  );
858
- cmd2.option(
891
+ cmd3.option(
859
892
  "--fetchLimit <limit>",
860
- "Maximum number of concurrent URLs to fetch when bundling the document"
893
+ "Maximum number of concurrent URLs to fetch when bundling the document",
894
+ parseFetchLimit
861
895
  );
862
- cmd2.action(async (...args) => {
863
- const { publishAction } = await import("./chunks/action-VTVFY2MP.js");
896
+ cmd3.action(async (...args) => {
897
+ const { publishAction } = await import("./chunks/action-4NGK5XMD.js");
864
898
  return publishAction(...args);
865
899
  });
866
- return cmd2;
900
+ return cmd3;
867
901
  };
868
902
 
869
903
  // src/domains/registry/delete/index.ts
870
- import { Command as Command43 } from "commander";
904
+ import { Command as Command44 } from "commander";
871
905
  var DeleteCommand = () => {
872
- const cmd2 = new Command43("delete");
873
- cmd2.description("Delete a document from scalar registry");
874
- cmd2.argument("[namespace]", "Team namespace");
875
- cmd2.argument("[slug]", "Managed doc slug");
876
- cmd2.action(async (...args) => {
877
- const { deleteAction } = await import("./chunks/action-OGQSTRMX.js");
906
+ const cmd3 = new Command44("delete");
907
+ cmd3.description("Delete a document from scalar registry");
908
+ cmd3.argument("[namespace]", "Team namespace");
909
+ cmd3.argument("[slug]", "Managed doc slug");
910
+ cmd3.action(async (...args) => {
911
+ const { deleteAction } = await import("./chunks/action-QYGOPSTY.js");
878
912
  return deleteAction(...args);
879
913
  });
880
- return cmd2;
914
+ return cmd3;
881
915
  };
882
916
 
883
917
  // src/domains/registry/get/index.ts
884
- import { Command as Command44 } from "commander";
918
+ import { Command as Command45 } from "commander";
885
919
  var GetCommand = () => {
886
- const cmd2 = new Command44("get");
887
- cmd2.description("Get a document version from scalar registry");
888
- cmd2.argument("[namespace]", "Team namespace");
889
- cmd2.argument("[slug]", "Managed doc slug");
890
- cmd2.option("--version <version>", "Document version (defaults to latest)");
891
- cmd2.option("--format <format>", "Output format (json or yaml)", "json");
892
- cmd2.option("-o, --output <file>", "Output file (defaults to stdout)");
893
- cmd2.action(async (...args) => {
894
- const { getAction } = await import("./chunks/action-HGBBV353.js");
920
+ const cmd3 = new Command45("get");
921
+ cmd3.description("Get a document version from scalar registry");
922
+ cmd3.argument("[namespace]", "Team namespace");
923
+ cmd3.argument("[slug]", "Managed doc slug");
924
+ cmd3.option("--version <version>", "Document version (defaults to latest)");
925
+ cmd3.option("--format <format>", "Output format (json or yaml)", "json");
926
+ cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
927
+ cmd3.action(async (...args) => {
928
+ const { getAction } = await import("./chunks/action-SRBN7N3R.js");
895
929
  return getAction(...args);
896
930
  });
897
- return cmd2;
931
+ return cmd3;
898
932
  };
899
933
 
900
934
  // src/domains/registry/list/index.ts
901
- import { Command as Command45 } from "commander";
935
+ import { Command as Command46 } from "commander";
902
936
  var ListCommand2 = () => {
903
- const cmd2 = new Command45("list");
904
- cmd2.description("List all registry APIs for a team namespace");
905
- cmd2.option("--namespace <namespace>", "Team namespace");
906
- cmd2.action(async (...args) => {
907
- const { listAction } = await import("./chunks/action-MSLBC2SO.js");
937
+ const cmd3 = new Command46("list");
938
+ cmd3.description("List all registry APIs for a team namespace");
939
+ cmd3.option("--namespace <namespace>", "Team namespace");
940
+ cmd3.action(async (...args) => {
941
+ const { listAction } = await import("./chunks/action-SCOXTCPR.js");
908
942
  return listAction(...args);
909
943
  });
910
- return cmd2;
944
+ return cmd3;
911
945
  };
912
946
 
913
947
  // src/domains/registry/update/index.ts
914
- import { Command as Command46 } from "commander";
948
+ import { Command as Command47 } from "commander";
915
949
  var UpdateCommand = () => {
916
- const cmd2 = new Command46("update");
917
- cmd2.description("Update document metadata on scalar registry");
918
- cmd2.argument("[namespace]", "namespace of document you want to update");
919
- cmd2.argument("[slug]", "slug of document you want to update");
920
- cmd2.option("--title <title>", "Document title");
921
- cmd2.option("--description <description>", "Document description");
922
- cmd2.action(async (...args) => {
923
- const { updateAction } = await import("./chunks/action-WFWYGY7O.js");
950
+ const cmd3 = new Command47("update");
951
+ cmd3.description("Update document metadata on scalar registry");
952
+ cmd3.argument("[namespace]", "namespace of document you want to update");
953
+ cmd3.argument("[slug]", "slug of document you want to update");
954
+ cmd3.option("--title <title>", "Document title");
955
+ cmd3.option("--description <description>", "Document description");
956
+ cmd3.action(async (...args) => {
957
+ const { updateAction } = await import("./chunks/action-SNPOOW6S.js");
924
958
  return updateAction(...args);
925
959
  });
926
- return cmd2;
960
+ return cmd3;
927
961
  };
928
962
 
929
963
  // src/domains/registry/index.ts
@@ -934,42 +968,42 @@ var registryCommands = [
934
968
  ListCommand2,
935
969
  GetCommand
936
970
  ];
937
- var registryDomain = new Command47("registry");
971
+ var registryDomain = new Command48("registry");
938
972
  registryDomain.description("Manage your scalar registry");
939
973
  registryCommands.forEach((command) => registryDomain.addCommand(command()));
940
974
  var registry_default = registryDomain;
941
975
 
942
976
  // src/domains/team/index.ts
943
- import { Command as Command50 } from "commander";
977
+ import { Command as Command51 } from "commander";
944
978
 
945
979
  // src/domains/team/list/index.ts
946
- import { Command as Command48 } from "commander";
980
+ import { Command as Command49 } from "commander";
947
981
  var ListCommand3 = () => {
948
- const cmd2 = new Command48("list");
949
- cmd2.description("List all teams current user is part of");
950
- cmd2.action(async (...args) => {
951
- const { listAction } = await import("./chunks/action-QPUSPD5M.js");
982
+ const cmd3 = new Command49("list");
983
+ cmd3.description("List all teams current user is part of");
984
+ cmd3.action(async (...args) => {
985
+ const { listAction } = await import("./chunks/action-BRSSC2SR.js");
952
986
  return listAction(...args);
953
987
  });
954
- return cmd2;
988
+ return cmd3;
955
989
  };
956
990
 
957
991
  // src/domains/team/set/index.ts
958
- import { Command as Command49 } from "commander";
992
+ import { Command as Command50 } from "commander";
959
993
  var SetCommand = () => {
960
- const cmd2 = new Command49("set");
961
- cmd2.description("Set current active team for the user");
962
- cmd2.option("--team <team>", "Team uid");
963
- cmd2.action(async (...args) => {
964
- const { setAction } = await import("./chunks/action-PAGJ5PWC.js");
994
+ const cmd3 = new Command50("set");
995
+ cmd3.description("Set current active team for the user");
996
+ cmd3.option("--team <team>", "Team uid");
997
+ cmd3.action(async (...args) => {
998
+ const { setAction } = await import("./chunks/action-T5XMJXPO.js");
965
999
  return setAction(...args);
966
1000
  });
967
- return cmd2;
1001
+ return cmd3;
968
1002
  };
969
1003
 
970
1004
  // src/domains/team/index.ts
971
1005
  var teamCommands = [ListCommand3, SetCommand];
972
- var teamDomain = new Command50("team");
1006
+ var teamDomain = new Command51("team");
973
1007
  teamDomain.description("Manage user teams");
974
1008
  teamCommands.forEach((command) => teamDomain.addCommand(command()));
975
1009
  var team_default = teamDomain;
@@ -977,7 +1011,7 @@ var team_default = teamDomain;
977
1011
  // src/domains/upgrade/index.ts
978
1012
  import { execSync } from "node:child_process";
979
1013
  import as5 from "ansis";
980
- import { Command as Command51 } from "commander";
1014
+ import { Command as Command52 } from "commander";
981
1015
 
982
1016
  // src/helpers/upgrade.ts
983
1017
  import as4 from "ansis";
@@ -1044,9 +1078,9 @@ async function checkUpgrade() {
1044
1078
  }
1045
1079
 
1046
1080
  // src/domains/upgrade/index.ts
1047
- var cmd = new Command51("upgrade");
1048
- cmd.description("Upgrade current version of your cli");
1049
- cmd.action(async () => {
1081
+ var cmd2 = new Command52("upgrade");
1082
+ cmd2.description("Upgrade current version of your cli");
1083
+ cmd2.action(async () => {
1050
1084
  if (process.env.SCALAR_CLI_DISTRIBUTION === "portable") {
1051
1085
  output.info().message(
1052
1086
  "To upgrade this portable installation, download and extract the newer Scalar archive, then replace the installation directory."
@@ -1070,12 +1104,13 @@ cmd.action(async () => {
1070
1104
  output.error().title("Upgrade failed").message("Failed to upgrade the CLI. Please try running:").message(as5.cyan(`npm install -g ${upgradeStatus.name}@latest`)).exit("error");
1071
1105
  }
1072
1106
  });
1073
- var upgrade_default = cmd;
1107
+ var upgrade_default = cmd2;
1074
1108
 
1075
1109
  // src/domains/index.ts
1076
1110
  var domains = [
1077
1111
  readme_default,
1078
1112
  upgrade_default,
1113
+ context_default,
1079
1114
  auth_default,
1080
1115
  document_default,
1081
1116
  project_default,
@@ -1088,7 +1123,7 @@ var domains_default = domains;
1088
1123
 
1089
1124
  // src/program.ts
1090
1125
  var getProgram = () => {
1091
- const program2 = new Command52();
1126
+ const program2 = new Command53();
1092
1127
  program2.enablePositionalOptions().name(Object.keys(bin)[0]).description("CLI to work with your OpenAPI files").version(version, "-v, --version");
1093
1128
  program2.showHelpAfterError();
1094
1129
  domains_default.forEach((domain) => program2.addCommand(domain));
@@ -1106,7 +1141,7 @@ var program = getProgram();
1106
1141
  if (process.argv.length === 2) {
1107
1142
  program.help();
1108
1143
  }
1109
- if (process.argv[2] !== "upgrade" && process.env.SCALAR_CLI_DISTRIBUTION !== "portable") {
1144
+ if (process.argv[2] !== "upgrade" && process.argv[2] !== "context" && process.env.SCALAR_CLI_DISTRIBUTION !== "portable") {
1110
1145
  checkUpgrade().catch(() => {
1111
1146
  });
1112
1147
  }