@scalar/cli 2.8.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +281 -65
- package/chunks/action-4GZI2M5B.js +62 -0
- package/chunks/action-4W5GUGEG.js +63 -0
- package/chunks/{action-FCAYFPVR.js → action-5LF4XYHX.js} +10 -7
- package/chunks/{action-XIUO64C7.js → action-5N3P43MD.js} +17 -12
- package/chunks/{action-Y7OUGD56.js → action-5RL4NWUZ.js} +17 -17
- package/chunks/{action-LXGXKXZZ.js → action-657A4K2D.js} +16 -16
- package/chunks/{action-EOAVVL52.js → action-7XOHYWYM.js} +11 -14
- package/chunks/{action-AQRPFQKI.js → action-CABLS46Q.js} +9 -7
- package/chunks/{action-F7A2K74G.js → action-CB55NWAU.js} +9 -13
- package/chunks/{action-5SK5NE7E.js → action-DKDRAIKV.js} +11 -14
- package/chunks/{action-7PEQXDWT.js → action-DTEO4YNX.js} +127 -20
- package/chunks/{action-UIKH4SZX.js → action-EAUTQ77U.js} +27 -23
- package/chunks/{action-YLF2G4G5.js → action-FBRY5JKU.js} +16 -16
- package/chunks/{action-VOFDW3U2.js → action-GFLRD7LO.js} +6 -5
- package/chunks/{action-GWXLHL2Z.js → action-GWYYTUTM.js} +4 -3
- package/chunks/{action-6BYGBXRC.js → action-HT42NUUX.js} +27 -22
- package/chunks/action-JEYDBB3P.js +147 -0
- package/chunks/{action-LLH4QPXM.js → action-KDUFU7TZ.js} +11 -13
- package/chunks/{action-W3C53GPH.js → action-LYCNT3KA.js} +29 -10
- package/chunks/{action-CA4QYPI6.js → action-OJ2NK25F.js} +4 -8
- package/chunks/{action-NVI5DWFP.js → action-PAM2EZ22.js} +4 -8
- package/chunks/action-PPTFYZWD.js +1552 -0
- package/chunks/{action-43YBNBDR.js → action-R4PGILN4.js} +28 -24
- package/chunks/{action-QQZLPI42.js → action-TOBU74JH.js} +23 -19
- package/chunks/action-U2L5DCFG.js +91 -0
- package/chunks/{action-H6OUJWWM.js → action-UUL6SWV4.js} +11 -14
- package/chunks/{action-354TUG4H.js → action-X7BA7PQQ.js} +10 -8
- package/chunks/{action-WFDNRA7D.js → action-XLE37MZL.js} +16 -16
- package/chunks/{action-Y6NXJQ4H.js → action-XOADBXSX.js} +16 -12
- package/chunks/{action-LEUD5P2U.js → action-YSVTZVKV.js} +36 -17
- package/chunks/{action-YRX6SN5F.js → action-ZFI77WA5.js} +8 -6
- package/chunks/{action-HT2DJ34Z.js → action-ZKA3RR3S.js} +15 -11
- package/chunks/{actions-OGIVBQC7.js → actions-3SAMH7A5.js} +41 -17
- package/chunks/{agent-ASPV3R5U.js → agent-2ESZI7NO.js} +7 -5
- package/chunks/{asyncapi-QNFKXHEI.js → asyncapi-4HGVM3PR.js} +14 -10
- package/chunks/{build.action-NM6CAE5F.js → build.action-VBGFGACM.js} +19 -17
- package/chunks/chunk-35Z7VTJT.js +453 -0
- package/chunks/chunk-36LXIJIZ.js +52 -0
- package/chunks/{chunk-KKRGBXCE.js → chunk-43WALAW3.js} +248 -103
- package/chunks/{chunk-C2KAWRIX.js → chunk-5ENKYZA4.js} +1 -1
- package/chunks/{chunk-GTV2BVXV.js → chunk-5SMP756H.js} +2 -2
- package/chunks/{chunk-5JLVQVKO.js → chunk-6M7TL2G2.js} +146 -148
- package/chunks/chunk-6PSYZO3U.js +24 -0
- package/chunks/{chunk-EXY3ZTV4.js → chunk-ATNTXKMS.js} +36 -274
- package/chunks/{chunk-PH3WFNXJ.js → chunk-BIMLCGKS.js} +1 -1
- package/chunks/{chunk-HGOD6THU.js → chunk-CWVYOXXM.js} +2 -19
- package/chunks/chunk-DFOZG7ZV.js +15 -0
- package/chunks/chunk-DHZW7Q7U.js +133 -0
- package/chunks/{chunk-R5LK6VPY.js → chunk-G4HRW2FZ.js} +13 -20
- package/chunks/{chunk-KCCFN4F7.js → chunk-GLWTVLKM.js} +29 -29
- package/chunks/{chunk-5UHLAJQD.js → chunk-GYRQPDTK.js} +24 -10
- package/chunks/chunk-H467HDVV.js +24 -0
- package/chunks/chunk-IPZP3VRA.js +327 -0
- package/chunks/{chunk-2OCWX42S.js → chunk-JXGF5EHC.js} +152 -18
- package/chunks/chunk-K2HIB5BA.js +92 -0
- package/chunks/{chunk-FDC2IESH.js → chunk-KHF2QXBG.js} +1352 -8327
- package/chunks/{chunk-IMG35UXX.js → chunk-KZNRQVMY.js} +1 -1
- package/chunks/{chunk-OJ2EWIJH.js → chunk-MC4EMNOR.js} +5 -1
- package/chunks/{chunk-YILQODZF.js → chunk-MMWSCTDB.js} +7 -4
- package/chunks/{chunk-6XWCMJDB.js → chunk-MNNGUUKJ.js} +12 -11
- package/chunks/chunk-NAC63XJF.js +10 -0
- package/chunks/{chunk-XXSQUBXS.js → chunk-UDBSV3CK.js} +107 -453
- package/chunks/{chunk-IKT5F47M.js → chunk-VVRUSQCY.js} +11 -11
- package/chunks/{chunk-BPGFSSUH.js → chunk-VYFGRLVQ.js} +1 -1
- package/chunks/{chunk-UXJ753NV.js → chunk-WB6PWTMU.js} +5 -13
- package/chunks/{chunk-5DEU2DVL.js → chunk-WDIWLXLV.js} +3 -15
- package/chunks/{chunk-6YPQGVF4.js → chunk-WIEXQUTD.js} +1 -1
- package/chunks/{chunk-W24BETFG.js → chunk-XAGJJNQW.js} +3 -3
- package/chunks/{chunk-22HYZ7LE.js → chunk-ZGNDXPLU.js} +3 -3
- package/chunks/{chunk-XEDGMZJD.js → chunk-ZGVZU6L2.js} +81 -25
- package/chunks/{chunk-L3UXDCBI.js → chunk-ZKJPLWRJ.js} +2 -2
- package/chunks/{chunk-MLSZVVTT.js → chunk-ZYBLQ5CT.js} +13 -7
- package/chunks/{create.action-FUQ2BVJA.js → create.action-DBNIS665.js} +19 -17
- package/chunks/{delete.action-BTDFH7WY.js → delete.action-GBOZC45K.js} +19 -17
- package/chunks/{delete.action-47E66R3I.js → delete.action-K7BLK7DK.js} +19 -17
- package/chunks/{get.action-XC7KC2JO.js → get.action-N3JOY3OU.js} +17 -12
- package/chunks/get.action-QHKMYZBK.js +91 -0
- package/chunks/{list.action-LXKEUYKO.js → list.action-6SSO3JVN.js} +45 -15
- package/chunks/{list.action-OFGLMRE7.js → list.action-TJCS6UEY.js} +39 -19
- package/chunks/{publish.action-OS27XOX4.js → publish.action-T24VHRMR.js} +27 -22
- package/chunks/query-WKATAJJ6.js +129 -0
- package/chunks/scripts-VIBLGKYG.js +102 -0
- package/chunks/{update.action-ZMS4CQ3T.js → update.action-OGYNBXRU.js} +23 -18
- package/chunks/{update.action-AEIBLCWD.js → update.action-VOE6PH5F.js} +23 -18
- package/docs.html +941 -209
- package/index.js +374 -182
- package/package.json +14 -13
- package/skills/scalar-cli/SKILL.md +7 -1
- package/template.md +148 -26
- package/chunks/action-JAHFRYWZ.js +0 -423
- package/chunks/action-KTYOCA2V.js +0 -229
- package/chunks/chunk-K74E42RV.js +0 -7311
- package/chunks/chunk-QVQ4PNVL.js +0 -610
package/README.md
CHANGED
|
@@ -15,25 +15,22 @@ Command-line interface to work with OpenAPI files
|
|
|
15
15
|
- Preview your API reference
|
|
16
16
|
- Bundle multiple OpenAPI files
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Projects
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Discover project slugs and inspect project details without opening the Dashboard:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
scalar auth login
|
|
24
|
-
scalar
|
|
25
|
-
scalar
|
|
26
|
-
scalar
|
|
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
|
|
24
|
+
scalar project list
|
|
25
|
+
scalar project get my-docs
|
|
26
|
+
scalar project deployments list --slug my-docs
|
|
30
27
|
```
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
These commands use your existing login and current team. The list includes unified docs projects and legacy sync or unlinked projects, with migrated projects shown once. Older Dashboard editor projects are not included.
|
|
33
30
|
|
|
34
|
-
Use
|
|
31
|
+
Use `scalar project list --json` for an array of project details and `scalar project get my-docs --json` for one object. Both include `uid`, `name`, `slug`, `provider`, `isPrivate`, `repository`, and `activeDeployment`. An unlinked repository or absent live deployment is `null`; the provider is `forgejo`, `github`, `bitbucket`, or `unlinked`. The live deployment describes the active build, not a failed or pending publish attempt.
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
Project listing retrieves every page. On older servers that truncate the list without a continuation cursor, it exits with an error instead of printing an incomplete list. Errors go to stderr and exit nonzero.
|
|
37
34
|
|
|
38
35
|
## Documentation
|
|
39
36
|
|
|
@@ -97,6 +94,55 @@ npx @scalar/cli help
|
|
|
97
94
|
pnpm dlx @scalar/cli help
|
|
98
95
|
```
|
|
99
96
|
|
|
97
|
+
## Shell completion
|
|
98
|
+
|
|
99
|
+
Generate completions for Bash, Zsh, or Fish with the installed CLI on PATH. These instructions work for both `npm -g install @scalar/cli` and the standalone installer. Completion runs locally, needs no login or network access, and discovers commands, nested commands, flags, and finite option values from the installed CLI. File arguments and file options retain native filesystem completion.
|
|
100
|
+
|
|
101
|
+
### Bash
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
mkdir -p ~/.local/share/scalar
|
|
105
|
+
scalar completion bash > ~/.local/share/scalar/completion.bash
|
|
106
|
+
source ~/.local/share/scalar/completion.bash
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Add `source ~/.local/share/scalar/completion.bash` to `~/.bashrc`, or `~/.bash_profile` for a macOS login shell. Bash 3.2 and newer are supported. The script registers both `scalar` and `scalar-cli`.
|
|
110
|
+
|
|
111
|
+
### Zsh
|
|
112
|
+
|
|
113
|
+
```zsh
|
|
114
|
+
mkdir -p ~/.zsh/completions
|
|
115
|
+
scalar completion zsh > ~/.zsh/completions/_scalar
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Add the following to `~/.zshrc`, placing the `fpath` line before your existing `compinit` setup. If your shell already initializes completion, keep that setup instead of calling `compinit` twice.
|
|
119
|
+
|
|
120
|
+
```zsh
|
|
121
|
+
fpath=(~/.zsh/completions $fpath)
|
|
122
|
+
autoload -Uz compinit
|
|
123
|
+
compinit
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Open a new shell. Both `scalar` and `scalar-cli` use the same completion function.
|
|
127
|
+
|
|
128
|
+
### Fish
|
|
129
|
+
|
|
130
|
+
```fish
|
|
131
|
+
mkdir -p ~/.config/fish/completions
|
|
132
|
+
scalar completion fish > ~/.config/fish/completions/scalar.fish
|
|
133
|
+
cp ~/.config/fish/completions/scalar.fish ~/.config/fish/completions/scalar-cli.fish
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Open a new shell. The second file enables autoloading when using `scalar-cli`; it is optional for standalone installs that only provide `scalar`.
|
|
137
|
+
|
|
138
|
+
### Upgrades and removal
|
|
139
|
+
|
|
140
|
+
Completion reads the installed executable's command definitions on each Tab press, so new commands and options appear after an upgrade. Regenerate your script by repeating the generation command with `>` after upgrading with npm or re-running the standalone installer, then open a new shell. This also refreshes any improvements to the shell adapter. Avoid appending scripts with `>>`.
|
|
141
|
+
|
|
142
|
+
To remove completion, delete the generated file (both files for Fish) and remove the `source` line for Bash or the Scalar `fpath` entry for Zsh, then open a new shell. Keep shared `compinit` setup used by other tools.
|
|
143
|
+
|
|
144
|
+
These scripts target installed `scalar` and `scalar-cli` executables, not `npx` or `pnpm dlx` invocations. If Git's unrelated `scalar` executable takes precedence on PATH, use npm's `scalar-cli` alias or correct your PATH before installing completions. Standalone installations provide `scalar`.
|
|
145
|
+
|
|
100
146
|
## API Reference configuration
|
|
101
147
|
|
|
102
148
|
Pass API Reference options as a JSON object:
|
|
@@ -126,6 +172,19 @@ precedence over `--token`. Unset it to use a different explicit token.
|
|
|
126
172
|
Supply required options in automation instead of relying on interactive prompts.
|
|
127
173
|
For example, pass `--output` for document transformations.
|
|
128
174
|
|
|
175
|
+
## Team discovery
|
|
176
|
+
|
|
177
|
+
After logging in, run `scalar team list` to see your teams and their copyable UIDs. The current team is marked as the default. Use a UID with `scalar team set --team <uid>` to switch teams.
|
|
178
|
+
|
|
179
|
+
Run `scalar team get` to see the current team's UID, name, slug, and namespaces. Both discovery commands support `--json` for scripts:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
scalar team list --json
|
|
183
|
+
scalar team get --json
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`team list --json` returns an array of `{ uid, name, current }` objects. `team get --json` returns `{ uid, name, slug, namespaces }`. Empty lists and namespace arrays remain empty arrays in JSON output. Personal-token logins can inspect their current team, but switching teams still requires logging in with a token for that team.
|
|
187
|
+
|
|
129
188
|
## Commands
|
|
130
189
|
|
|
131
190
|
```
|
|
@@ -134,24 +193,23 @@ Usage: scalar [options] [command]
|
|
|
134
193
|
CLI to work with your OpenAPI files
|
|
135
194
|
|
|
136
195
|
Options:
|
|
137
|
-
-v, --version
|
|
138
|
-
-h, --help
|
|
196
|
+
-v, --version output the version number
|
|
197
|
+
-h, --help display help for command
|
|
139
198
|
|
|
140
199
|
Commands:
|
|
141
|
-
readme
|
|
142
|
-
upgrade
|
|
143
|
-
context
|
|
144
|
-
|
|
145
|
-
auth
|
|
146
|
-
access-group
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
help [command] display help for command
|
|
200
|
+
readme Open documentation for the CLI
|
|
201
|
+
upgrade Upgrade current version of your cli
|
|
202
|
+
context Print every command, argument, and option as JSON for AI agents
|
|
203
|
+
completion <shell> Generate shell completion definitions
|
|
204
|
+
auth Manage authorization on scalar platform
|
|
205
|
+
access-group Manage access groups and allowed email domains for the current team
|
|
206
|
+
document Manage local openapi file
|
|
207
|
+
project Manage scalar project
|
|
208
|
+
registry Manage your scalar registry
|
|
209
|
+
team Manage user teams
|
|
210
|
+
sdk Manage your Scalar SDKs (Enterprise Only)
|
|
211
|
+
schema Manage your Scalar schemas
|
|
212
|
+
help [command] display help for command
|
|
155
213
|
```
|
|
156
214
|
|
|
157
215
|
### readme
|
|
@@ -198,6 +256,19 @@ Options:
|
|
|
198
256
|
-h, --help display help for command
|
|
199
257
|
```
|
|
200
258
|
|
|
259
|
+
### completion
|
|
260
|
+
```
|
|
261
|
+
Usage: scalar completion [options] <shell>
|
|
262
|
+
|
|
263
|
+
Generate shell completion definitions
|
|
264
|
+
|
|
265
|
+
Arguments:
|
|
266
|
+
shell Shell to configure (choices: "bash", "zsh", "fish")
|
|
267
|
+
|
|
268
|
+
Options:
|
|
269
|
+
-h, --help display help for command
|
|
270
|
+
```
|
|
271
|
+
|
|
201
272
|
### auth
|
|
202
273
|
```
|
|
203
274
|
Usage: scalar auth [options] [command]
|
|
@@ -221,10 +292,8 @@ Usage: scalar auth login [options]
|
|
|
221
292
|
Login to scalar
|
|
222
293
|
|
|
223
294
|
Options:
|
|
224
|
-
--
|
|
225
|
-
--
|
|
226
|
-
--token <token> Personal token
|
|
227
|
-
-h, --help display help for command
|
|
295
|
+
--token <token> Personal token
|
|
296
|
+
-h, --help display help for command
|
|
228
297
|
```
|
|
229
298
|
|
|
230
299
|
#### whoami
|
|
@@ -257,6 +326,7 @@ Options:
|
|
|
257
326
|
-h, --help display help for command
|
|
258
327
|
|
|
259
328
|
Commands:
|
|
329
|
+
list [options] List access groups for the current team
|
|
260
330
|
create [options] <slug> Create an access group (Pro or above)
|
|
261
331
|
get [options] <slug> Get an access group and its allowlists
|
|
262
332
|
update [options] <slug> Update access group metadata
|
|
@@ -266,6 +336,17 @@ Commands:
|
|
|
266
336
|
help [command] display help for command
|
|
267
337
|
```
|
|
268
338
|
|
|
339
|
+
#### list
|
|
340
|
+
```
|
|
341
|
+
Usage: scalar access-group list [options]
|
|
342
|
+
|
|
343
|
+
List access groups for the current team
|
|
344
|
+
|
|
345
|
+
Options:
|
|
346
|
+
--json Print the result as JSON
|
|
347
|
+
-h, --help display help for command
|
|
348
|
+
```
|
|
349
|
+
|
|
269
350
|
#### create
|
|
270
351
|
```
|
|
271
352
|
Usage: scalar access-group create [options] <slug>
|
|
@@ -446,12 +527,12 @@ Usage: scalar document join [options] <files...>
|
|
|
446
527
|
Merge multiple OpenAPI or AsyncAPI documents into a single unified document
|
|
447
528
|
|
|
448
529
|
Arguments:
|
|
449
|
-
files
|
|
530
|
+
files Paths to the OpenAPI or AsyncAPI files to merge
|
|
450
531
|
|
|
451
532
|
Options:
|
|
452
|
-
--output
|
|
453
|
-
--prefix-components-with-path-value
|
|
454
|
-
-h, --help
|
|
533
|
+
-o, --output <file> Path to save the merged output file
|
|
534
|
+
-p, --prefix-components-with-path-value <path> Dot-separated path to extract a prefix value from each input file for component names
|
|
535
|
+
-h, --help display help for command
|
|
455
536
|
```
|
|
456
537
|
|
|
457
538
|
#### format
|
|
@@ -576,11 +657,20 @@ Usage: scalar document lint [options] [file|url]
|
|
|
576
657
|
Lint your OpenAPI or AsyncAPI file using spectral rules
|
|
577
658
|
|
|
578
659
|
Arguments:
|
|
579
|
-
file|url
|
|
660
|
+
file|url OpenAPI or AsyncAPI file path or url
|
|
580
661
|
|
|
581
662
|
Options:
|
|
582
|
-
-r, --rule <file|url>
|
|
583
|
-
|
|
663
|
+
-r, --rule <file|url> Rule path or url
|
|
664
|
+
--format <format> Report format (choices: "text", "codeframe",
|
|
665
|
+
"markdown", "summary", "json", "github-actions",
|
|
666
|
+
"junit", default: "codeframe")
|
|
667
|
+
--max-problems <number> Maximum displayed findings (totals and exit status
|
|
668
|
+
include all findings) (default: 100)
|
|
669
|
+
-o, --output <file> Write the report to a file instead of stdout
|
|
670
|
+
--generate-ignore-file Record current findings in the ignore baseline
|
|
671
|
+
--ignore-file <file> Ignore baseline path (Scalar file takes priority over
|
|
672
|
+
Redocly fallback in the current directory)
|
|
673
|
+
-h, --help display help for command
|
|
584
674
|
```
|
|
585
675
|
|
|
586
676
|
#### upgrade
|
|
@@ -607,6 +697,9 @@ Options:
|
|
|
607
697
|
-h, --help display help for command
|
|
608
698
|
|
|
609
699
|
Commands:
|
|
700
|
+
list [options] List projects and their slugs for the current
|
|
701
|
+
team.
|
|
702
|
+
get [options] <slug> Get project details for the current team.
|
|
610
703
|
init [options] Create a new Scalar Docs project.
|
|
611
704
|
check-config [file] Check a Scalar Configuration file
|
|
612
705
|
create [options] Create a new project that is not linked to a
|
|
@@ -621,6 +714,31 @@ Commands:
|
|
|
621
714
|
help [command] display help for command
|
|
622
715
|
```
|
|
623
716
|
|
|
717
|
+
#### list
|
|
718
|
+
```
|
|
719
|
+
Usage: scalar project list [options]
|
|
720
|
+
|
|
721
|
+
List projects and their slugs for the current team.
|
|
722
|
+
|
|
723
|
+
Options:
|
|
724
|
+
--json Print project details as JSON
|
|
725
|
+
-h, --help display help for command
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
#### get
|
|
729
|
+
```
|
|
730
|
+
Usage: scalar project get [options] <slug>
|
|
731
|
+
|
|
732
|
+
Get project details for the current team.
|
|
733
|
+
|
|
734
|
+
Arguments:
|
|
735
|
+
slug Project slug from scalar project list
|
|
736
|
+
|
|
737
|
+
Options:
|
|
738
|
+
--json Print project details as JSON
|
|
739
|
+
-h, --help display help for command
|
|
740
|
+
```
|
|
741
|
+
|
|
624
742
|
#### init
|
|
625
743
|
```
|
|
626
744
|
Usage: scalar project init [options]
|
|
@@ -665,12 +783,17 @@ Usage: scalar project preview [options] [config]
|
|
|
665
783
|
Preview scalar guides
|
|
666
784
|
|
|
667
785
|
Arguments:
|
|
668
|
-
config Path to the Scalar configuration file (usually
|
|
786
|
+
config Path to the Scalar configuration file (usually
|
|
787
|
+
`scalar.config.json5` or `scalar.config.json`)
|
|
669
788
|
|
|
670
789
|
Options:
|
|
671
|
-
-p, --port [port] port to run the server on. If the port is not
|
|
672
|
-
|
|
673
|
-
|
|
790
|
+
-p, --port [port] port to run the server on. If the port is not
|
|
791
|
+
available, it will select another one. (default:
|
|
792
|
+
"7970")
|
|
793
|
+
-H, --host [host] Specify which IP addresses the server should listen
|
|
794
|
+
on.
|
|
795
|
+
-L, --log-level <level> Set the log level (choices: "debug", "info", default:
|
|
796
|
+
"info")
|
|
674
797
|
-N, --no-open Do not open the browser automatically
|
|
675
798
|
-h, --help display help for command
|
|
676
799
|
```
|
|
@@ -682,7 +805,7 @@ Usage: scalar project publish [options]
|
|
|
682
805
|
Publish new build for a github sync project that is not linked.
|
|
683
806
|
|
|
684
807
|
Options:
|
|
685
|
-
-s, --slug [slug] Project slug
|
|
808
|
+
-s, --slug [slug] Project slug from scalar project list
|
|
686
809
|
-c, --config [config] Your config file of the project
|
|
687
810
|
-p, --preview Publish in preview mode
|
|
688
811
|
-g, --github Publish from your linked remote GitHub repository
|
|
@@ -696,7 +819,7 @@ Usage: scalar project rollback [options]
|
|
|
696
819
|
Roll the live deployment back to a previously deployed build.
|
|
697
820
|
|
|
698
821
|
Options:
|
|
699
|
-
-s, --slug [slug] Project slug
|
|
822
|
+
-s, --slug [slug] Project slug from scalar project list
|
|
700
823
|
-t, --to <publishUid> Roll back to a specific build id (defaults to the next
|
|
701
824
|
older deployed build)
|
|
702
825
|
-y, --yes Skip the confirmation prompt
|
|
@@ -724,7 +847,7 @@ Usage: scalar project deployments list [options]
|
|
|
724
847
|
List the production deployment history for a project.
|
|
725
848
|
|
|
726
849
|
Options:
|
|
727
|
-
-s, --slug [slug] Project slug
|
|
850
|
+
-s, --slug [slug] Project slug from scalar project list
|
|
728
851
|
-h, --help display help for command
|
|
729
852
|
```
|
|
730
853
|
|
|
@@ -828,6 +951,7 @@ List all registry APIs for a team namespace
|
|
|
828
951
|
|
|
829
952
|
Options:
|
|
830
953
|
--namespace <namespace> Team namespace
|
|
954
|
+
--json Output registry API metadata as JSON
|
|
831
955
|
-h, --help display help for command
|
|
832
956
|
```
|
|
833
957
|
|
|
@@ -843,7 +967,7 @@ Arguments:
|
|
|
843
967
|
|
|
844
968
|
Options:
|
|
845
969
|
--version <version> Document version (defaults to latest)
|
|
846
|
-
--format <format> Output format (json or yaml) (default: "json")
|
|
970
|
+
--format <format> Output format (json or yaml) (choices: "json", "yaml", default: "json")
|
|
847
971
|
-o, --output <file> Output file (defaults to stdout)
|
|
848
972
|
-h, --help display help for command
|
|
849
973
|
```
|
|
@@ -858,7 +982,8 @@ Options:
|
|
|
858
982
|
-h, --help display help for command
|
|
859
983
|
|
|
860
984
|
Commands:
|
|
861
|
-
list
|
|
985
|
+
list [options] List all teams current user is part of
|
|
986
|
+
get [options] Get the current team and its namespaces
|
|
862
987
|
set [options] Set current active team for the user
|
|
863
988
|
help [command] display help for command
|
|
864
989
|
```
|
|
@@ -870,6 +995,18 @@ Usage: scalar team list [options]
|
|
|
870
995
|
List all teams current user is part of
|
|
871
996
|
|
|
872
997
|
Options:
|
|
998
|
+
--json Output teams as JSON
|
|
999
|
+
-h, --help display help for command
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
#### get
|
|
1003
|
+
```
|
|
1004
|
+
Usage: scalar team get [options]
|
|
1005
|
+
|
|
1006
|
+
Get the current team and its namespaces
|
|
1007
|
+
|
|
1008
|
+
Options:
|
|
1009
|
+
--json Output the current team as JSON
|
|
873
1010
|
-h, --help display help for command
|
|
874
1011
|
```
|
|
875
1012
|
|
|
@@ -895,6 +1032,7 @@ Options:
|
|
|
895
1032
|
|
|
896
1033
|
Commands:
|
|
897
1034
|
list [options] List all SDKs for a team namespace
|
|
1035
|
+
get [options] Inspect SDK metadata, API source, versions, and build status
|
|
898
1036
|
create [options] Create a new SDK. The SDK is created in the namespace of the
|
|
899
1037
|
API it is built from.
|
|
900
1038
|
update [options] Update SDK metadata.
|
|
@@ -910,10 +1048,24 @@ Usage: scalar sdk list [options]
|
|
|
910
1048
|
List all SDKs for a team namespace
|
|
911
1049
|
|
|
912
1050
|
Options:
|
|
1051
|
+
--json Output structured SDK metadata as JSON
|
|
913
1052
|
--namespace <namespace> Team namespace
|
|
914
1053
|
-h, --help display help for command
|
|
915
1054
|
```
|
|
916
1055
|
|
|
1056
|
+
#### get
|
|
1057
|
+
```
|
|
1058
|
+
Usage: scalar sdk get [options]
|
|
1059
|
+
|
|
1060
|
+
Inspect SDK metadata, API source, versions, and build status
|
|
1061
|
+
|
|
1062
|
+
Options:
|
|
1063
|
+
-s, --slug <slug> SDK slug
|
|
1064
|
+
-n, --namespace <namespace> Team namespace
|
|
1065
|
+
--json Output structured SDK metadata as JSON
|
|
1066
|
+
-h, --help display help for command
|
|
1067
|
+
```
|
|
1068
|
+
|
|
917
1069
|
#### create
|
|
918
1070
|
```
|
|
919
1071
|
Usage: scalar sdk create [options]
|
|
@@ -940,7 +1092,7 @@ Options:
|
|
|
940
1092
|
-s, --slug <slug> SDK slug
|
|
941
1093
|
-n, --namespace <namespace> Team namespace
|
|
942
1094
|
--title <title> Title
|
|
943
|
-
--isPrivate <isPrivate> Privacy (true/false or public/private)
|
|
1095
|
+
--isPrivate <isPrivate> Privacy (true/false or public/private) (choices: "true", "false", "public", "private")
|
|
944
1096
|
-h, --help display help for command
|
|
945
1097
|
```
|
|
946
1098
|
|
|
@@ -1011,7 +1163,7 @@ Options:
|
|
|
1011
1163
|
-n, --namespace <namespace> Team namespace
|
|
1012
1164
|
--title <title> Title
|
|
1013
1165
|
--description <description> Description
|
|
1014
|
-
--isPrivate <isPrivate> Privacy (true/false or public/private)
|
|
1166
|
+
--isPrivate <isPrivate> Privacy (true/false or public/private) (choices: "true", "false", "public", "private")
|
|
1015
1167
|
-h, --help display help for command
|
|
1016
1168
|
```
|
|
1017
1169
|
|
|
@@ -1023,6 +1175,7 @@ List all schemas for a team namespace
|
|
|
1023
1175
|
|
|
1024
1176
|
Options:
|
|
1025
1177
|
--namespace <namespace> Team namespace
|
|
1178
|
+
--json Output schema metadata as JSON
|
|
1026
1179
|
-h, --help display help for command
|
|
1027
1180
|
```
|
|
1028
1181
|
|
|
@@ -1038,7 +1191,7 @@ Arguments:
|
|
|
1038
1191
|
|
|
1039
1192
|
Options:
|
|
1040
1193
|
--version <version> Schema version (defaults to latest)
|
|
1041
|
-
--format <format> Output format (json or yaml) (default: "json")
|
|
1194
|
+
--format <format> Output format (json or yaml) (choices: "json", "yaml", default: "json")
|
|
1042
1195
|
-o, --output <file> Output file (defaults to stdout)
|
|
1043
1196
|
-h, --help display help for command
|
|
1044
1197
|
```
|
|
@@ -1092,6 +1245,36 @@ cp -r "$(dirname "$(readlink "$(command -v scalar)")")/app/skills/scalar-cli" .c
|
|
|
1092
1245
|
|
|
1093
1246
|
With the standalone CLI on Windows, the skill is in `%LOCALAPPDATA%\Scalar\current\app\skills\scalar-cli`.
|
|
1094
1247
|
|
|
1248
|
+
## Inspect SDKs
|
|
1249
|
+
|
|
1250
|
+
Use your current team login to inspect an SDK by slug. The namespace defaults to the team's first namespace.
|
|
1251
|
+
|
|
1252
|
+
```bash
|
|
1253
|
+
scalar sdk get --slug widgets --namespace acme
|
|
1254
|
+
scalar sdk get --slug widgets --namespace acme --json
|
|
1255
|
+
scalar sdk list --namespace acme --json
|
|
1256
|
+
```
|
|
1257
|
+
|
|
1258
|
+
JSON output is a metadata object for `get` and an array for `list` (including `[]` when empty). It includes the linked registry API, tracked API version, target languages and slugs, current SDK version, version history with active build IDs, and the latest attempted build with per-language generation and Git sync status. The latest attempt may be a different version or have failed; it does not replace the current version or active artifacts. Timestamps are Unix seconds; absent builds and unlinked API sources are `null`. Generator configuration, repository auth bindings, and raw build messages are excluded.
|
|
1259
|
+
|
|
1260
|
+
## Registry metadata for scripts
|
|
1261
|
+
|
|
1262
|
+
Use `scalar registry list --json` to write a JSON array to stdout. Without
|
|
1263
|
+
`--namespace`, the command uses the first namespace of your current team, just
|
|
1264
|
+
like the default table output. You must be logged in; errors go to stderr and
|
|
1265
|
+
exit with a nonzero status.
|
|
1266
|
+
|
|
1267
|
+
```bash
|
|
1268
|
+
scalar registry list --namespace scalar --json > registry-apis.json
|
|
1269
|
+
scalar registry get scalar demo-api --version 1.2.3 > openapi.json
|
|
1270
|
+
```
|
|
1271
|
+
|
|
1272
|
+
Each array entry contains `namespace` and `slug` (the coordinates accepted by
|
|
1273
|
+
`registry get`), `title` (a string, which may be empty), `version` (the current
|
|
1274
|
+
version served by default), and `isPrivate` (a boolean). JSON output includes
|
|
1275
|
+
only these metadata fields, without document content or credentials. An empty
|
|
1276
|
+
namespace returns `[]`. Omit `--json` for the human-readable table.
|
|
1277
|
+
|
|
1095
1278
|
## GitHub Actions
|
|
1096
1279
|
|
|
1097
1280
|
To validate your OpenAPI file in GitHub Actions, add this workflow:
|
|
@@ -1123,30 +1306,63 @@ jobs:
|
|
|
1123
1306
|
run: npx @scalar/cli document validate ./my-openapi-file.yaml
|
|
1124
1307
|
```
|
|
1125
1308
|
|
|
1126
|
-
##
|
|
1309
|
+
## CI lint reports and baselines
|
|
1127
1310
|
|
|
1128
|
-
|
|
1311
|
+
Lint reports support CI annotations, test-report viewers, and readable reviews:
|
|
1129
1312
|
|
|
1130
|
-
```
|
|
1131
|
-
|
|
1132
|
-
|
|
1313
|
+
```sh
|
|
1314
|
+
scalar document lint openapi.yaml --format codeframe
|
|
1315
|
+
scalar document lint openapi.yaml --format markdown --output lint-results.md
|
|
1316
|
+
scalar document lint openapi.yaml --format summary
|
|
1317
|
+
scalar document lint openapi.yaml --format github-actions
|
|
1318
|
+
scalar document lint openapi.yaml --format json --output lint-results.json
|
|
1319
|
+
scalar document lint openapi.yaml --format junit --output lint-results.xml
|
|
1133
1320
|
```
|
|
1134
1321
|
|
|
1135
|
-
|
|
1322
|
+
The default is `codeframe`, which shows source excerpts with severity colors and highlighted carets when terminal colors are enabled. `NO_COLOR=1` disables colors, and reports saved with `--output` are always plain text. Use `--format text` for the native report. `markdown` produces tables grouped by source, and `summary` counts findings by rule and severity. Machine-readable reports use 1-based locations; text retains engine-native coordinates. Codeframes omit excerpts for unavailable sources.
|
|
1136
1323
|
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1324
|
+
`--max-problems <number>` limits displayed findings to 100 by default. Findings are ordered by severity, with errors first. Use `--max-problems 0` to hide all findings. Counts and the exit status always include every active finding, and baseline generation records all findings regardless of this limit. Summary rule counts cover the displayed findings; its final error/warning totals cover all findings. Truncation notices go to stderr, keeping JSON and XML valid.
|
|
1325
|
+
|
|
1326
|
+
Reports go to stdout unless `--output` is given. Status, upgrade, and truncation notices go to stderr. Reports are written even when lint findings cause a nonzero exit. Both shell redirection and `--output` work:
|
|
1327
|
+
|
|
1328
|
+
```sh
|
|
1329
|
+
scalar document lint openapi.yaml --format json > lint-results.json
|
|
1330
|
+
scalar document lint openapi.yaml --format json --output lint-results.json
|
|
1140
1331
|
```
|
|
1141
1332
|
|
|
1142
|
-
|
|
1333
|
+
Prefer `--output` in scripts when you want Scalar to check the destination against the input, custom ruleset, baseline, and referenced source files (including clean nested references and file aliases). Shell redirection is convenient for piping; the shell opens or truncates the destination before Scalar starts, so Scalar cannot protect that destination. Parent directories for `--output` must already exist.
|
|
1334
|
+
|
|
1335
|
+
JSON follows Redocly's report shape: `totals` contains error, warning, and ignored counts; `version` is the Scalar CLI version; `problems` is the displayed findings array. Each problem includes `ruleId`, `severity` (`error`, `warn`, `info`, or `hint`), `message`, `suggest`, optional rule `reference`, and a `location` array. Locations contain `source.ref`, a JSON `pointer`, and 1-based `start`/`end` positions with `line` and `col`. Local sources are relative to the current directory; URLs remain absolute. Rule IDs and findings still come from Scalar's Vacuum/Spectral engines. Duplicate-operation-ID findings include the participating definitions, including referenced path items and callbacks. Reports preserve additional locations when supplied by the engine; totals and JUnit still count one testcase per finding, and ignore matching uses the primary location, with legacy native paths retained as matching candidates. Scalar does not yet provide Redocly's typo suggestions.
|
|
1336
|
+
|
|
1337
|
+
GitHub Actions reports use error, warning, and notice annotations with start and end positions and available rule documentation links. Local files are relative to `GITHUB_WORKSPACE`, or the current directory outside Actions. Remote sources appear in the message without a repository file attachment. When saved with `--output`, annotations must subsequently be printed to the runner's stdout to become visible.
|
|
1338
|
+
|
|
1339
|
+
JUnit groups findings into suites by source, with one testcase per displayed finding. To match Redocly, lint errors become XML `error` entries, warnings become `failure` entries, and information/hints become `system-out`. Warnings still do not make the lint command exit nonzero, and JUnit viewers classify those testcases as failed. The CLI lint report compatibility workflow verifies this behavior using the Java JUnit viewer in `dorny/test-reporter`. The `Scalar lint totals` suite records full error, warning, ignored, and hidden counts as properties. A clean run produces a valid zero-test report. Configure CI to upload reports even when the lint step fails.
|
|
1340
|
+
|
|
1341
|
+
To adopt linting with existing findings:
|
|
1342
|
+
|
|
1343
|
+
```sh
|
|
1344
|
+
scalar document lint openapi.yaml --generate-ignore-file
|
|
1345
|
+
scalar document lint openapi.yaml --format github-actions
|
|
1346
|
+
```
|
|
1347
|
+
|
|
1348
|
+
Commit the generated `.scalar.lint-ignore.yaml`. Subsequent runs automatically read it from the current directory. `--ignore-file <file>` overrides that location for generation and linting, including an existing `.redocly.lint-ignore.yaml`. Relative paths resolve from the current directory; no parent-directory search is performed. If Scalar's file is absent, linting automatically falls back to `.redocly.lint-ignore.yaml`. You can also rename a Redocly ignore file to `.scalar.lint-ignore.yaml`; Scalar's file always wins when both exist. Generation defaults to Scalar's filename and leaves Redocly's file intact. Scalar does not read `redocly.yaml`.
|
|
1349
|
+
|
|
1350
|
+
For OpenAPI with the default ruleset, imported mappings support the audited Redocly rules `info-contact`, `info-license`, `operation-description`, `operation-operationId`, `operation-operationId-url-safe` (mapped to Scalar's `operation-operationId-valid-in-url`), `no-path-trailing-slash` (`path-keys-no-trailing-slash`), `path-declaration-must-exist` (`path-declarations-must-exist`), `path-not-include-query`, `tag-description`, and `operation-singular-tag`. Missing-field pointers are adapted where the engines report the containing object. This does not enable rules that Scalar's default engine disables. Unsupported rules produce a notice on stderr; only exact Scalar rule/pointer matches apply to those entries. Severity-only overrides of these audited built-in rules retain migration support. Custom definitions, unknown inheritance, and AsyncAPI use exact Scalar identities. Redocly’s `operation-2xx-response` is not mapped to Scalar’s `operation-success-response`, which also accepts 3xx responses. Full custom-rule compatibility would require running Redocly itself.
|
|
1351
|
+
|
|
1352
|
+
The YAML mapping uses Redocly's source → rule → JSON-pointer structure:
|
|
1353
|
+
|
|
1354
|
+
```yaml
|
|
1355
|
+
openapi.yaml:
|
|
1356
|
+
info-description:
|
|
1357
|
+
- '#/info'
|
|
1358
|
+
```
|
|
1143
1359
|
|
|
1144
|
-
|
|
1360
|
+
Local source paths are relative to the baseline directory. Matching ignores message, severity, and line changes. Mounted reference paths are resolved to physical source pointers, including nested references; older Scalar baselines using native mount paths continue to match. Path-key findings use the key location to distinguish specific path entries. Root pointers use `#`; `/` and `~` in property names use RFC 6901 escaping. Numeric and string path segments with the same pointer identify the same location.
|
|
1145
1361
|
|
|
1146
|
-
|
|
1362
|
+
Generation records all current findings and exits successfully after writing the baseline. Generation serializes baseline reads and writes to preserve concurrent updates. A leftover `.lock` directory after an interrupted process must be removed only when no generator is running. Regeneration replaces only the selected input document's entries and preserves other inputs, including shared references. Scalar stores input ownership in a YAML comment (`scalar-owners`) that Redocly ignores. Keep that comment to retain shared-reference ownership; without it, imported entries belong to their source file. Manual edits to the mapping take precedence over comment metadata. Legacy Scalar version 1 baselines remain readable and are migrated to this mapping on regeneration.
|
|
1147
1363
|
|
|
1148
|
-
|
|
1364
|
+
Matched findings are omitted from reports. Only unmatched errors cause exit 1; warnings, information, and hints do not fail lint. Operational failures, malformed baselines, and missing explicitly selected baselines exit nonzero. A missing default baseline is allowed. Multiple findings at the same source/rule/pointer share one entry. Resolved entries remain harmless until regeneration but can suppress a recurrence; array reordering, document renames, or rule changes may produce new identities.
|
|
1149
1365
|
|
|
1150
|
-
|
|
1366
|
+
### Schema metadata
|
|
1151
1367
|
|
|
1152
|
-
|
|
1368
|
+
Use `scalar schema list --json` to discover schemas in the current team namespace, or pass `--namespace <namespace>` to choose one. The output is an array of objects with `namespace`, `slug`, `title`, `version`, and `isPrivate`. `version` is the latest semantic version, or `null` when there are no versions. An empty namespace returns `[]`. Schema content is omitted; use `scalar schema get` to download it.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
BaseCollections
|
|
4
|
+
} from "./chunk-JXGF5EHC.js";
|
|
5
|
+
import {
|
|
6
|
+
getDatabaseClient
|
|
7
|
+
} from "./chunk-WDIWLXLV.js";
|
|
8
|
+
import "./chunk-43WALAW3.js";
|
|
9
|
+
import "./chunk-ZYBLQ5CT.js";
|
|
10
|
+
import "./chunk-IPZP3VRA.js";
|
|
11
|
+
import "./chunk-5ENKYZA4.js";
|
|
12
|
+
import "./chunk-36LXIJIZ.js";
|
|
13
|
+
import {
|
|
14
|
+
getAuthData
|
|
15
|
+
} from "./chunk-35Z7VTJT.js";
|
|
16
|
+
import "./chunk-WB6PWTMU.js";
|
|
17
|
+
import "./chunk-DHZW7Q7U.js";
|
|
18
|
+
import {
|
|
19
|
+
teamSchema
|
|
20
|
+
} from "./chunk-GYRQPDTK.js";
|
|
21
|
+
import "./chunk-6M7TL2G2.js";
|
|
22
|
+
import "./chunk-GLWTVLKM.js";
|
|
23
|
+
import "./chunk-4ORL4MST.js";
|
|
24
|
+
import "./chunk-MNNGUUKJ.js";
|
|
25
|
+
import {
|
|
26
|
+
output
|
|
27
|
+
} from "./chunk-T5HJUAWB.js";
|
|
28
|
+
import "./chunk-ZGVZU6L2.js";
|
|
29
|
+
import "./chunk-VVRUSQCY.js";
|
|
30
|
+
import "./chunk-3MZYUBJ6.js";
|
|
31
|
+
|
|
32
|
+
// src/domains/team/get/action.ts
|
|
33
|
+
async function getAction(args = {}) {
|
|
34
|
+
const auth = await getAuthData();
|
|
35
|
+
auth.addEventListener((state) => Object.assign(auth, state));
|
|
36
|
+
const client = await getDatabaseClient();
|
|
37
|
+
const team = await client.getOne({
|
|
38
|
+
collectionPath: BaseCollections.Teams,
|
|
39
|
+
query: { uid: auth.teamUid },
|
|
40
|
+
schema: teamSchema
|
|
41
|
+
});
|
|
42
|
+
if (team.error) {
|
|
43
|
+
return output.error().title("An error occurred when fetching your team.").message(team.message).exit("error");
|
|
44
|
+
}
|
|
45
|
+
const details = {
|
|
46
|
+
uid: team.data.uid,
|
|
47
|
+
name: team.data.name,
|
|
48
|
+
slug: team.data.slug,
|
|
49
|
+
namespaces: team.data.namespaces
|
|
50
|
+
};
|
|
51
|
+
if (args.json) {
|
|
52
|
+
process.stdout.write(`${JSON.stringify(details, null, 2)}
|
|
53
|
+
`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
output.info().title(details.name).line(`Team UID: ${details.uid}`).line(`Slug: ${details.slug}`).line(
|
|
57
|
+
`Namespaces: ${details.namespaces.length ? details.namespaces.join(", ") : "None"}`
|
|
58
|
+
).print();
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
getAction
|
|
62
|
+
};
|