@scalar/cli 2.8.0 → 2.11.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 +84 -1076
- package/chunks/action-25QMCP5G.js +122 -0
- package/chunks/{action-354TUG4H.js → action-2VF6LODL.js} +20 -16
- package/chunks/{action-XIUO64C7.js → action-5I4XDPPG.js} +20 -14
- package/chunks/action-6M5PTDF6.js +100 -0
- package/chunks/{action-NVI5DWFP.js → action-73ELLN3T.js} +8 -11
- package/chunks/{action-Y6NXJQ4H.js → action-7H3AWCHX.js} +21 -16
- package/chunks/{action-LLH4QPXM.js → action-BRSLSOE5.js} +19 -18
- package/chunks/{action-EOAVVL52.js → action-CQQCKSNS.js} +17 -22
- package/chunks/action-D5QWDNQ2.js +65 -0
- package/chunks/{action-Y7OUGD56.js → action-DQDHBOLJ.js} +34 -31
- package/chunks/{action-5SK5NE7E.js → action-EYPYQQVM.js} +18 -23
- package/chunks/{action-YRX6SN5F.js → action-FMA5ECUA.js} +12 -10
- package/chunks/{action-7PEQXDWT.js → action-GXDJLF2G.js} +134 -25
- package/chunks/action-HUICEXJZ.js +75 -0
- package/chunks/action-IH6G77C5.js +38 -0
- package/chunks/{action-H3RTILLM.js → action-IIQMZVRJ.js} +1 -1
- package/chunks/action-IQM54ITT.js +164 -0
- package/chunks/{action-UIKH4SZX.js → action-J5TO3UJW.js} +32 -26
- package/chunks/{action-H6OUJWWM.js → action-KC3ZCNDR.js} +17 -22
- package/chunks/{action-6BYGBXRC.js → action-L7TMS3Q3.js} +44 -37
- package/chunks/{action-GWXLHL2Z.js → action-LAAHRDSR.js} +5 -4
- package/chunks/{action-FCAYFPVR.js → action-LR75GHBA.js} +14 -11
- package/chunks/action-MJMLQFLT.js +1552 -0
- package/chunks/action-NHU4CUKT.js +130 -0
- package/chunks/action-NKTFNFU7.js +64 -0
- package/chunks/{action-F7A2K74G.js → action-NMW5WPD2.js} +12 -16
- package/chunks/{action-VOFDW3U2.js → action-OTPXODUE.js} +8 -7
- package/chunks/{action-43YBNBDR.js → action-RPCDNGCI.js} +54 -39
- package/chunks/{action-QQZLPI42.js → action-RQCXSJPZ.js} +55 -27
- package/chunks/action-SOYSVG67.js +147 -0
- package/chunks/action-Y7EBKCUU.js +16 -0
- package/chunks/{action-WFDNRA7D.js → action-YN4TE7TG.js} +24 -23
- package/chunks/{action-AQRPFQKI.js → action-ZGNVWTHZ.js} +14 -12
- package/chunks/action-ZKKRPLDK.js +64 -0
- package/chunks/{action-HT2DJ34Z.js → action-ZUZL7R3H.js} +20 -15
- package/chunks/{actions-OGIVBQC7.js → actions-S6K76HCW.js} +46 -19
- package/chunks/{agent-ASPV3R5U.js → agent-IRNEV4K5.js} +46 -9
- package/chunks/{asyncapi-QNFKXHEI.js → asyncapi-WQPIQMEZ.js} +15 -10
- package/chunks/{build.action-NM6CAE5F.js → build.action-CLBVKFWD.js} +28 -24
- package/chunks/chunk-25XERWCE.js +1058 -0
- package/chunks/chunk-3RIUDHLG.js +467 -0
- package/chunks/{chunk-MLSZVVTT.js → chunk-3TFOA64C.js} +19 -8
- package/chunks/{chunk-HGOD6THU.js → chunk-4JKXZ5CF.js} +12 -25
- package/chunks/{chunk-C2KAWRIX.js → chunk-5ENKYZA4.js} +1 -1
- package/chunks/{chunk-W24BETFG.js → chunk-5L7V7RCH.js} +10 -10
- package/chunks/chunk-6PSYZO3U.js +24 -0
- package/chunks/{chunk-IMG35UXX.js → chunk-ALYM4ZB2.js} +1 -1
- package/chunks/chunk-AVZFSWPD.js +37 -0
- package/chunks/{chunk-5UHLAJQD.js → chunk-BQYVSPAI.js} +36 -10
- package/chunks/{chunk-XXSQUBXS.js → chunk-CSSTCHHF.js} +6212 -4642
- package/chunks/chunk-DFOZG7ZV.js +15 -0
- package/chunks/{chunk-22HYZ7LE.js → chunk-DQD2753S.js} +3 -3
- package/chunks/{action-F2ZJNURT.js → chunk-EBNFCIKS.js} +7 -10
- package/chunks/{chunk-EXY3ZTV4.js → chunk-F3OPMYME.js} +143 -301
- package/chunks/{chunk-FDC2IESH.js → chunk-FG5AOTDN.js} +8519 -14702
- package/chunks/chunk-GKCVATQJ.js +92 -0
- package/chunks/{chunk-PH3WFNXJ.js → chunk-GMHIK5K2.js} +1 -1
- package/chunks/{chunk-GTV2BVXV.js → chunk-GYR5E6RB.js} +2 -2
- package/chunks/{chunk-OJ2EWIJH.js → chunk-HZN6IIPZ.js} +11 -6
- package/chunks/{chunk-IKT5F47M.js → chunk-I57ID5K7.js} +24 -11
- package/chunks/{chunk-BPGFSSUH.js → chunk-KOD2HX5I.js} +1 -1
- package/chunks/{chunk-L3UXDCBI.js → chunk-LOLVJNI5.js} +4 -4
- package/chunks/{chunk-KCCFN4F7.js → chunk-MN2AFJXM.js} +36 -29
- package/chunks/{chunk-UXJ753NV.js → chunk-N5CJ5MTY.js} +5 -13
- package/chunks/chunk-NAC63XJF.js +10 -0
- package/chunks/{chunk-2OCWX42S.js → chunk-NWJ37GI2.js} +166 -22
- package/chunks/{chunk-3ZJYGGAA.js → chunk-ORCUZITN.js} +1 -1
- package/chunks/chunk-QMLRYD76.js +24 -0
- package/chunks/{chunk-KKRGBXCE.js → chunk-SEURG74P.js} +303 -209
- package/chunks/{chunk-R5LK6VPY.js → chunk-SOV4POMS.js} +370 -264
- package/chunks/chunk-T34TL6KL.js +222 -0
- package/chunks/{chunk-5DEU2DVL.js → chunk-U6VE6JOS.js} +3 -15
- package/chunks/{chunk-YILQODZF.js → chunk-UFSFY7Z4.js} +23 -20
- package/chunks/{chunk-6YPQGVF4.js → chunk-ULRJZXMS.js} +1 -1
- package/chunks/chunk-US54KYOJ.js +131 -0
- package/chunks/chunk-V6LUKXBV.js +37 -0
- package/chunks/{chunk-5JLVQVKO.js → chunk-VRZSDUZK.js} +190 -152
- package/chunks/chunk-VUXPDHTQ.js +22 -0
- package/chunks/chunk-XP5UM7SF.js +21 -0
- package/chunks/chunk-Y6XGC4K5.js +311 -0
- package/chunks/{create.action-FUQ2BVJA.js → create.action-ITEOQ644.js} +34 -30
- package/chunks/{delete.action-47E66R3I.js → delete.action-77MFPLUN.js} +30 -26
- package/chunks/{delete.action-BTDFH7WY.js → delete.action-C6VX4S5Q.js} +30 -26
- package/chunks/{get.action-XC7KC2JO.js → get.action-3BP4FHZC.js} +20 -14
- package/chunks/get.action-LNBOWUVE.js +95 -0
- package/chunks/list.action-6CRFQPJT.js +156 -0
- package/chunks/list.action-KR5YIDR4.js +126 -0
- package/chunks/{publish.action-OS27XOX4.js → publish.action-YBORRPBM.js} +49 -42
- package/chunks/query-WKATAJJ6.js +129 -0
- package/chunks/scripts-6CI6U32J.js +102 -0
- package/chunks/{update.action-AEIBLCWD.js → update.action-O7TSXDGV.js} +34 -27
- package/chunks/{update.action-ZMS4CQ3T.js → update.action-QZI7M2MV.js} +34 -27
- package/index.js +579 -382
- package/package.json +15 -14
- package/skills/scalar-cli/SKILL.md +52 -46
- package/template.md +71 -136
- package/chunks/action-CA4QYPI6.js +0 -125
- package/chunks/action-JAHFRYWZ.js +0 -423
- package/chunks/action-KTYOCA2V.js +0 -229
- package/chunks/action-LEUD5P2U.js +0 -92
- package/chunks/action-LXGXKXZZ.js +0 -72
- package/chunks/action-W3C53GPH.js +0 -54
- package/chunks/action-YLF2G4G5.js +0 -37
- package/chunks/chunk-6XWCMJDB.js +0 -404
- package/chunks/chunk-K74E42RV.js +0 -7311
- package/chunks/chunk-QVQ4PNVL.js +0 -610
- package/chunks/chunk-XEDGMZJD.js +0 -366
- package/chunks/list.action-LXKEUYKO.js +0 -116
- package/chunks/list.action-OFGLMRE7.js +0 -95
- package/docs.html +0 -6245
package/README.md
CHANGED
|
@@ -2,1151 +2,159 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@scalar/cli)
|
|
4
4
|
[](https://www.npmjs.com/package/@scalar/cli)
|
|
5
|
-
[](https://www.npmjs.com/package/@scalar/cli)
|
|
6
5
|
[](https://discord.gg/scalar)
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
Validate, lint, bundle, mock, and preview OpenAPI and AsyncAPI documents from your terminal, then publish them to [Scalar](https://scalar.com).
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- Format & validate OpenAPI files
|
|
13
|
-
- Upload your OpenAPI files to Scalar
|
|
14
|
-
- Get a fully mocked API for testing purposes
|
|
15
|
-
- Preview your API reference
|
|
16
|
-
- Bundle multiple OpenAPI files
|
|
17
|
-
|
|
18
|
-
## Access groups
|
|
19
|
-
|
|
20
|
-
Manage access groups and allowed email domains for your current team:
|
|
9
|
+

|
|
21
10
|
|
|
22
11
|
```bash
|
|
23
|
-
scalar
|
|
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
|
|
12
|
+
npx @scalar/cli document validate openapi.yaml
|
|
30
13
|
```
|
|
31
14
|
|
|
32
|
-
|
|
15
|
+
[Documentation](https://scalar.com/tools/cli/getting-started) · [Command reference](https://scalar.com/tools/cli/commands) · [CI and scripting](https://scalar.com/tools/cli/ci-and-scripting) · [Discord](https://discord.gg/scalar)
|
|
33
16
|
|
|
34
|
-
|
|
17
|
+
## Common tasks
|
|
35
18
|
|
|
36
|
-
|
|
19
|
+
Every example works with `npx @scalar/cli` in place of `scalar` if you have not installed the CLI.
|
|
37
20
|
|
|
38
|
-
|
|
39
|
-
|
|
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)
|
|
41
|
-
|
|
42
|
-
## Quickstart
|
|
21
|
+
### Validate and lint an API description
|
|
43
22
|
|
|
44
23
|
```bash
|
|
45
|
-
|
|
24
|
+
scalar document validate openapi.yaml
|
|
25
|
+
scalar document lint openapi.yaml
|
|
26
|
+
scalar document lint openapi.yaml --rule .spectral.yaml
|
|
46
27
|
```
|
|
47
28
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
### Standalone CLI (no Node.js required)
|
|
29
|
+
`validate` checks the document against the OpenAPI or AsyncAPI specification. `lint` applies Spectral rules and fails only on errors. [Lint reports and baselines →](https://scalar.com/tools/cli/ci-and-scripting#lint-reports)
|
|
51
30
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
macOS and Linux (Bash):
|
|
31
|
+
### Bundle split files into one
|
|
55
32
|
|
|
56
33
|
```bash
|
|
57
|
-
|
|
34
|
+
scalar document bundle openapi.yaml --output openapi.bundled.yaml
|
|
35
|
+
scalar document bundle openapi.yaml --output openapi.bundled.yaml --treeShake
|
|
58
36
|
```
|
|
59
37
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
```powershell
|
|
63
|
-
irm https://cdn.scalar.com/cli/install.ps1 | iex
|
|
64
|
-
```
|
|
38
|
+
Pulls every external `$ref` into a single file. `--treeShake` drops components nothing uses. The input can be a URL.
|
|
65
39
|
|
|
66
|
-
|
|
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:
|
|
40
|
+
### Preview the API reference
|
|
75
41
|
|
|
76
42
|
```bash
|
|
77
|
-
|
|
43
|
+
scalar document serve openapi.yaml --watch
|
|
78
44
|
```
|
|
79
45
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
### Conflict: EXIST: file already exists
|
|
83
|
-
|
|
84
|
-
There’s another `scalar` CLI, which is bundled with `git`. If you run into naming conflicts, but never use the other CLI anyway, you can replace it like this:
|
|
46
|
+
Serves an interactive API reference that reloads as you edit. Pass `--config reference.json` for [API Reference options](https://scalar.com/products/api-references/configuration).
|
|
85
47
|
|
|
86
|
-
|
|
87
|
-
npm -g --force install @scalar/cli
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Or, if you want to keep using the other `scalar` CLI, you can just stick to `npx` (or `pnpm dlx`):
|
|
48
|
+
### Mock the API
|
|
91
49
|
|
|
92
50
|
```bash
|
|
93
|
-
|
|
94
|
-
npx @scalar/cli help
|
|
95
|
-
|
|
96
|
-
# Execute without installation (pnpm)
|
|
97
|
-
pnpm dlx @scalar/cli help
|
|
98
|
-
```
|
|
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
|
-
}
|
|
51
|
+
scalar document mock openapi.yaml --watch
|
|
113
52
|
```
|
|
114
53
|
|
|
115
|
-
|
|
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
|
-
|
|
129
|
-
## Commands
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
Usage: scalar [options] [command]
|
|
133
|
-
|
|
134
|
-
CLI to work with your OpenAPI files
|
|
135
|
-
|
|
136
|
-
Options:
|
|
137
|
-
-v, --version output the version number
|
|
138
|
-
-h, --help display help for command
|
|
54
|
+
Starts a mock server that answers with the examples and schemas in your document, so you can try requests before the API exists.
|
|
139
55
|
|
|
140
|
-
|
|
141
|
-
readme Open documentation for the CLI
|
|
142
|
-
upgrade Upgrade current version of your cli
|
|
143
|
-
context Print every command, argument, and option as JSON for AI
|
|
144
|
-
agents
|
|
145
|
-
auth Manage authorization on scalar platform
|
|
146
|
-
access-group Manage access groups and allowed email domains for the current
|
|
147
|
-
team
|
|
148
|
-
document Manage local openapi file
|
|
149
|
-
project Manage scalar project
|
|
150
|
-
registry Manage your scalar registry
|
|
151
|
-
team Manage user teams
|
|
152
|
-
sdk Manage your Scalar SDKs (Enterprise Only)
|
|
153
|
-
schema Manage your Scalar schemas
|
|
154
|
-
help [command] display help for command
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### readme
|
|
158
|
-
```
|
|
159
|
-
Usage: scalar readme [options] [command]
|
|
160
|
-
|
|
161
|
-
Open documentation for the CLI
|
|
162
|
-
|
|
163
|
-
Options:
|
|
164
|
-
-h, --help display help for command
|
|
165
|
-
|
|
166
|
-
Commands:
|
|
167
|
-
generate [options] Self generate documentation for the cli
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
#### generate
|
|
171
|
-
```
|
|
172
|
-
Usage: scalar readme generate [options]
|
|
173
|
-
|
|
174
|
-
Self generate documentation for the cli
|
|
175
|
-
|
|
176
|
-
Options:
|
|
177
|
-
-o, --output [file] Path where the documentation file will be written
|
|
178
|
-
-h, --help display help for command
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### upgrade
|
|
182
|
-
```
|
|
183
|
-
Usage: scalar upgrade [options]
|
|
184
|
-
|
|
185
|
-
Upgrade current version of your cli
|
|
186
|
-
|
|
187
|
-
Options:
|
|
188
|
-
-h, --help display help for command
|
|
189
|
-
```
|
|
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
|
-
|
|
201
|
-
### auth
|
|
202
|
-
```
|
|
203
|
-
Usage: scalar auth [options] [command]
|
|
204
|
-
|
|
205
|
-
Manage authorization on scalar platform
|
|
206
|
-
|
|
207
|
-
Options:
|
|
208
|
-
-h, --help display help for command
|
|
209
|
-
|
|
210
|
-
Commands:
|
|
211
|
-
login [options] Login to scalar
|
|
212
|
-
whoami Display the current user
|
|
213
|
-
logout Logout from scalar
|
|
214
|
-
help [command] display help for command
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
#### login
|
|
218
|
-
```
|
|
219
|
-
Usage: scalar auth login [options]
|
|
220
|
-
|
|
221
|
-
Login to scalar
|
|
222
|
-
|
|
223
|
-
Options:
|
|
224
|
-
--email <email> Email
|
|
225
|
-
--password <password> Password
|
|
226
|
-
--token <token> Personal token
|
|
227
|
-
-h, --help display help for command
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
#### whoami
|
|
231
|
-
```
|
|
232
|
-
Usage: scalar auth whoami [options]
|
|
233
|
-
|
|
234
|
-
Display the current user
|
|
235
|
-
|
|
236
|
-
Options:
|
|
237
|
-
-h, --help display help for command
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
#### logout
|
|
241
|
-
```
|
|
242
|
-
Usage: scalar auth logout [options]
|
|
243
|
-
|
|
244
|
-
Logout from scalar
|
|
245
|
-
|
|
246
|
-
Options:
|
|
247
|
-
-h, --help display help for command
|
|
248
|
-
```
|
|
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
|
-
|
|
376
|
-
### document
|
|
377
|
-
```
|
|
378
|
-
Usage: scalar document [options] [command]
|
|
379
|
-
|
|
380
|
-
Manage local openapi file
|
|
381
|
-
|
|
382
|
-
Options:
|
|
383
|
-
-h, --help display help for command
|
|
384
|
-
|
|
385
|
-
Commands:
|
|
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
|
|
392
|
-
format [options] [file|url] Format an OpenAPI or AsyncAPI file
|
|
393
|
-
convert [options] [file|url] Convert a Postman collection to an OpenAPI
|
|
394
|
-
document
|
|
395
|
-
markdown [options] [file|url] Generate Markdown from an OpenAPI file
|
|
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
|
|
400
|
-
share [options] [file] Share an OpenAPI or AsyncAPI file
|
|
401
|
-
validate [file|url] Validate an OpenAPI or AsyncAPI file
|
|
402
|
-
void [options] Boot a server to mirror HTTP requests
|
|
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
|
|
407
|
-
help [command] display help for command
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
#### bundle
|
|
411
|
-
```
|
|
412
|
-
Usage: scalar document bundle [options] [file|url]
|
|
413
|
-
|
|
414
|
-
Bundle an OpenAPI document by resolving all references and external dependencies
|
|
415
|
-
|
|
416
|
-
Arguments:
|
|
417
|
-
file|url Path to OpenAPI file or URL to bundle
|
|
418
|
-
|
|
419
|
-
Options:
|
|
420
|
-
-o, --output <file> Path to save the bundled output file
|
|
421
|
-
--treeShake Remove unused components from the bundled output
|
|
422
|
-
--urlMap Generate a map of resolved URLs in the bundled output
|
|
423
|
-
--fetchLimit <limit> Maximum number of URLs to fetch during bundling at the
|
|
424
|
-
same time
|
|
425
|
-
-h, --help display help for command
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
#### split
|
|
429
|
-
```
|
|
430
|
-
Usage: scalar document split [options] [file|url]
|
|
431
|
-
|
|
432
|
-
Split OpenAPI or AsyncAPI documents into small chunks
|
|
433
|
-
|
|
434
|
-
Arguments:
|
|
435
|
-
file|url Path to OpenAPI or AsyncAPI file or URL to split
|
|
436
|
-
|
|
437
|
-
Options:
|
|
438
|
-
-o, --output <path> Path to save the chunks
|
|
439
|
-
-h, --help display help for command
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
#### join
|
|
443
|
-
```
|
|
444
|
-
Usage: scalar document join [options] <files...>
|
|
445
|
-
|
|
446
|
-
Merge multiple OpenAPI or AsyncAPI documents into a single unified document
|
|
447
|
-
|
|
448
|
-
Arguments:
|
|
449
|
-
files Paths to the OpenAPI or AsyncAPI files to merge
|
|
450
|
-
|
|
451
|
-
Options:
|
|
452
|
-
--output -o <file> Path to save the merged output file
|
|
453
|
-
--prefix-components-with-path-value -p <path> Dot-separated path to extract a prefix value from each input file for component names
|
|
454
|
-
-h, --help display help for command
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
#### format
|
|
458
|
-
```
|
|
459
|
-
Usage: scalar document format [options] [file|url]
|
|
460
|
-
|
|
461
|
-
Format an OpenAPI or AsyncAPI file
|
|
462
|
-
|
|
463
|
-
Arguments:
|
|
464
|
-
file|url File or URL to format
|
|
465
|
-
|
|
466
|
-
Options:
|
|
467
|
-
-o, --output <file> Output file
|
|
468
|
-
-h, --help display help for command
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
#### convert
|
|
472
|
-
```
|
|
473
|
-
Usage: scalar document convert [options] [file|url]
|
|
474
|
-
|
|
475
|
-
Convert a Postman collection to an OpenAPI document
|
|
476
|
-
|
|
477
|
-
Arguments:
|
|
478
|
-
file|url Postman collection file path or URL to convert
|
|
479
|
-
|
|
480
|
-
Options:
|
|
481
|
-
-o, --output <file> Output file (defaults to stdout)
|
|
482
|
-
--merge-operations Merge operations with shared path+method combinations
|
|
483
|
-
-h, --help display help for command
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
#### markdown
|
|
487
|
-
```
|
|
488
|
-
Usage: scalar document markdown [options] [file|url]
|
|
489
|
-
|
|
490
|
-
Generate Markdown from an OpenAPI file
|
|
491
|
-
|
|
492
|
-
Arguments:
|
|
493
|
-
file|url OpenAPI file path or URL to convert
|
|
494
|
-
|
|
495
|
-
Options:
|
|
496
|
-
-o, --output <file> Output file (defaults to stdout)
|
|
497
|
-
-h, --help display help for command
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
#### mock
|
|
501
|
-
```
|
|
502
|
-
Usage: scalar document mock [options] [file|url]
|
|
503
|
-
|
|
504
|
-
Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels
|
|
505
|
-
|
|
506
|
-
Arguments:
|
|
507
|
-
file|url OpenAPI or AsyncAPI file or URL to mock
|
|
508
|
-
|
|
509
|
-
Options:
|
|
510
|
-
-w, --watch watch the file for changes
|
|
511
|
-
-o, --once run the server only once and exit after that
|
|
512
|
-
-p, --port <port> set the HTTP port for the mock server
|
|
513
|
-
-h, --help display help for command
|
|
514
|
-
```
|
|
515
|
-
|
|
516
|
-
#### serve
|
|
517
|
-
```
|
|
518
|
-
Usage: scalar document serve [options] [file|url]
|
|
519
|
-
|
|
520
|
-
Serve an API Reference from an OpenAPI or AsyncAPI file
|
|
521
|
-
|
|
522
|
-
Arguments:
|
|
523
|
-
file|url OpenAPI or AsyncAPI file or URL to show the reference for
|
|
524
|
-
|
|
525
|
-
Options:
|
|
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
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
#### share
|
|
534
|
-
```
|
|
535
|
-
Usage: scalar document share [options] [file]
|
|
536
|
-
|
|
537
|
-
Share an OpenAPI or AsyncAPI file
|
|
538
|
-
|
|
539
|
-
Arguments:
|
|
540
|
-
file file to share
|
|
541
|
-
|
|
542
|
-
Options:
|
|
543
|
-
-t, --token <token> pass a token to update an existing sandbox
|
|
544
|
-
-h, --help display help for command
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
#### validate
|
|
548
|
-
```
|
|
549
|
-
Usage: scalar document validate [options] [file|url]
|
|
550
|
-
|
|
551
|
-
Validate an OpenAPI or AsyncAPI file
|
|
552
|
-
|
|
553
|
-
Arguments:
|
|
554
|
-
file|url File or URL to validate
|
|
555
|
-
|
|
556
|
-
Options:
|
|
557
|
-
-h, --help display help for command
|
|
558
|
-
```
|
|
559
|
-
|
|
560
|
-
#### void
|
|
561
|
-
```
|
|
562
|
-
Usage: scalar document void [options]
|
|
56
|
+
### Upgrade and convert
|
|
563
57
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
-o, --once run the server only once and exit after that
|
|
568
|
-
-p, --port <port> set the HTTP port for the mock server
|
|
569
|
-
-h, --help display help for command
|
|
570
|
-
```
|
|
571
|
-
|
|
572
|
-
#### lint
|
|
573
|
-
```
|
|
574
|
-
Usage: scalar document lint [options] [file|url]
|
|
575
|
-
|
|
576
|
-
Lint your OpenAPI or AsyncAPI file using spectral rules
|
|
577
|
-
|
|
578
|
-
Arguments:
|
|
579
|
-
file|url OpenAPI or AsyncAPI file path or url
|
|
580
|
-
|
|
581
|
-
Options:
|
|
582
|
-
-r, --rule <file|url> Rule path or url
|
|
583
|
-
-h, --help display help for command
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
#### upgrade
|
|
587
|
-
```
|
|
588
|
-
Usage: scalar document upgrade [options] [file|url]
|
|
589
|
-
|
|
590
|
-
Upgrade an OpenAPI or AsyncAPI document to version 3.1
|
|
591
|
-
|
|
592
|
-
Arguments:
|
|
593
|
-
file|url File or URL to upgrade
|
|
594
|
-
|
|
595
|
-
Options:
|
|
596
|
-
-o, --output <file> Path to save the upgraded output file
|
|
597
|
-
-h, --help display help for command
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
### project
|
|
601
|
-
```
|
|
602
|
-
Usage: scalar project [options] [command]
|
|
603
|
-
|
|
604
|
-
Manage scalar project
|
|
605
|
-
|
|
606
|
-
Options:
|
|
607
|
-
-h, --help display help for command
|
|
608
|
-
|
|
609
|
-
Commands:
|
|
610
|
-
init [options] Create a new Scalar Docs project.
|
|
611
|
-
check-config [file] Check a Scalar Configuration file
|
|
612
|
-
create [options] Create a new project that is not linked to a
|
|
613
|
-
github project.
|
|
614
|
-
preview [options] [config] Preview scalar guides
|
|
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.
|
|
619
|
-
deployments Inspect a project deployment history.
|
|
620
|
-
upgrade [config] Upgrade scalar project
|
|
621
|
-
help [command] display help for command
|
|
622
|
-
```
|
|
623
|
-
|
|
624
|
-
#### init
|
|
625
|
-
```
|
|
626
|
-
Usage: scalar project init [options]
|
|
627
|
-
|
|
628
|
-
Create a new Scalar Docs project.
|
|
629
|
-
|
|
630
|
-
Options:
|
|
631
|
-
-s, --subdomain [url] subdomain to publish on
|
|
632
|
-
--force override existing configuration
|
|
633
|
-
-h, --help display help for command
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
#### check-config
|
|
637
|
-
```
|
|
638
|
-
Usage: scalar project check-config [options] [file]
|
|
639
|
-
|
|
640
|
-
Check a Scalar Configuration file
|
|
641
|
-
|
|
642
|
-
Arguments:
|
|
643
|
-
file File to check
|
|
644
|
-
|
|
645
|
-
Options:
|
|
646
|
-
-h, --help display help for command
|
|
647
|
-
```
|
|
648
|
-
|
|
649
|
-
#### create
|
|
650
|
-
```
|
|
651
|
-
Usage: scalar project create [options]
|
|
652
|
-
|
|
653
|
-
Create a new project that is not linked to a github project.
|
|
654
|
-
|
|
655
|
-
Options:
|
|
656
|
-
-n, --name <name> name of your project
|
|
657
|
-
-s, --slug <slug> project slug
|
|
658
|
-
-h, --help display help for command
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
#### preview
|
|
662
|
-
```
|
|
663
|
-
Usage: scalar project preview [options] [config]
|
|
664
|
-
|
|
665
|
-
Preview scalar guides
|
|
666
|
-
|
|
667
|
-
Arguments:
|
|
668
|
-
config Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)
|
|
669
|
-
|
|
670
|
-
Options:
|
|
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
|
|
676
|
-
```
|
|
677
|
-
|
|
678
|
-
#### publish
|
|
679
|
-
```
|
|
680
|
-
Usage: scalar project publish [options]
|
|
681
|
-
|
|
682
|
-
Publish new build for a github sync project that is not linked.
|
|
683
|
-
|
|
684
|
-
Options:
|
|
685
|
-
-s, --slug [slug] Project slug found in Scalar Dashboard
|
|
686
|
-
-c, --config [config] Your config file of the project
|
|
687
|
-
-p, --preview Publish in preview mode
|
|
688
|
-
-g, --github Publish from your linked remote GitHub repository
|
|
689
|
-
-h, --help display help for command
|
|
690
|
-
```
|
|
691
|
-
|
|
692
|
-
#### rollback
|
|
693
|
-
```
|
|
694
|
-
Usage: scalar project rollback [options]
|
|
695
|
-
|
|
696
|
-
Roll the live deployment back to a previously deployed build.
|
|
697
|
-
|
|
698
|
-
Options:
|
|
699
|
-
-s, --slug [slug] Project slug found in Scalar Dashboard
|
|
700
|
-
-t, --to <publishUid> Roll back to a specific build id (defaults to the next
|
|
701
|
-
older deployed build)
|
|
702
|
-
-y, --yes Skip the confirmation prompt
|
|
703
|
-
-h, --help display help for command
|
|
704
|
-
```
|
|
705
|
-
|
|
706
|
-
#### deployments
|
|
707
|
-
```
|
|
708
|
-
Usage: scalar project deployments [options] [command]
|
|
709
|
-
|
|
710
|
-
Inspect a project deployment history.
|
|
711
|
-
|
|
712
|
-
Options:
|
|
713
|
-
-h, --help display help for command
|
|
714
|
-
|
|
715
|
-
Commands:
|
|
716
|
-
list [options] List the production deployment history for a project.
|
|
717
|
-
help [command] display help for command
|
|
718
|
-
```
|
|
719
|
-
|
|
720
|
-
##### list
|
|
721
|
-
```
|
|
722
|
-
Usage: scalar project deployments list [options]
|
|
723
|
-
|
|
724
|
-
List the production deployment history for a project.
|
|
725
|
-
|
|
726
|
-
Options:
|
|
727
|
-
-s, --slug [slug] Project slug found in Scalar Dashboard
|
|
728
|
-
-h, --help display help for command
|
|
729
|
-
```
|
|
730
|
-
|
|
731
|
-
#### upgrade
|
|
732
|
-
```
|
|
733
|
-
Usage: scalar project upgrade [options] [config]
|
|
734
|
-
|
|
735
|
-
Upgrade scalar project
|
|
736
|
-
|
|
737
|
-
Arguments:
|
|
738
|
-
config Path to the Scalar configuration file (usually
|
|
739
|
-
`scalar.config.json5` or `scalar.config.json`)
|
|
740
|
-
|
|
741
|
-
Options:
|
|
742
|
-
-h, --help display help for command
|
|
743
|
-
```
|
|
744
|
-
|
|
745
|
-
### registry
|
|
746
|
-
```
|
|
747
|
-
Usage: scalar registry [options] [command]
|
|
748
|
-
|
|
749
|
-
Manage your scalar registry
|
|
750
|
-
|
|
751
|
-
Options:
|
|
752
|
-
-h, --help display help for command
|
|
753
|
-
|
|
754
|
-
Commands:
|
|
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
|
|
759
|
-
delete [namespace] [slug] Delete a document from scalar registry
|
|
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
|
|
764
|
-
help [command] display help for command
|
|
765
|
-
```
|
|
766
|
-
|
|
767
|
-
#### publish
|
|
768
|
-
```
|
|
769
|
-
Usage: scalar registry publish [options] [file]
|
|
770
|
-
|
|
771
|
-
Publish an OpenAPI document to the Scalar registry
|
|
772
|
-
|
|
773
|
-
Arguments:
|
|
774
|
-
file OpenAPI file to upload
|
|
775
|
-
|
|
776
|
-
Options:
|
|
777
|
-
--slug <slug> Slug identifier for the registry entry. Defaults to
|
|
778
|
-
title.
|
|
779
|
-
--namespace <namespace> Scalar team namespace
|
|
780
|
-
--version <version> API version (e.g. 0.1.0)
|
|
781
|
-
--private Make API private (default: false)
|
|
782
|
-
--no-current Do not set as the current version
|
|
783
|
-
--force Force override an existing version (default: false)
|
|
784
|
-
--bundle Bundle all external references before uploading
|
|
785
|
-
--treeShake Remove unused components from the bundled document
|
|
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
|
|
790
|
-
-h, --help display help for command
|
|
791
|
-
```
|
|
792
|
-
|
|
793
|
-
#### update
|
|
794
|
-
```
|
|
795
|
-
Usage: scalar registry update [options] [namespace] [slug]
|
|
796
|
-
|
|
797
|
-
Update document metadata on scalar registry
|
|
798
|
-
|
|
799
|
-
Arguments:
|
|
800
|
-
namespace namespace of document you want to update
|
|
801
|
-
slug slug of document you want to update
|
|
802
|
-
|
|
803
|
-
Options:
|
|
804
|
-
--title <title> Document title
|
|
805
|
-
--description <description> Document description
|
|
806
|
-
-h, --help display help for command
|
|
807
|
-
```
|
|
808
|
-
|
|
809
|
-
#### delete
|
|
810
|
-
```
|
|
811
|
-
Usage: scalar registry delete [options] [namespace] [slug]
|
|
812
|
-
|
|
813
|
-
Delete a document from scalar registry
|
|
814
|
-
|
|
815
|
-
Arguments:
|
|
816
|
-
namespace Team namespace
|
|
817
|
-
slug Managed doc slug
|
|
818
|
-
|
|
819
|
-
Options:
|
|
820
|
-
-h, --help display help for command
|
|
821
|
-
```
|
|
822
|
-
|
|
823
|
-
#### list
|
|
824
|
-
```
|
|
825
|
-
Usage: scalar registry list [options]
|
|
826
|
-
|
|
827
|
-
List all registry APIs for a team namespace
|
|
828
|
-
|
|
829
|
-
Options:
|
|
830
|
-
--namespace <namespace> Team namespace
|
|
831
|
-
-h, --help display help for command
|
|
832
|
-
```
|
|
833
|
-
|
|
834
|
-
#### get
|
|
835
|
-
```
|
|
836
|
-
Usage: scalar registry get [options] [namespace] [slug]
|
|
837
|
-
|
|
838
|
-
Get a document version from scalar registry
|
|
839
|
-
|
|
840
|
-
Arguments:
|
|
841
|
-
namespace Team namespace
|
|
842
|
-
slug Managed doc slug
|
|
843
|
-
|
|
844
|
-
Options:
|
|
845
|
-
--version <version> Document version (defaults to latest)
|
|
846
|
-
--format <format> Output format (json or yaml) (default: "json")
|
|
847
|
-
-o, --output <file> Output file (defaults to stdout)
|
|
848
|
-
-h, --help display help for command
|
|
849
|
-
```
|
|
850
|
-
|
|
851
|
-
### team
|
|
852
|
-
```
|
|
853
|
-
Usage: scalar team [options] [command]
|
|
854
|
-
|
|
855
|
-
Manage user teams
|
|
856
|
-
|
|
857
|
-
Options:
|
|
858
|
-
-h, --help display help for command
|
|
859
|
-
|
|
860
|
-
Commands:
|
|
861
|
-
list List all teams current user is part of
|
|
862
|
-
set [options] Set current active team for the user
|
|
863
|
-
help [command] display help for command
|
|
864
|
-
```
|
|
865
|
-
|
|
866
|
-
#### list
|
|
867
|
-
```
|
|
868
|
-
Usage: scalar team list [options]
|
|
869
|
-
|
|
870
|
-
List all teams current user is part of
|
|
871
|
-
|
|
872
|
-
Options:
|
|
873
|
-
-h, --help display help for command
|
|
874
|
-
```
|
|
875
|
-
|
|
876
|
-
#### set
|
|
877
|
-
```
|
|
878
|
-
Usage: scalar team set [options]
|
|
879
|
-
|
|
880
|
-
Set current active team for the user
|
|
881
|
-
|
|
882
|
-
Options:
|
|
883
|
-
--team <team> Team uid
|
|
884
|
-
-h, --help display help for command
|
|
885
|
-
```
|
|
886
|
-
|
|
887
|
-
### sdk
|
|
888
|
-
```
|
|
889
|
-
Usage: scalar sdk [options] [command]
|
|
890
|
-
|
|
891
|
-
Manage your Scalar SDKs (Enterprise Only)
|
|
892
|
-
|
|
893
|
-
Options:
|
|
894
|
-
-h, --help display help for command
|
|
895
|
-
|
|
896
|
-
Commands:
|
|
897
|
-
list [options] List all SDKs for a team namespace
|
|
898
|
-
create [options] Create a new SDK. The SDK is created in the namespace of the
|
|
899
|
-
API it is built from.
|
|
900
|
-
update [options] Update SDK metadata.
|
|
901
|
-
delete [options] Delete an SDK.
|
|
902
|
-
build [options] Build an SDK.
|
|
903
|
-
help [command] display help for command
|
|
904
|
-
```
|
|
905
|
-
|
|
906
|
-
#### list
|
|
907
|
-
```
|
|
908
|
-
Usage: scalar sdk list [options]
|
|
909
|
-
|
|
910
|
-
List all SDKs for a team namespace
|
|
911
|
-
|
|
912
|
-
Options:
|
|
913
|
-
--namespace <namespace> Team namespace
|
|
914
|
-
-h, --help display help for command
|
|
915
|
-
```
|
|
916
|
-
|
|
917
|
-
#### create
|
|
918
|
-
```
|
|
919
|
-
Usage: scalar sdk create [options]
|
|
920
|
-
|
|
921
|
-
Create a new SDK. The SDK is created in the namespace of the API it is built
|
|
922
|
-
from.
|
|
923
|
-
|
|
924
|
-
Options:
|
|
925
|
-
-a, --api <api> Registry API slug
|
|
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")
|
|
930
|
-
-h, --help display help for command
|
|
931
|
-
```
|
|
932
|
-
|
|
933
|
-
#### update
|
|
934
|
-
```
|
|
935
|
-
Usage: scalar sdk update [options]
|
|
936
|
-
|
|
937
|
-
Update SDK metadata.
|
|
938
|
-
|
|
939
|
-
Options:
|
|
940
|
-
-s, --slug <slug> SDK slug
|
|
941
|
-
-n, --namespace <namespace> Team namespace
|
|
942
|
-
--title <title> Title
|
|
943
|
-
--isPrivate <isPrivate> Privacy (true/false or public/private)
|
|
944
|
-
-h, --help display help for command
|
|
945
|
-
```
|
|
946
|
-
|
|
947
|
-
#### delete
|
|
948
|
-
```
|
|
949
|
-
Usage: scalar sdk delete [options]
|
|
950
|
-
|
|
951
|
-
Delete an SDK.
|
|
952
|
-
|
|
953
|
-
Options:
|
|
954
|
-
-s, --slug <slug> SDK slug
|
|
955
|
-
-n, --namespace <namespace> Team namespace
|
|
956
|
-
-h, --help display help for command
|
|
957
|
-
```
|
|
958
|
-
|
|
959
|
-
#### build
|
|
960
|
-
```
|
|
961
|
-
Usage: scalar sdk build [options]
|
|
962
|
-
|
|
963
|
-
Build an SDK.
|
|
964
|
-
|
|
965
|
-
Options:
|
|
966
|
-
-s, --slug <slug> SDK slug
|
|
967
|
-
-n, --namespace <namespace> Team namespace
|
|
968
|
-
-h, --help display help for command
|
|
969
|
-
```
|
|
970
|
-
|
|
971
|
-
### schema
|
|
972
|
-
```
|
|
973
|
-
Usage: scalar schema [options] [command]
|
|
974
|
-
|
|
975
|
-
Manage your Scalar schemas
|
|
976
|
-
|
|
977
|
-
Options:
|
|
978
|
-
-h, --help display help for command
|
|
979
|
-
|
|
980
|
-
Commands:
|
|
981
|
-
delete [options] Delete a schema.
|
|
982
|
-
update [options] Update schema metadata.
|
|
983
|
-
list [options] List all schemas for a team namespace
|
|
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
|
|
988
|
-
help [command] display help for command
|
|
989
|
-
```
|
|
990
|
-
|
|
991
|
-
#### delete
|
|
992
|
-
```
|
|
993
|
-
Usage: scalar schema delete [options]
|
|
994
|
-
|
|
995
|
-
Delete a schema.
|
|
996
|
-
|
|
997
|
-
Options:
|
|
998
|
-
-s, --slug <slug> Schema slug
|
|
999
|
-
-n, --namespace <namespace> Team namespace
|
|
1000
|
-
-h, --help display help for command
|
|
1001
|
-
```
|
|
1002
|
-
|
|
1003
|
-
#### update
|
|
1004
|
-
```
|
|
1005
|
-
Usage: scalar schema update [options]
|
|
1006
|
-
|
|
1007
|
-
Update schema metadata.
|
|
1008
|
-
|
|
1009
|
-
Options:
|
|
1010
|
-
-s, --slug <slug> Schema slug
|
|
1011
|
-
-n, --namespace <namespace> Team namespace
|
|
1012
|
-
--title <title> Title
|
|
1013
|
-
--description <description> Description
|
|
1014
|
-
--isPrivate <isPrivate> Privacy (true/false or public/private)
|
|
1015
|
-
-h, --help display help for command
|
|
58
|
+
```bash
|
|
59
|
+
scalar document upgrade swagger.json --output openapi.json
|
|
60
|
+
scalar document convert postman-collection.json --output openapi.json
|
|
1016
61
|
```
|
|
1017
62
|
|
|
1018
|
-
|
|
1019
|
-
```
|
|
1020
|
-
Usage: scalar schema list [options]
|
|
63
|
+
Upgrades Swagger 2.0 and OpenAPI 3.0 to OpenAPI 3.1, and converts Postman collections to OpenAPI.
|
|
1021
64
|
|
|
1022
|
-
|
|
65
|
+
### Publish to Scalar
|
|
1023
66
|
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
67
|
+
```bash
|
|
68
|
+
scalar auth login
|
|
69
|
+
scalar registry publish openapi.yaml --namespace acme --slug my-api --version 1.0.0
|
|
70
|
+
scalar project preview
|
|
71
|
+
scalar project publish --slug my-docs
|
|
1027
72
|
```
|
|
1028
73
|
|
|
1029
|
-
|
|
1030
|
-
```
|
|
1031
|
-
Usage: scalar schema get [options] [namespace] [slug]
|
|
74
|
+
Push API descriptions to the [Scalar Registry](https://scalar.com/products/registry/getting-started), preview a Scalar Docs project locally, and publish it. In CI, run `scalar auth login --token <token>`, or set `SCALAR_API_KEY` and run `scalar auth login`.
|
|
1032
75
|
|
|
1033
|
-
|
|
76
|
+
## Install
|
|
1034
77
|
|
|
1035
|
-
|
|
1036
|
-
namespace Team namespace
|
|
1037
|
-
slug Schema slug
|
|
78
|
+
Standalone binary, no Node.js required:
|
|
1038
79
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
-o, --output <file> Output file (defaults to stdout)
|
|
1043
|
-
-h, --help display help for command
|
|
80
|
+
```bash
|
|
81
|
+
# macOS and Linux
|
|
82
|
+
curl -fsSL https://cdn.scalar.com/cli/install.sh | bash
|
|
1044
83
|
```
|
|
1045
84
|
|
|
1046
|
-
|
|
85
|
+
```powershell
|
|
86
|
+
# Windows (PowerShell)
|
|
87
|
+
irm https://cdn.scalar.com/cli/install.ps1 | iex
|
|
1047
88
|
```
|
|
1048
|
-
Usage: scalar schema publish [options] [file]
|
|
1049
89
|
|
|
1050
|
-
|
|
90
|
+
Or with npm:
|
|
1051
91
|
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
Options:
|
|
1056
|
-
--slug <slug> Slug identifier for the registry entry. Defaults to
|
|
1057
|
-
title.
|
|
1058
|
-
--title <title> Schema title
|
|
1059
|
-
--namespace <namespace> Scalar team namespace
|
|
1060
|
-
--version <version> API version (e.g. 0.1.0)
|
|
1061
|
-
--private Make API private (default: false)
|
|
1062
|
-
--force Force override an existing version (default: false)
|
|
1063
|
-
--bundle Bundle all external references before uploading
|
|
1064
|
-
--treeShake Remove unused components from the bundled document
|
|
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
|
|
1069
|
-
-h, --help display help for command
|
|
92
|
+
```bash
|
|
93
|
+
npm install --global @scalar/cli
|
|
1070
94
|
```
|
|
1071
95
|
|
|
96
|
+
Git ships an unrelated `scalar` executable. If it gets in the way, use npm's `scalar-cli` alias, or run `npm install --global --force @scalar/cli` to replace it. The [installation guide](https://scalar.com/tools/cli/getting-started#installation) covers upgrades and shell completion.
|
|
1072
97
|
|
|
1073
|
-
## AI agents
|
|
98
|
+
## Use with AI agents
|
|
1074
99
|
|
|
1075
|
-
`scalar context` prints
|
|
100
|
+
`scalar context` prints every command, argument, option, default, and choice as JSON, plus notes on running without prompts. Point your agent at it instead of `--help`:
|
|
1076
101
|
|
|
1077
102
|
```bash
|
|
1078
103
|
scalar context
|
|
1079
104
|
```
|
|
1080
105
|
|
|
1081
|
-
The
|
|
106
|
+
The package also ships an [Agent Skill](https://agentskills.io) at `skills/scalar-cli/SKILL.md`. Copy it into your project:
|
|
1082
107
|
|
|
1083
108
|
```bash
|
|
1084
109
|
mkdir -p .claude/skills
|
|
1085
|
-
|
|
1086
|
-
# npm (global install)
|
|
1087
110
|
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
111
|
```
|
|
1092
112
|
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
## GitHub Actions
|
|
1096
|
-
|
|
1097
|
-
To validate your OpenAPI file in GitHub Actions, add this workflow:
|
|
113
|
+
## Use in CI
|
|
1098
114
|
|
|
1099
115
|
```yml
|
|
1100
|
-
# .github/workflows/
|
|
1101
|
-
name:
|
|
1102
|
-
|
|
1103
|
-
on:
|
|
1104
|
-
push:
|
|
1105
|
-
branches:
|
|
1106
|
-
- main
|
|
1107
|
-
pull_request:
|
|
1108
|
-
branches:
|
|
1109
|
-
- main
|
|
116
|
+
# .github/workflows/openapi.yml
|
|
117
|
+
name: OpenAPI
|
|
118
|
+
on: [push, pull_request]
|
|
1110
119
|
|
|
1111
120
|
jobs:
|
|
1112
|
-
|
|
121
|
+
lint:
|
|
1113
122
|
runs-on: ubuntu-latest
|
|
1114
|
-
|
|
1115
123
|
steps:
|
|
1116
|
-
- uses: actions/checkout@
|
|
1117
|
-
-
|
|
1118
|
-
uses: actions/setup-node@v4
|
|
124
|
+
- uses: actions/checkout@v6
|
|
125
|
+
- uses: actions/setup-node@v6
|
|
1119
126
|
with:
|
|
1120
127
|
node-version: 24
|
|
1121
|
-
-
|
|
1122
|
-
# Replace `./my-openapi-file.yaml` with the correct path and filename for your project.
|
|
1123
|
-
run: npx @scalar/cli document validate ./my-openapi-file.yaml
|
|
1124
|
-
```
|
|
1125
|
-
|
|
1126
|
-
## Development
|
|
1127
|
-
|
|
1128
|
-
Set up the development environment:
|
|
1129
|
-
|
|
1130
|
-
```bash
|
|
1131
|
-
pnpm install
|
|
1132
|
-
pnpm @scalar/cli --version
|
|
1133
|
-
```
|
|
1134
|
-
|
|
1135
|
-
To symlink the package and use it globally on your machine:
|
|
1136
|
-
|
|
1137
|
-
```bash
|
|
1138
|
-
pnpm cli:link
|
|
1139
|
-
scalar --version
|
|
128
|
+
- run: npx --yes @scalar/cli document lint openapi.yaml --format github-actions
|
|
1140
129
|
```
|
|
1141
130
|
|
|
1142
|
-
|
|
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).
|
|
131
|
+
`--format github-actions` turns findings into annotations on the pull request. [JSON output, JUnit reports, and lint baselines →](https://scalar.com/tools/cli/ci-and-scripting)
|
|
1145
132
|
|
|
1146
|
-
##
|
|
1147
|
-
|
|
1148
|
-
We are API nerds. You too? Let’s chat on Discord: <https://discord.gg/scalar>
|
|
1149
|
-
|
|
1150
|
-
## License
|
|
133
|
+
## Commands
|
|
1151
134
|
|
|
1152
|
-
|
|
135
|
+
| Command | Description | Subcommands |
|
|
136
|
+
| --- | --- | --- |
|
|
137
|
+
| [`scalar auth`](https://scalar.com/tools/cli/commands/auth) | Log in to Scalar and manage your session | `login`, `whoami`, `logout` |
|
|
138
|
+
| [`scalar access-group`](https://scalar.com/tools/cli/commands/access-group) | Manage access groups and allowed email domains for the current team | `list`, `create`, `get`, `update`, `delete`, `domain add`, `domain remove` |
|
|
139
|
+
| [`scalar document`](https://scalar.com/tools/cli/commands/document) | Work with OpenAPI and AsyncAPI descriptions | `bundle`, `split`, `join`, `format`, `convert`, `markdown`, `mock`, `serve`, `share`, `validate`, `void`, `lint`, `upgrade` |
|
|
140
|
+
| [`scalar project`](https://scalar.com/tools/cli/commands/project) | Manage Scalar Docs projects | `list`, `get`, `init`, `check-config`, `create`, `preview`, `publish`, `rollback`, `deployments list`, `upgrade` |
|
|
141
|
+
| [`scalar registry`](https://scalar.com/tools/cli/commands/registry) | Manage API descriptions in the Scalar Registry | `publish`, `update`, `delete`, `list`, `get` |
|
|
142
|
+
| [`scalar team`](https://scalar.com/tools/cli/commands/team) | List and switch between your Scalar teams | `list`, `get`, `set` |
|
|
143
|
+
| [`scalar sdk`](https://scalar.com/tools/cli/commands/sdk) | Manage Scalar SDKs (Enterprise only) | `list`, `get`, `create`, `update`, `delete`, `build` |
|
|
144
|
+
| [`scalar schema`](https://scalar.com/tools/cli/commands/schema) | Manage shared schemas in the Scalar Registry | `delete`, `update`, `list`, `get`, `publish` |
|
|
145
|
+
| [`scalar readme`](https://scalar.com/tools/cli/commands/general#readme) | Open CLI documentation in your browser | `generate` |
|
|
146
|
+
| [`scalar upgrade`](https://scalar.com/tools/cli/commands/general#upgrade) | Upgrade the Scalar CLI to the latest version | |
|
|
147
|
+
| [`scalar context`](https://scalar.com/tools/cli/commands/general#context) | Print every command, argument, and option as JSON for AI agents | |
|
|
148
|
+
| [`scalar completion`](https://scalar.com/tools/cli/commands/general#completion) | Generate shell completion definitions | |
|
|
149
|
+
|
|
150
|
+
Run `scalar <command> --help` for options, or see the [command reference](https://scalar.com/tools/cli/commands).
|
|
151
|
+
|
|
152
|
+
### Authentication details
|
|
153
|
+
|
|
154
|
+
Run `scalar auth whoami` to show your email, current team name and ID, role, and
|
|
155
|
+
authentication method (browser session or personal token). Use
|
|
156
|
+
`scalar auth whoami --json` for structured output with `email`,
|
|
157
|
+
`team: { uid, name }`, `role`, and `authentication` (`browser_session` or
|
|
158
|
+
`personal_token`). If the team name cannot be loaded, the team ID remains
|
|
159
|
+
available and JSON returns `null` for the name. Missing email or role values
|
|
160
|
+
also return `null`. Credentials are never included.
|