@scalar/cli 2.5.2 → 2.8.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.
- package/README.md +319 -55
- package/chunks/{action-XUQ7TKKJ.js → action-354TUG4H.js} +11 -7
- package/chunks/{action-PHLOE27S.js → action-43YBNBDR.js} +33 -26
- package/chunks/{action-DGD6Q6Y5.js → action-5SK5NE7E.js} +10 -4
- package/chunks/{action-Y6CEKYEK.js → action-6BYGBXRC.js} +40 -23
- package/chunks/{action-LUVBQEIQ.js → action-7PEQXDWT.js} +4 -4
- package/chunks/action-AQRPFQKI.js +231 -0
- package/chunks/{action-RBVPKCRI.js → action-CA4QYPI6.js} +6 -6
- package/chunks/{action-7H3XARJP.js → action-EOAVVL52.js} +11 -5
- package/chunks/action-F2ZJNURT.js +72 -0
- package/chunks/{action-AMNYOA4B.js → action-F7A2K74G.js} +4 -4
- package/chunks/{action-HIL5ZFNB.js → action-FCAYFPVR.js} +5 -5
- package/chunks/{action-42D2C47G.js → action-GWXLHL2Z.js} +3 -3
- package/chunks/{action-ZWQLQENM.js → action-H6OUJWWM.js} +4 -4
- package/chunks/{action-TWHLZW4V.js → action-HT2DJ34Z.js} +49 -26
- package/chunks/{action-PAA4NWUJ.js → action-JAHFRYWZ.js} +58 -9
- package/chunks/{action-HXHBU7XC.js → action-KTYOCA2V.js} +37 -12
- package/chunks/{action-LFL3ZZKN.js → action-LEUD5P2U.js} +17 -17
- package/chunks/{action-FF2OMGAS.js → action-LLH4QPXM.js} +34 -20
- package/chunks/{action-OILGZAMK.js → action-LXGXKXZZ.js} +20 -15
- package/chunks/{action-W62AIEBN.js → action-NVI5DWFP.js} +6 -6
- package/chunks/{action-EPNE5XCM.js → action-QQZLPI42.js} +17 -17
- package/chunks/{action-ZLTUMRO2.js → action-UIKH4SZX.js} +25 -21
- package/chunks/{action-6FAJNP6C.js → action-VOFDW3U2.js} +4 -4
- package/chunks/{action-OK55BFGM.js → action-W3C53GPH.js} +7 -7
- package/chunks/{action-P7RFXIC7.js → action-WFDNRA7D.js} +32 -23
- package/chunks/{action-V5KYG7XD.js → action-XIUO64C7.js} +10 -10
- package/chunks/{action-X7TZA3RE.js → action-Y6NXJQ4H.js} +89 -14
- package/chunks/{action-6MZZHPVQ.js → action-Y7OUGD56.js} +27 -14
- package/chunks/{action-DCINFQ57.js → action-YLF2G4G5.js} +13 -13
- package/chunks/{action-SJYAMXYI.js → action-YRX6SN5F.js} +10 -4
- package/chunks/actions-OGIVBQC7.js +158 -0
- package/chunks/{agent-JAXLLDPE.js → agent-ASPV3R5U.js} +4 -4
- package/chunks/{asyncapi-P6Y3L7RG.js → asyncapi-QNFKXHEI.js} +10 -11
- package/chunks/{build.action-AZ5ECU4B.js → build.action-NM6CAE5F.js} +37 -33
- package/chunks/{chunk-FOKFF4EP.js → chunk-22HYZ7LE.js} +3 -3
- package/chunks/{chunk-KEOCJ3NJ.js → chunk-2OCWX42S.js} +38 -87
- package/chunks/{chunk-RPVHJMQT.js → chunk-5DEU2DVL.js} +2 -2
- package/chunks/{chunk-OQKDBLOZ.js → chunk-5JLVQVKO.js} +8 -0
- package/chunks/{chunk-VNYE4R7N.js → chunk-5UHLAJQD.js} +2 -1
- package/chunks/{chunk-CX7ZRMTC.js → chunk-6XWCMJDB.js} +1 -1
- package/chunks/{chunk-6ZMT63IV.js → chunk-6YPQGVF4.js} +1 -1
- package/chunks/{chunk-HXIDUCSZ.js → chunk-BPGFSSUH.js} +1 -1
- package/chunks/{chunk-M622VXRQ.js → chunk-C2KAWRIX.js} +1 -1
- package/chunks/chunk-EGOXR5FB.js +15 -0
- package/chunks/{chunk-UB3XGOUW.js → chunk-EXY3ZTV4.js} +262 -9
- package/chunks/{chunk-3BWGTPPT.js → chunk-FDC2IESH.js} +1776 -1113
- package/chunks/{chunk-TYLWJ2UL.js → chunk-GTV2BVXV.js} +2 -2
- package/chunks/{chunk-SWWWYWHC.js → chunk-HGOD6THU.js} +27 -18
- package/chunks/{chunk-3DJ2GKEG.js → chunk-IMG35UXX.js} +1 -1
- package/chunks/{chunk-MNLXYOVF.js → chunk-KCCFN4F7.js} +2 -2
- package/chunks/{chunk-FQVVKQPU.js → chunk-KKRGBXCE.js} +137 -1
- package/chunks/{chunk-UMPODUJO.js → chunk-L3UXDCBI.js} +105 -15
- package/chunks/{chunk-B2MHTD3R.js → chunk-MLSZVVTT.js} +1 -1
- package/chunks/{chunk-LCPFHE4Z.js → chunk-OJ2EWIJH.js} +21 -2
- package/chunks/{chunk-RAO7VUGM.js → chunk-PH3WFNXJ.js} +1 -1
- package/chunks/{chunk-NIXG4KDE.js → chunk-QVQ4PNVL.js} +170 -5
- package/chunks/{chunk-CIFOFSZ3.js → chunk-R5LK6VPY.js} +72 -7
- package/chunks/{chunk-T7B6WNZC.js → chunk-TSURUX4A.js} +12 -3
- package/chunks/{chunk-JV7TUEXQ.js → chunk-UXJ753NV.js} +14 -1
- package/chunks/{chunk-HUCR333E.js → chunk-W24BETFG.js} +2 -2
- package/chunks/{chunk-LQN4S62O.js → chunk-XEDGMZJD.js} +18 -4
- package/chunks/{chunk-NNMSZVAB.js → chunk-XXSQUBXS.js} +82 -6
- package/chunks/{chunk-M6Q3ARBV.js → chunk-YILQODZF.js} +2 -2
- package/chunks/{create.action-34OTO2SB.js → create.action-FUQ2BVJA.js} +29 -17
- package/chunks/{delete.action-ZYXFMIOW.js → delete.action-47E66R3I.js} +26 -17
- package/chunks/{delete.action-6LRT4M3S.js → delete.action-BTDFH7WY.js} +26 -17
- package/chunks/{get.action-XP36SA2J.js → get.action-XC7KC2JO.js} +10 -10
- package/chunks/{list.action-6LF6KSD5.js → list.action-LXKEUYKO.js} +13 -13
- package/chunks/{list.action-WVRVLX5E.js → list.action-OFGLMRE7.js} +17 -17
- package/chunks/{publish.action-AHFUBT5C.js → publish.action-OS27XOX4.js} +50 -24
- package/chunks/{update.action-YQTVUDYE.js → update.action-AEIBLCWD.js} +27 -18
- package/chunks/{update.action-ZREAFJVG.js → update.action-ZMS4CQ3T.js} +27 -18
- package/docs.html +679 -175
- package/index.js +492 -406
- package/package.json +14 -22
- package/skills/scalar-cli/SKILL.md +77 -0
- package/template.md +101 -3
- package/chunks/action-YRWHX2AE.js +0 -64
package/README.md
CHANGED
|
@@ -15,6 +15,26 @@ Command-line interface to work with OpenAPI files
|
|
|
15
15
|
- Preview your API reference
|
|
16
16
|
- Bundle multiple OpenAPI files
|
|
17
17
|
|
|
18
|
+
## Access groups
|
|
19
|
+
|
|
20
|
+
Manage access groups and allowed email domains for your current team:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
scalar auth login
|
|
24
|
+
scalar access-group create partners --name Partners --domain example.com
|
|
25
|
+
scalar access-group get partners --json
|
|
26
|
+
scalar access-group update partners --name "Partner access"
|
|
27
|
+
scalar access-group domain add partners partner.com
|
|
28
|
+
scalar access-group domain remove partners partner.com
|
|
29
|
+
scalar access-group delete partners --yes
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Creation requires Pro or above, and mutations require docs edit permission. Commands use your existing login and selected team; CI can authenticate with `scalar auth login --token <personal-token>`. Group arguments are slugs, not UIDs. Rename with `update <slug> --new-slug <new-slug>`, then use the new slug in later commands.
|
|
33
|
+
|
|
34
|
+
Use `--json` for machine-readable output: create/get print the group object, while successful updates, deletions and domain mutations print `null`. Errors go to stderr and exit nonzero. Deletion prompts in a terminal; pass `--yes` for unattended deletion or when using `--json`.
|
|
35
|
+
|
|
36
|
+
Domains are exact email domains, with no wildcards or implicit subdomain matching. Matching preserves existing case-sensitive behavior. Groups support up to 1,000 domains; domain add/remove leaves other domains and individual email entries intact. Creating a group does not assign it to resources or change their privacy settings. Deleting a group removes its project assignments.
|
|
37
|
+
|
|
18
38
|
## Documentation
|
|
19
39
|
|
|
20
40
|
This is an overview + API Reference of the CLI, if you want guides on how to use the CLI in more detail go to our [Docs](https://guides.scalar.com/scalar/scalar-cli)
|
|
@@ -27,7 +47,31 @@ npx @scalar/cli help
|
|
|
27
47
|
|
|
28
48
|
## Installation
|
|
29
49
|
|
|
30
|
-
|
|
50
|
+
### Standalone CLI (no Node.js required)
|
|
51
|
+
|
|
52
|
+
Install the latest stable release without Node.js, npm, or administrator access.
|
|
53
|
+
|
|
54
|
+
macOS and Linux (Bash):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
curl -fsSL https://cdn.scalar.com/cli/install.sh | bash
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Windows (PowerShell):
|
|
61
|
+
|
|
62
|
+
```powershell
|
|
63
|
+
irm https://cdn.scalar.com/cli/install.ps1 | iex
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The installers choose the archive for your platform and verify its SHA-256 checksum before installing. macOS and Linux support x64 and ARM64; Linux requires glibc. Windows supports x64 and requires `tar.exe`, included in Windows 10 version 1803 and later.
|
|
67
|
+
|
|
68
|
+
On macOS and Linux, follow the printed PATH instructions if needed. On Windows, open a new terminal after installation. Then run `scalar --help`. Re-run the installer to upgrade.
|
|
69
|
+
|
|
70
|
+
See the [portable CLI guide](https://github.com/scalar/scalar-org/blob/main/projects/cli/portable/README.md) for installation locations, version selection, custom directories, and direct downloads. You can download and inspect either script before running it.
|
|
71
|
+
|
|
72
|
+
### npm
|
|
73
|
+
|
|
74
|
+
If you already use Node.js, install the CLI with npm:
|
|
31
75
|
|
|
32
76
|
```bash
|
|
33
77
|
npm -g install @scalar/cli
|
|
@@ -53,6 +97,35 @@ npx @scalar/cli help
|
|
|
53
97
|
pnpm dlx @scalar/cli help
|
|
54
98
|
```
|
|
55
99
|
|
|
100
|
+
## API Reference configuration
|
|
101
|
+
|
|
102
|
+
Pass API Reference options as a JSON object:
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
scalar document serve openapi.yaml --config ./reference.config.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"orderRequiredPropertiesFirst": false,
|
|
111
|
+
"theme": "purple"
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The configuration path is relative to the current working directory. Configuration
|
|
116
|
+
is loaded at startup; restart the command after changing it. `--watch` continues
|
|
117
|
+
to watch the API document. Options requiring JavaScript functions are not supported
|
|
118
|
+
in a JSON file.
|
|
119
|
+
|
|
120
|
+
## Authentication in automation
|
|
121
|
+
|
|
122
|
+
Use `scalar auth login --token <personal-token>` to authenticate without a browser.
|
|
123
|
+
Alternatively, set `SCALAR_API_KEY`. When both are provided, `SCALAR_API_KEY` takes
|
|
124
|
+
precedence over `--token`. Unset it to use a different explicit token.
|
|
125
|
+
|
|
126
|
+
Supply required options in automation instead of relying on interactive prompts.
|
|
127
|
+
For example, pass `--output` for document transformations.
|
|
128
|
+
|
|
56
129
|
## Commands
|
|
57
130
|
|
|
58
131
|
```
|
|
@@ -67,7 +140,11 @@ Options:
|
|
|
67
140
|
Commands:
|
|
68
141
|
readme Open documentation for the CLI
|
|
69
142
|
upgrade Upgrade current version of your cli
|
|
143
|
+
context Print every command, argument, and option as JSON for AI
|
|
144
|
+
agents
|
|
70
145
|
auth Manage authorization on scalar platform
|
|
146
|
+
access-group Manage access groups and allowed email domains for the current
|
|
147
|
+
team
|
|
71
148
|
document Manage local openapi file
|
|
72
149
|
project Manage scalar project
|
|
73
150
|
registry Manage your scalar registry
|
|
@@ -111,6 +188,16 @@ Options:
|
|
|
111
188
|
-h, --help display help for command
|
|
112
189
|
```
|
|
113
190
|
|
|
191
|
+
### context
|
|
192
|
+
```
|
|
193
|
+
Usage: scalar context [options]
|
|
194
|
+
|
|
195
|
+
Print every command, argument, and option as JSON for AI agents
|
|
196
|
+
|
|
197
|
+
Options:
|
|
198
|
+
-h, --help display help for command
|
|
199
|
+
```
|
|
200
|
+
|
|
114
201
|
### auth
|
|
115
202
|
```
|
|
116
203
|
Usage: scalar auth [options] [command]
|
|
@@ -160,6 +247,132 @@ Options:
|
|
|
160
247
|
-h, --help display help for command
|
|
161
248
|
```
|
|
162
249
|
|
|
250
|
+
### access-group
|
|
251
|
+
```
|
|
252
|
+
Usage: scalar access-group [options] [command]
|
|
253
|
+
|
|
254
|
+
Manage access groups and allowed email domains for the current team
|
|
255
|
+
|
|
256
|
+
Options:
|
|
257
|
+
-h, --help display help for command
|
|
258
|
+
|
|
259
|
+
Commands:
|
|
260
|
+
create [options] <slug> Create an access group (Pro or above)
|
|
261
|
+
get [options] <slug> Get an access group and its allowlists
|
|
262
|
+
update [options] <slug> Update access group metadata
|
|
263
|
+
delete [options] <slug> Delete an access group and remove its project
|
|
264
|
+
assignments
|
|
265
|
+
domain Manage allowed email domains
|
|
266
|
+
help [command] display help for command
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### create
|
|
270
|
+
```
|
|
271
|
+
Usage: scalar access-group create [options] <slug>
|
|
272
|
+
|
|
273
|
+
Create an access group (Pro or above)
|
|
274
|
+
|
|
275
|
+
Arguments:
|
|
276
|
+
slug New access group slug
|
|
277
|
+
|
|
278
|
+
Options:
|
|
279
|
+
--name <name> Display name
|
|
280
|
+
--domain <domains...> Allowed email domains
|
|
281
|
+
--json Print the result as JSON
|
|
282
|
+
-h, --help display help for command
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### get
|
|
286
|
+
```
|
|
287
|
+
Usage: scalar access-group get [options] <slug>
|
|
288
|
+
|
|
289
|
+
Get an access group and its allowlists
|
|
290
|
+
|
|
291
|
+
Arguments:
|
|
292
|
+
slug Access group slug
|
|
293
|
+
|
|
294
|
+
Options:
|
|
295
|
+
--json Print the result as JSON
|
|
296
|
+
-h, --help display help for command
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
#### update
|
|
300
|
+
```
|
|
301
|
+
Usage: scalar access-group update [options] <slug>
|
|
302
|
+
|
|
303
|
+
Update access group metadata
|
|
304
|
+
|
|
305
|
+
Arguments:
|
|
306
|
+
slug Current access group slug
|
|
307
|
+
|
|
308
|
+
Options:
|
|
309
|
+
--name <name> New display name
|
|
310
|
+
--new-slug <slug> New access group slug
|
|
311
|
+
--json Print the result as JSON
|
|
312
|
+
-h, --help display help for command
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
#### delete
|
|
316
|
+
```
|
|
317
|
+
Usage: scalar access-group delete [options] <slug>
|
|
318
|
+
|
|
319
|
+
Delete an access group and remove its project assignments
|
|
320
|
+
|
|
321
|
+
Arguments:
|
|
322
|
+
slug Access group slug
|
|
323
|
+
|
|
324
|
+
Options:
|
|
325
|
+
-y, --yes Confirm deletion without prompting
|
|
326
|
+
--json Print the result as JSON (requires --yes)
|
|
327
|
+
-h, --help display help for command
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
#### domain
|
|
331
|
+
```
|
|
332
|
+
Usage: scalar access-group domain [options] [command]
|
|
333
|
+
|
|
334
|
+
Manage allowed email domains
|
|
335
|
+
|
|
336
|
+
Options:
|
|
337
|
+
-h, --help display help for command
|
|
338
|
+
|
|
339
|
+
Commands:
|
|
340
|
+
add [options] <slug> <domain> Add an exact email domain to an access group
|
|
341
|
+
remove [options] <slug> <domain> Remove an exact email domain from an access
|
|
342
|
+
group
|
|
343
|
+
help [command] display help for command
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
##### add
|
|
347
|
+
```
|
|
348
|
+
Usage: scalar access-group domain add [options] <slug> <domain>
|
|
349
|
+
|
|
350
|
+
Add an exact email domain to an access group
|
|
351
|
+
|
|
352
|
+
Arguments:
|
|
353
|
+
slug Access group slug
|
|
354
|
+
domain Email domain, such as example.com
|
|
355
|
+
|
|
356
|
+
Options:
|
|
357
|
+
--json Print the result as JSON
|
|
358
|
+
-h, --help display help for command
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
##### remove
|
|
362
|
+
```
|
|
363
|
+
Usage: scalar access-group domain remove [options] <slug> <domain>
|
|
364
|
+
|
|
365
|
+
Remove an exact email domain from an access group
|
|
366
|
+
|
|
367
|
+
Arguments:
|
|
368
|
+
slug Access group slug
|
|
369
|
+
domain Email domain, such as example.com
|
|
370
|
+
|
|
371
|
+
Options:
|
|
372
|
+
--json Print the result as JSON
|
|
373
|
+
-h, --help display help for command
|
|
374
|
+
```
|
|
375
|
+
|
|
163
376
|
### document
|
|
164
377
|
```
|
|
165
378
|
Usage: scalar document [options] [command]
|
|
@@ -170,19 +383,27 @@ Options:
|
|
|
170
383
|
-h, --help display help for command
|
|
171
384
|
|
|
172
385
|
Commands:
|
|
173
|
-
bundle [options] [file|url] Bundle an OpenAPI document by resolving all
|
|
174
|
-
|
|
175
|
-
|
|
386
|
+
bundle [options] [file|url] Bundle an OpenAPI document by resolving all
|
|
387
|
+
references and external dependencies
|
|
388
|
+
split [options] [file|url] Split OpenAPI or AsyncAPI documents into small
|
|
389
|
+
chunks
|
|
390
|
+
join [options] <files...> Merge multiple OpenAPI or AsyncAPI documents
|
|
391
|
+
into a single unified document
|
|
176
392
|
format [options] [file|url] Format an OpenAPI or AsyncAPI file
|
|
177
|
-
convert [options] [file|url] Convert a Postman collection to an OpenAPI
|
|
393
|
+
convert [options] [file|url] Convert a Postman collection to an OpenAPI
|
|
394
|
+
document
|
|
178
395
|
markdown [options] [file|url] Generate Markdown from an OpenAPI file
|
|
179
|
-
mock [options] [file|url] Mock an OpenAPI API or AsyncAPI WebSocket and
|
|
180
|
-
|
|
396
|
+
mock [options] [file|url] Mock an OpenAPI API or AsyncAPI WebSocket and
|
|
397
|
+
SSE channels
|
|
398
|
+
serve [options] [file|url] Serve an API Reference from an OpenAPI or
|
|
399
|
+
AsyncAPI file
|
|
181
400
|
share [options] [file] Share an OpenAPI or AsyncAPI file
|
|
182
401
|
validate [file|url] Validate an OpenAPI or AsyncAPI file
|
|
183
402
|
void [options] Boot a server to mirror HTTP requests
|
|
184
|
-
lint [options] [file|url] Lint your OpenAPI or AsyncAPI file using
|
|
185
|
-
|
|
403
|
+
lint [options] [file|url] Lint your OpenAPI or AsyncAPI file using
|
|
404
|
+
spectral rules
|
|
405
|
+
upgrade [options] [file|url] Upgrade an OpenAPI or AsyncAPI document to
|
|
406
|
+
version 3.1
|
|
186
407
|
help [command] display help for command
|
|
187
408
|
```
|
|
188
409
|
|
|
@@ -199,14 +420,12 @@ Options:
|
|
|
199
420
|
-o, --output <file> Path to save the bundled output file
|
|
200
421
|
--treeShake Remove unused components from the bundled output
|
|
201
422
|
--urlMap Generate a map of resolved URLs in the bundled output
|
|
202
|
-
--fetchLimit <limit> Maximum number of URLs to fetch during bundling at the
|
|
423
|
+
--fetchLimit <limit> Maximum number of URLs to fetch during bundling at the
|
|
424
|
+
same time
|
|
203
425
|
-h, --help display help for command
|
|
204
426
|
```
|
|
205
427
|
|
|
206
428
|
#### split
|
|
207
|
-
|
|
208
|
-
Splits AsyncAPI channels, operations, messages, and reusable components (including payload schemas) into JSON chunks. AsyncAPI versions are preserved, including 2.6, 3.0, and 3.1; splitting does not upgrade the document or add Scalar navigation metadata. Use `scalar document upgrade` separately to normalize versions. Nested external references are bundled relative to their source files or URLs, and chunk references resolve relative to the generated files. Both relative and absolute output directories are supported. The entry point is `out.json`.
|
|
209
|
-
|
|
210
429
|
```
|
|
211
430
|
Usage: scalar document split [options] [file|url]
|
|
212
431
|
|
|
@@ -301,13 +520,14 @@ Usage: scalar document serve [options] [file|url]
|
|
|
301
520
|
Serve an API Reference from an OpenAPI or AsyncAPI file
|
|
302
521
|
|
|
303
522
|
Arguments:
|
|
304
|
-
file|url
|
|
523
|
+
file|url OpenAPI or AsyncAPI file or URL to show the reference for
|
|
305
524
|
|
|
306
525
|
Options:
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
-
|
|
526
|
+
-c, --config <file> JSON file with API Reference configuration
|
|
527
|
+
-w, --watch watch the file for changes
|
|
528
|
+
-o, --once run the server only once and exit after that
|
|
529
|
+
-p, --port <port> set the HTTP port for the API reference server
|
|
530
|
+
-h, --help display help for command
|
|
311
531
|
```
|
|
312
532
|
|
|
313
533
|
#### share
|
|
@@ -389,10 +609,13 @@ Options:
|
|
|
389
609
|
Commands:
|
|
390
610
|
init [options] Create a new Scalar Docs project.
|
|
391
611
|
check-config [file] Check a Scalar Configuration file
|
|
392
|
-
create [options] Create a new project that is not linked to a
|
|
612
|
+
create [options] Create a new project that is not linked to a
|
|
613
|
+
github project.
|
|
393
614
|
preview [options] [config] Preview scalar guides
|
|
394
|
-
publish [options] Publish new build for a github sync project that
|
|
395
|
-
|
|
615
|
+
publish [options] Publish new build for a github sync project that
|
|
616
|
+
is not linked.
|
|
617
|
+
rollback [options] Roll the live deployment back to a previously
|
|
618
|
+
deployed build.
|
|
396
619
|
deployments Inspect a project deployment history.
|
|
397
620
|
upgrade [config] Upgrade scalar project
|
|
398
621
|
help [command] display help for command
|
|
@@ -430,8 +653,8 @@ Usage: scalar project create [options]
|
|
|
430
653
|
Create a new project that is not linked to a github project.
|
|
431
654
|
|
|
432
655
|
Options:
|
|
433
|
-
-n, --name
|
|
434
|
-
-s, --slug
|
|
656
|
+
-n, --name <name> name of your project
|
|
657
|
+
-s, --slug <slug> project slug
|
|
435
658
|
-h, --help display help for command
|
|
436
659
|
```
|
|
437
660
|
|
|
@@ -442,15 +665,14 @@ Usage: scalar project preview [options] [config]
|
|
|
442
665
|
Preview scalar guides
|
|
443
666
|
|
|
444
667
|
Arguments:
|
|
445
|
-
config
|
|
668
|
+
config Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)
|
|
446
669
|
|
|
447
670
|
Options:
|
|
448
|
-
-p, --port [port]
|
|
449
|
-
-
|
|
450
|
-
-L, --log-level <level>
|
|
451
|
-
-
|
|
452
|
-
-
|
|
453
|
-
--help display help for command
|
|
671
|
+
-p, --port [port] port to run the server on. If the port is not available, it will select another one. (default: "7970")
|
|
672
|
+
-H, --host [host] Specify which IP addresses the server should listen on.
|
|
673
|
+
-L, --log-level <level> Set the log level (choices: "debug", "info", default: "info")
|
|
674
|
+
-N, --no-open Do not open the browser automatically
|
|
675
|
+
-h, --help display help for command
|
|
454
676
|
```
|
|
455
677
|
|
|
456
678
|
#### publish
|
|
@@ -475,7 +697,8 @@ Roll the live deployment back to a previously deployed build.
|
|
|
475
697
|
|
|
476
698
|
Options:
|
|
477
699
|
-s, --slug [slug] Project slug found in Scalar Dashboard
|
|
478
|
-
-t, --to <publishUid> Roll back to a specific build id (defaults to the next
|
|
700
|
+
-t, --to <publishUid> Roll back to a specific build id (defaults to the next
|
|
701
|
+
older deployed build)
|
|
479
702
|
-y, --yes Skip the confirmation prompt
|
|
480
703
|
-h, --help display help for command
|
|
481
704
|
```
|
|
@@ -512,7 +735,8 @@ Usage: scalar project upgrade [options] [config]
|
|
|
512
735
|
Upgrade scalar project
|
|
513
736
|
|
|
514
737
|
Arguments:
|
|
515
|
-
config Path to the Scalar configuration file (usually
|
|
738
|
+
config Path to the Scalar configuration file (usually
|
|
739
|
+
`scalar.config.json5` or `scalar.config.json`)
|
|
516
740
|
|
|
517
741
|
Options:
|
|
518
742
|
-h, --help display help for command
|
|
@@ -528,11 +752,15 @@ Options:
|
|
|
528
752
|
-h, --help display help for command
|
|
529
753
|
|
|
530
754
|
Commands:
|
|
531
|
-
publish [options] [file] Publish an OpenAPI document to the Scalar
|
|
532
|
-
|
|
755
|
+
publish [options] [file] Publish an OpenAPI document to the Scalar
|
|
756
|
+
registry
|
|
757
|
+
update [options] [namespace] [slug] Update document metadata on scalar
|
|
758
|
+
registry
|
|
533
759
|
delete [namespace] [slug] Delete a document from scalar registry
|
|
534
|
-
list [options] List all registry APIs for a team
|
|
535
|
-
|
|
760
|
+
list [options] List all registry APIs for a team
|
|
761
|
+
namespace
|
|
762
|
+
get [options] [namespace] [slug] Get a document version from scalar
|
|
763
|
+
registry
|
|
536
764
|
help [command] display help for command
|
|
537
765
|
```
|
|
538
766
|
|
|
@@ -546,7 +774,8 @@ Arguments:
|
|
|
546
774
|
file OpenAPI file to upload
|
|
547
775
|
|
|
548
776
|
Options:
|
|
549
|
-
--slug <slug> Slug identifier for the registry entry. Defaults to
|
|
777
|
+
--slug <slug> Slug identifier for the registry entry. Defaults to
|
|
778
|
+
title.
|
|
550
779
|
--namespace <namespace> Scalar team namespace
|
|
551
780
|
--version <version> API version (e.g. 0.1.0)
|
|
552
781
|
--private Make API private (default: false)
|
|
@@ -554,8 +783,10 @@ Options:
|
|
|
554
783
|
--force Force override an existing version (default: false)
|
|
555
784
|
--bundle Bundle all external references before uploading
|
|
556
785
|
--treeShake Remove unused components from the bundled document
|
|
557
|
-
--urlMap Generate a map of resolved URLs when bundling the
|
|
558
|
-
|
|
786
|
+
--urlMap Generate a map of resolved URLs when bundling the
|
|
787
|
+
document
|
|
788
|
+
--fetchLimit <limit> Maximum number of concurrent URLs to fetch when
|
|
789
|
+
bundling the document
|
|
559
790
|
-h, --help display help for command
|
|
560
791
|
```
|
|
561
792
|
|
|
@@ -664,10 +895,11 @@ Options:
|
|
|
664
895
|
|
|
665
896
|
Commands:
|
|
666
897
|
list [options] List all SDKs for a team namespace
|
|
667
|
-
create [options] Create a new SDK.
|
|
898
|
+
create [options] Create a new SDK. The SDK is created in the namespace of the
|
|
899
|
+
API it is built from.
|
|
668
900
|
update [options] Update SDK metadata.
|
|
669
901
|
delete [options] Delete an SDK.
|
|
670
|
-
build [options]
|
|
902
|
+
build [options] Build an SDK.
|
|
671
903
|
help [command] display help for command
|
|
672
904
|
```
|
|
673
905
|
|
|
@@ -686,12 +918,15 @@ Options:
|
|
|
686
918
|
```
|
|
687
919
|
Usage: scalar sdk create [options]
|
|
688
920
|
|
|
689
|
-
Create a new SDK.
|
|
921
|
+
Create a new SDK. The SDK is created in the namespace of the API it is built
|
|
922
|
+
from.
|
|
690
923
|
|
|
691
924
|
Options:
|
|
692
925
|
-a, --api <api> Registry API slug
|
|
693
|
-
-n, --namespace <namespace> Team namespace
|
|
694
|
-
-l, --language <language> Language of your SDK (choices: "typescript",
|
|
926
|
+
-n, --namespace <namespace> Team namespace to look the API up in
|
|
927
|
+
-l, --language <language> Language of your SDK (choices: "typescript",
|
|
928
|
+
"python", "cli", "csharp", "java", "ruby", "php",
|
|
929
|
+
"go", "rust", "kotlin", "swift", "cpp", "dart")
|
|
695
930
|
-h, --help display help for command
|
|
696
931
|
```
|
|
697
932
|
|
|
@@ -705,7 +940,7 @@ Options:
|
|
|
705
940
|
-s, --slug <slug> SDK slug
|
|
706
941
|
-n, --namespace <namespace> Team namespace
|
|
707
942
|
--title <title> Title
|
|
708
|
-
--isPrivate <isPrivate> Privacy (public/private)
|
|
943
|
+
--isPrivate <isPrivate> Privacy (true/false or public/private)
|
|
709
944
|
-h, --help display help for command
|
|
710
945
|
```
|
|
711
946
|
|
|
@@ -725,12 +960,11 @@ Options:
|
|
|
725
960
|
```
|
|
726
961
|
Usage: scalar sdk build [options]
|
|
727
962
|
|
|
728
|
-
|
|
963
|
+
Build an SDK.
|
|
729
964
|
|
|
730
965
|
Options:
|
|
731
966
|
-s, --slug <slug> SDK slug
|
|
732
967
|
-n, --namespace <namespace> Team namespace
|
|
733
|
-
-v, --version <version> SDK Version
|
|
734
968
|
-h, --help display help for command
|
|
735
969
|
```
|
|
736
970
|
|
|
@@ -747,8 +981,10 @@ Commands:
|
|
|
747
981
|
delete [options] Delete a schema.
|
|
748
982
|
update [options] Update schema metadata.
|
|
749
983
|
list [options] List all schemas for a team namespace
|
|
750
|
-
get [options] [namespace] [slug] Get a schema document version from the
|
|
751
|
-
|
|
984
|
+
get [options] [namespace] [slug] Get a schema document version from the
|
|
985
|
+
Scalar registry
|
|
986
|
+
publish [options] [file] Publish a shared schema to the Scalar
|
|
987
|
+
registry
|
|
752
988
|
help [command] display help for command
|
|
753
989
|
```
|
|
754
990
|
|
|
@@ -775,7 +1011,7 @@ Options:
|
|
|
775
1011
|
-n, --namespace <namespace> Team namespace
|
|
776
1012
|
--title <title> Title
|
|
777
1013
|
--description <description> Description
|
|
778
|
-
--isPrivate <isPrivate> Privacy (public/private)
|
|
1014
|
+
--isPrivate <isPrivate> Privacy (true/false or public/private)
|
|
779
1015
|
-h, --help display help for command
|
|
780
1016
|
```
|
|
781
1017
|
|
|
@@ -817,7 +1053,8 @@ Arguments:
|
|
|
817
1053
|
file OpenAPI file to upload
|
|
818
1054
|
|
|
819
1055
|
Options:
|
|
820
|
-
--slug <slug> Slug identifier for the registry entry. Defaults to
|
|
1056
|
+
--slug <slug> Slug identifier for the registry entry. Defaults to
|
|
1057
|
+
title.
|
|
821
1058
|
--title <title> Schema title
|
|
822
1059
|
--namespace <namespace> Scalar team namespace
|
|
823
1060
|
--version <version> API version (e.g. 0.1.0)
|
|
@@ -825,12 +1062,36 @@ Options:
|
|
|
825
1062
|
--force Force override an existing version (default: false)
|
|
826
1063
|
--bundle Bundle all external references before uploading
|
|
827
1064
|
--treeShake Remove unused components from the bundled document
|
|
828
|
-
--urlMap Generate a map of resolved URLs when bundling the
|
|
829
|
-
|
|
1065
|
+
--urlMap Generate a map of resolved URLs when bundling the
|
|
1066
|
+
document
|
|
1067
|
+
--fetchLimit <limit> Maximum number of concurrent URLs to fetch when
|
|
1068
|
+
bundling the document
|
|
830
1069
|
-h, --help display help for command
|
|
831
1070
|
```
|
|
832
1071
|
|
|
833
1072
|
|
|
1073
|
+
## AI agents
|
|
1074
|
+
|
|
1075
|
+
`scalar context` prints the whole command tree as JSON: every command with its arguments, options, defaults, and choices, plus notes on running the CLI without prompts and what each exit code means. Point an agent at it instead of having it scrape `--help`:
|
|
1076
|
+
|
|
1077
|
+
```bash
|
|
1078
|
+
scalar context
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
The CLI also ships an [Agent Skill](https://agentskills.io) at `skills/scalar-cli/SKILL.md`, in the npm package and in the `app` directory of the standalone archives. Copy it into your agent's skills directory to teach the agent how to use the CLI:
|
|
1082
|
+
|
|
1083
|
+
```bash
|
|
1084
|
+
mkdir -p .claude/skills
|
|
1085
|
+
|
|
1086
|
+
# npm (global install)
|
|
1087
|
+
cp -r "$(npm root -g)/@scalar/cli/skills/scalar-cli" .claude/skills/
|
|
1088
|
+
|
|
1089
|
+
# Standalone CLI on macOS or Linux (the installer links `scalar` into its release directory)
|
|
1090
|
+
cp -r "$(dirname "$(readlink "$(command -v scalar)")")/app/skills/scalar-cli" .claude/skills/
|
|
1091
|
+
```
|
|
1092
|
+
|
|
1093
|
+
With the standalone CLI on Windows, the skill is in `%LOCALAPPDATA%\Scalar\current\app\skills\scalar-cli`.
|
|
1094
|
+
|
|
834
1095
|
## GitHub Actions
|
|
835
1096
|
|
|
836
1097
|
To validate your OpenAPI file in GitHub Actions, add this workflow:
|
|
@@ -859,8 +1120,7 @@ jobs:
|
|
|
859
1120
|
node-version: 24
|
|
860
1121
|
- name: Validate OpenAPI File
|
|
861
1122
|
# Replace `./my-openapi-file.yaml` with the correct path and filename for your project.
|
|
862
|
-
|
|
863
|
-
run: npx @scalar/cli validate ./my-openapi-file.yaml
|
|
1123
|
+
run: npx @scalar/cli document validate ./my-openapi-file.yaml
|
|
864
1124
|
```
|
|
865
1125
|
|
|
866
1126
|
## Development
|
|
@@ -879,6 +1139,10 @@ pnpm cli:link
|
|
|
879
1139
|
scalar --version
|
|
880
1140
|
```
|
|
881
1141
|
|
|
1142
|
+
### Docs preview from a local build
|
|
1143
|
+
|
|
1144
|
+
`scalar project preview` runs the docs in a preview server that the CLI downloads to `~/.scalar/isolate` on first use. Every CLI release publishes a matching archive to the CDN, so a released CLI always finds its own. A build from source has no archive until its version ships: the CLI then falls back to the newest published release with the same major version and says which one it used, and otherwise reports that the version is missing. To pin a specific published version instead, set `SSG_DOCS_ISOLATE_VERSION` to the version of a released CLI (`https://cdn.scalar.com/isolates/latest.json` names the newest one).
|
|
1145
|
+
|
|
882
1146
|
## Community
|
|
883
1147
|
|
|
884
1148
|
We are API nerds. You too? Let’s chat on Discord: <https://discord.gg/scalar>
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getUserTeams
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6YPQGVF4.js";
|
|
5
5
|
import {
|
|
6
6
|
getDatabaseClient
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-5DEU2DVL.js";
|
|
8
|
+
import "./chunk-MLSZVVTT.js";
|
|
9
9
|
import {
|
|
10
10
|
getAuthData,
|
|
11
11
|
refreshToken
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-QVQ4PNVL.js";
|
|
13
|
+
import "./chunk-UXJ753NV.js";
|
|
14
|
+
import "./chunk-5UHLAJQD.js";
|
|
15
|
+
import "./chunk-5JLVQVKO.js";
|
|
16
|
+
import {
|
|
17
|
+
requireInteractive
|
|
18
|
+
} from "./chunk-EGOXR5FB.js";
|
|
16
19
|
import "./chunk-4ORL4MST.js";
|
|
17
20
|
import {
|
|
18
21
|
output
|
|
@@ -38,6 +41,7 @@ async function setAction({ team }) {
|
|
|
38
41
|
}
|
|
39
42
|
let teamValue = team;
|
|
40
43
|
if (!teamValue) {
|
|
44
|
+
requireInteractive("Please provide --team with a valid team id.");
|
|
41
45
|
teamValue = await select({
|
|
42
46
|
message: "Please select one of the teams",
|
|
43
47
|
options: userTeams.data.map((it) => ({
|