@scalar/cli 2.13.2 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +75 -9
  2. package/chunks/{action-MHBMWRU4.js → action-2BGAMGXU.js} +7 -6
  3. package/chunks/{action-KCJTUKNF.js → action-2HPMP473.js} +4 -4
  4. package/chunks/{action-6WWWTCCB.js → action-2UZWKMSJ.js} +14 -14
  5. package/chunks/{action-O4WDOJVV.js → action-3KP3WVPZ.js} +8 -7
  6. package/chunks/{action-D7D3YH2N.js → action-3QQSKGM3.js} +16 -15
  7. package/chunks/{action-RDG3SJ2G.js → action-3W4IC7QL.js} +17 -16
  8. package/chunks/{action-E7EK6TJJ.js → action-4HXB3YQR.js} +12 -11
  9. package/chunks/{action-4U36CMZG.js → action-57SV3ZBM.js} +7 -6
  10. package/chunks/{action-BIEKRF2X.js → action-6HFH7DAW.js} +7 -6
  11. package/chunks/{action-3OYAJ5F6.js → action-777R7LOG.js} +20 -18
  12. package/chunks/{action-YH3KB4NR.js → action-7LK4RUDP.js} +39 -36
  13. package/chunks/{action-ZSUVSURQ.js → action-APBLB3IU.js} +7 -6
  14. package/chunks/{action-JOKVK5PP.js → action-B2WWTOF6.js} +8 -8
  15. package/chunks/{action-VK6HFIZ5.js → action-ENDUKGWS.js} +16 -15
  16. package/chunks/{action-3QTDQRAO.js → action-G2WBTXOK.js} +18 -16
  17. package/chunks/{action-HGPGL624.js → action-HDT7EO7W.js} +18 -17
  18. package/chunks/{action-2LFAO27S.js → action-HOCCP353.js} +11 -10
  19. package/chunks/{action-BVORONSB.js → action-IU2AVNOW.js} +23 -21
  20. package/chunks/{action-Q7OD2QHZ.js → action-IUAYC2SC.js} +8 -7
  21. package/chunks/{action-ZYQEUYF7.js → action-JNH4DCZX.js} +4 -4
  22. package/chunks/{action-6LNC6MMJ.js → action-LD5B5QQ4.js} +26 -24
  23. package/chunks/{action-YXAOA3TJ.js → action-MBAAYXKK.js} +17 -16
  24. package/chunks/{action-WMOLIVXC.js → action-MJHLG7AE.js} +24 -22
  25. package/chunks/{action-AQCSAFDU.js → action-NZJ4Z64U.js} +16 -15
  26. package/chunks/{action-WJMC3TDN.js → action-P2RPH5R2.js} +7 -7
  27. package/chunks/{action-XZDNARAW.js → action-PDSSIW2A.js} +21 -20
  28. package/chunks/{action-MHJOOGII.js → action-PNSWHIHC.js} +10 -10
  29. package/chunks/{action-4DEIYLOW.js → action-QJMRAFOF.js} +16 -15
  30. package/chunks/{action-S7NCRXKS.js → action-T7SD3ETN.js} +19 -18
  31. package/chunks/{action-IN7SNSSI.js → action-TR2T2UYB.js} +7 -6
  32. package/chunks/{action-V2B42324.js → action-TY4BZEMN.js} +14 -14
  33. package/chunks/{action-NY2R6VH2.js → action-U2RJ3ZAU.js} +4 -4
  34. package/chunks/{action-FIKVZPFG.js → action-WOLNPEUQ.js} +10 -8
  35. package/chunks/{action-LKMBK3MO.js → action-ZTLOQZTT.js} +12 -11
  36. package/chunks/actions-D5OHPBWC.js +327 -0
  37. package/chunks/{actions-K2RSZCU4.js → actions-RI42JY6H.js} +37 -15
  38. package/chunks/{agent-YNVT6RJ6.js → agent-NA3QFKJX.js} +5 -5
  39. package/chunks/{asyncapi-XLHXPF2X.js → asyncapi-YBTWMTW6.js} +23 -18
  40. package/chunks/{build.action-TAMUO3F2.js → build.action-4YDNDBXC.js} +18 -17
  41. package/chunks/{chunk-ORHGCCJR.js → chunk-2KSOARE4.js} +2 -2
  42. package/chunks/{chunk-KAKAN5X3.js → chunk-42MIV6WF.js} +2 -2
  43. package/chunks/{chunk-5ENKYZA4.js → chunk-4S3DGMMZ.js} +1 -1
  44. package/chunks/chunk-5D3T63G4.js +14 -0
  45. package/chunks/{chunk-DRXJRWZA.js → chunk-6BQHLHBE.js} +4 -2
  46. package/chunks/chunk-7FGJIUDN.js +27 -0
  47. package/chunks/{chunk-NEB25B57.js → chunk-7FS7BAUX.js} +3 -3
  48. package/chunks/{chunk-JA7EIRUB.js → chunk-7PNOYE6B.js} +1 -1
  49. package/chunks/{chunk-KVK4LNTB.js → chunk-ANP5XF26.js} +8108 -3716
  50. package/chunks/{chunk-MQNTUZ2B.js → chunk-BLY2CF4S.js} +3 -1
  51. package/chunks/{chunk-I2JLVALT.js → chunk-BMQFEKHA.js} +120 -15
  52. package/chunks/{chunk-4T5XUXTP.js → chunk-BOCMOHQA.js} +3 -1
  53. package/chunks/chunk-BY4NGQ5D.js +15 -0
  54. package/chunks/{chunk-RQOKASNF.js → chunk-DLYMDGFW.js} +2 -2
  55. package/chunks/{chunk-VMRXSVEE.js → chunk-DWJMPHLY.js} +3 -1
  56. package/chunks/{chunk-2XWUFFEZ.js → chunk-E24BNP6E.js} +1 -1
  57. package/chunks/{chunk-NDCXYF5Q.js → chunk-EOTD7HAV.js} +1 -1
  58. package/chunks/{chunk-TWTUSPPI.js → chunk-ERZ3HYB5.js} +2 -96
  59. package/chunks/{chunk-66POUWQA.js → chunk-G5WWW7VD.js} +3 -3
  60. package/chunks/{chunk-AP2O742I.js → chunk-GOKHFNB2.js} +2 -2
  61. package/chunks/{chunk-RAJM56L7.js → chunk-HIDIW2FN.js} +1 -1
  62. package/chunks/{chunk-LK2ZIDHH.js → chunk-IDGT5RAQ.js} +1 -1
  63. package/chunks/chunk-IPUJEBMI.js +9 -0
  64. package/chunks/{chunk-XG6WXQFN.js → chunk-IPWJEGPD.js} +2 -2
  65. package/chunks/{chunk-UPYLTC2Z.js → chunk-KOLEQNLG.js} +1 -1
  66. package/chunks/{chunk-QHR5X4FO.js → chunk-MGGMCT77.js} +1 -1
  67. package/chunks/{chunk-ZO7KDO3C.js → chunk-PIDLENYN.js} +7192 -6436
  68. package/chunks/{chunk-3CZG44E4.js → chunk-QMERQSPM.js} +2 -2
  69. package/chunks/{chunk-JQJSNCGD.js → chunk-QXOUDBFK.js} +4 -4
  70. package/chunks/{chunk-KYJLZCM3.js → chunk-RRYUCZYO.js} +2 -2
  71. package/chunks/{chunk-7UKLAB2Q.js → chunk-SHRUJFQI.js} +30 -8
  72. package/chunks/{chunk-Z2NUKRKG.js → chunk-T76K7QNX.js} +3 -3
  73. package/chunks/{chunk-OBJCYCIV.js → chunk-TR5U7G7T.js} +2 -1
  74. package/chunks/{chunk-UXCQFVXG.js → chunk-TW2UASEW.js} +2 -2
  75. package/chunks/{chunk-PFUJVZFI.js → chunk-UM3WZUGF.js} +4 -12
  76. package/chunks/{chunk-G7DFH6WK.js → chunk-USVU6AC2.js} +21 -5
  77. package/chunks/chunk-VBHPHAGS.js +114 -0
  78. package/chunks/{chunk-3MKTCEUX.js → chunk-W7P6VTCG.js} +25 -2
  79. package/chunks/{chunk-DDTGQKVB.js → chunk-Y6GKZ2FM.js} +1 -1
  80. package/chunks/{chunk-PFP35UAF.js → chunk-Z6HOHGUJ.js} +18 -1
  81. package/chunks/{create.action-UX5TVHST.js → create.action-52K3XAYN.js} +18 -17
  82. package/chunks/{delete.action-UMVF2N4A.js → delete.action-3NMOQPIR.js} +18 -17
  83. package/chunks/{delete.action-C3ZGIXJX.js → delete.action-47LPLTOX.js} +18 -17
  84. package/chunks/diff.action-5TLC2EHT.js +325 -0
  85. package/chunks/{get.action-KFLT4UUT.js → get.action-BCMLG7C7.js} +22 -27
  86. package/chunks/{get.action-KIEUFN4D.js → get.action-TOZ474GO.js} +17 -16
  87. package/chunks/{list.action-QK5DK5X3.js → list.action-6ZWEENT6.js} +21 -20
  88. package/chunks/{list.action-F3M4XJFC.js → list.action-CMAA5KTY.js} +17 -16
  89. package/chunks/{publish.action-GZ2TSAPE.js → publish.action-U3VIU5LZ.js} +39 -36
  90. package/chunks/{update.action-OTRO76PF.js → update.action-QZOP25ME.js} +18 -17
  91. package/chunks/{update.action-DNINDNBT.js → update.action-UQHZYVTP.js} +19 -18
  92. package/index.js +339 -219
  93. package/package.json +13 -12
  94. package/skills/scalar-cli/SKILL.md +9 -1
  95. package/template.md +72 -7
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "engines": {
6
6
  "node": ">=24"
7
7
  },
8
- "version": "2.13.2",
8
+ "version": "2.15.0",
9
9
  "keywords": [
10
10
  "scalar",
11
11
  "openapi",
@@ -22,16 +22,16 @@
22
22
  "@clack/prompts": "0.7.0",
23
23
  "@hono/node-server": "2.1.1",
24
24
  "@quobix/vacuum": "0.30.1",
25
- "@scalar/asyncapi-upgrader": "0.1.15",
26
- "@scalar/asyncapi-validator": "0.1.10",
27
- "@scalar/json-magic": "0.15.5",
28
- "@scalar/mock-server": "0.17.4",
29
- "@scalar/openapi-to-markdown": "1.5.2",
30
- "@scalar/openapi-upgrader": "0.4.2",
31
- "@scalar/openapi-validator": "0.1.10",
32
- "@scalar/postman-to-openapi": "0.7.25",
33
- "@scalar/void-server": "2.5.15",
34
- "@scalar/workspace-store": "0.68.1",
25
+ "@scalar/asyncapi-upgrader": "0.1.18",
26
+ "@scalar/asyncapi-validator": "0.1.17",
27
+ "@scalar/json-magic": "0.17.0",
28
+ "@scalar/mock-server": "0.20.3",
29
+ "@scalar/openapi-to-markdown": "1.7.3",
30
+ "@scalar/openapi-upgrader": "0.4.6",
31
+ "@scalar/openapi-validator": "0.1.17",
32
+ "@scalar/postman-to-openapi": "0.7.28",
33
+ "@scalar/void-server": "2.5.19",
34
+ "@scalar/workspace-store": "0.69.3",
35
35
  "@stoplight/spectral-core": "1.22.0",
36
36
  "@stoplight/spectral-parsers": "1.0.5",
37
37
  "@stoplight/spectral-ruleset-bundler": "1.7.0",
@@ -41,7 +41,7 @@
41
41
  "commander": "13.1.0",
42
42
  "console-table-printer": "2.16.1",
43
43
  "get-port": "7.2.0",
44
- "hono": "^4.12.25",
44
+ "hono": "^4.13.13",
45
45
  "ignore": "7.0.5",
46
46
  "jsonc-parser": "3.2.1",
47
47
  "nanoid": "6.0.1",
@@ -51,6 +51,7 @@
51
51
  "stdout-update": "4.0.1",
52
52
  "tar-fs": "3.1.2",
53
53
  "undici": "8.10.2",
54
+ "ws": "^8.21.0",
54
55
  "yaml": "2.8.3"
55
56
  }
56
57
  }
@@ -5,7 +5,7 @@ description: "Operate the Scalar CLI (`scalar`, or `npx @scalar/cli`) to validat
5
5
 
6
6
  # Scalar CLI
7
7
 
8
- Validate, lint, bundle, mock, and preview OpenAPI and AsyncAPI descriptions, and publish them to Scalar (`@scalar/cli` 2.13.2).
8
+ Validate, lint, bundle, mock, and preview OpenAPI and AsyncAPI descriptions, and publish them to Scalar (`@scalar/cli` 2.15.0).
9
9
 
10
10
  ## Operating notes
11
11
 
@@ -40,6 +40,8 @@ Run `scalar context` for the arguments, options, defaults, and choices of each c
40
40
  - `scalar access-group delete [options] <slug>`: Delete an access group and remove its project assignments
41
41
  - `scalar access-group domain add [options] <slug> <domain>`: Add an exact email domain to an access group
42
42
  - `scalar access-group domain remove [options] <slug> <domain>`: Remove an exact email domain from an access group
43
+ - `scalar access-group email add [options] <slug> <email>`: Add an email address to an access group
44
+ - `scalar access-group email remove [options] <slug> <email>`: Remove an email address from an access group
43
45
  - `scalar document bundle [options] [file|url]`: Bundle external references into a single API description
44
46
  - `scalar document split [options] [file|url]`: Split an OpenAPI or AsyncAPI description into referenced JSON files
45
47
  - `scalar document join [options] <files...>`: Join API descriptions of the same format into one description
@@ -64,6 +66,11 @@ Run `scalar context` for the arguments, options, defaults, and choices of each c
64
66
  - `scalar project deployments list [options]`: List production deployments for a project
65
67
  - `scalar project deployments get [options] <build-id>`: Inspect an existing build in the selected team without resubmitting
66
68
  - `scalar project upgrade [options] [config]`: Upgrade a Scalar Docs configuration
69
+ - `scalar mcp list [options]`: List MCP servers in the current team
70
+ - `scalar mcp get [options] <server-id>`: Get an MCP server and its environment versions
71
+ - `scalar mcp create [options]`: Create an MCP server from an existing Registry API or Docs project
72
+ - `scalar mcp update [options] <server-id>`: Change an MCP server name or slug
73
+ - `scalar mcp delete [options] <server-id>`: Delete an MCP server and stop its endpoints
67
74
  - `scalar registry publish [options] [file]`: Publish an OpenAPI description to the Scalar Registry
68
75
  - `scalar registry update [options] [namespace] [slug]`: Update API description metadata in the Scalar Registry
69
76
  - `scalar registry delete [options] [namespace] [slug]`: Delete an API description from the Scalar Registry
@@ -83,3 +90,4 @@ Run `scalar context` for the arguments, options, defaults, and choices of each c
83
90
  - `scalar schema list [options]`: List shared schemas in a team namespace
84
91
  - `scalar schema get [options] [namespace] [slug]`: Download a shared schema version from the Scalar Registry
85
92
  - `scalar schema publish [options] [file]`: Publish a shared schema to the Scalar Registry
93
+ - `scalar schema diff [options] <from> <to>`: Compare two schema versions, files, or URLs
package/template.md CHANGED
@@ -88,6 +88,39 @@ scalar project publish --slug my-docs
88
88
 
89
89
  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`.
90
90
 
91
+ ### Compare schemas
92
+
93
+ ```bash
94
+ scalar schema diff acme/widget@1.0.0 acme/widget@2.0.0
95
+ scalar schema diff acme/widget@1.0.0 acme/widget@2.0.0 --verbose
96
+ scalar schema diff acme/widget@1.0.0 acme/widget@latest --json
97
+
98
+ # CI: fail the job if the local schema drifted from what is published
99
+ scalar schema diff acme/widget@latest ./widget.json --check --verbose
100
+ scalar schema diff acme/widget@latest ./widget.json --check --quiet --ignore /description /examples
101
+ ```
102
+
103
+ Each side is a published schema (`namespace/slug@version`, where the version defaults to `latest`), a file, or a URL. Both sides are parsed and compared structurally, so formatting, key order, and JSON versus YAML never count as changes. The order of items in an array, including `required`, `enum`, and `type`, does count. Changes are listed by JSON Pointer into the documents as written. An existing path always counts as a file: prefix `./` to force a file, or add `@latest` to force the Scalar Registry. `--ignore <pointer...>` skips changes at or under a JSON Pointer, so `/properties/legacy` also skips `/properties/legacy/type` but not `/properties/legacyId`. A change above the pointer, such as all of `/properties` being added, is still reported in full. Put it after the two schemas.
104
+
105
+ ### Manage Scalar-hosted MCP servers
106
+
107
+ ```sh
108
+ scalar mcp list --json --no-input
109
+ scalar mcp create --name Petstore --api acme/petstore@1.0.0 --json --no-input
110
+ scalar mcp create --name Docs --project <project-uid> --json --no-input
111
+ scalar mcp get <server-id> --json --no-input
112
+ scalar mcp update <server-id> --name 'Public API' --no-input
113
+ scalar mcp delete <server-id> --yes --no-input
114
+ ```
115
+
116
+ Use server UUIDs from `mcp list` for `get`, `update`, and `delete`. Creation accepts exactly one existing Scalar Registry API (`namespace/slug[@version]`) or Scalar Docs project UID (`project list --json`). An API reference without a version selects its current version; the selected version is pinned. Docs projects track their active publish. Source content must already be available to the MCP service. API tool exposure follows the API description and the server uses the same default additional headers as servers created in Scalar Dashboard.
117
+
118
+ Creation reports a created server, without waiting for endpoint readiness. `mcp get` reports each environment's served version, or `null` when none is served; a version is not a health check. After an interrupted create, inspect `mcp list` before repeating the command. Changing a slug changes its address. Deletion stops the server's endpoints; `--yes` explicitly confirms deletion and is required in JSON or noninteractive mode.
119
+
120
+ JSON server metadata contains `id` (server UUID), `uid` (Core record UID), `name`, `namespace`, `slug`, and `url`. `list` returns an array of that metadata; `update` returns one object. `create` adds `status: "created"`. `get` adds an `environments` array with `name`, `version`, `isPrivate`, and `url`. `delete` returns `{ "id": "…", "uid": "…", "deleted": true }`. Tool configuration and credentials are excluded. Errors use stderr and a nonzero exit code.
121
+
122
+ Addresses use `https://mcp.scalar.com` by default. Set `MCP_URL` to the MCP host for a nonproduction deployment, alongside the CLI's `BASE_URL` service setting. These commands manage hosted servers; they do not start a local MCP runtime.
123
+
91
124
  ## Install
92
125
 
93
126
  Standalone binary, no Node.js required:
@@ -167,6 +200,25 @@ jobs:
167
200
 
168
201
  `--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)
169
202
 
203
+ To fail a job when a schema in the repository drifts from the published version, run `schema diff` with `--check`. `--verbose` prints every changed value to the job log, and a distinct exit code such as `--check 2` lets the job tell schema drift apart from an authentication or network error, which exit 1:
204
+
205
+ ```yml
206
+ steps:
207
+ - uses: actions/checkout@v6
208
+ - run: npx --yes @scalar/cli auth login
209
+ env:
210
+ SCALAR_API_KEY: ${{ secrets.SCALAR_API_KEY }}
211
+ - run: npx --yes @scalar/cli schema diff acme/widget@latest ./widget.json --check 2 --verbose
212
+ ```
213
+
214
+ | `schema diff` invocation | Identical | Differ | Error (authentication, download, parse, bad input) |
215
+ | ------------------------ | --------- | ------ | -------------------------------------------------- |
216
+ | no `--check` | exit 0 | exit 0 | exit 1 |
217
+ | `--check` | exit 0 | exit 1 | exit 1 |
218
+ | `--check <n>` (1–125) | exit 0 | exit n | exit 1 |
219
+
220
+ Put `--check` after the two schemas, or write `--check=<n>`: an optional value takes the next argument, so `--check acme/widget@1.0.0 …` is rejected. Errors always print to stderr, even with `--quiet`. To tell a difference from an error without a distinct code, read `identical` from `--json`.
221
+
170
222
  ## Commands
171
223
 
172
224
  <COMMANDS>
@@ -212,13 +264,14 @@ even in a terminal.
212
264
 
213
265
  #### List contracts
214
266
 
215
- | Command | JSON value |
216
- | ------------------------------ | -------------------------------------------------------------------------------------------------------- |
217
- | `team list --json` | Array of `{uid: string, name: string, current: boolean}` |
218
- | `registry list --json` | Array of `{namespace: string, slug: string, title: string, version: string, isPrivate: boolean}` |
219
- | `schema list --json` | Array of `{namespace: string, slug: string, title: string, version: string \| null, isPrivate: boolean}` |
220
- | `sdk list --json` | Array of SDK metadata objects described below |
221
- | `sdk get --slug <slug> --json` | One SDK metadata object |
267
+ | Command | JSON value |
268
+ | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
269
+ | `team list --json` | Array of `{uid: string, name: string, current: boolean}` |
270
+ | `registry list --json` | Array of `{namespace: string, slug: string, title: string, version: string, isPrivate: boolean}` |
271
+ | `schema list --json` | Array of `{namespace: string, slug: string, title: string, version: string \| null, isPrivate: boolean}` |
272
+ | `sdk list --json` | Array of SDK metadata objects described below |
273
+ | `sdk get --slug <slug> --json` | One SDK metadata object |
274
+ | `schema diff <from> <to> --json` | `{from: string, to: string, identical: boolean, changes: Array<{type: "added" \| "removed" \| "changed", path: string, before?: unknown, after?: unknown}>}` |
222
275
 
223
276
  Schema `version` is the greatest version by semantic-version comparison, or
224
277
  `null` when no version exists. Registry `version` is the current version.
@@ -373,3 +426,15 @@ are not mutation-result streams and do not gain `--json` from this feature.
373
426
  URL input for `document format`, `upgrade`, `markdown`, `mock`, `serve`, `postman`, and `share`, plus Registry and schema publish input, has a 10-second download deadline. `registry get` and `schema get` use the same deadline. It includes reading the response body, but is not a total command runtime limit. Downloads are not automatically retried.
374
427
 
375
428
  File and download failures report the input, a known cause when available, and a recovery step on stderr, with exit code 1. Diagnostic URLs omit credentials, query strings, and fragments. Remote error bodies are not echoed because they may contain credentials; HTTP status remains available. Successful document output is unchanged.
429
+
430
+ ### Access-group emails
431
+
432
+ ```sh
433
+ scalar access-group email add partners alex@example.com
434
+ scalar access-group email remove partners alex@example.com --json
435
+ scalar access-group get partners --json
436
+ ```
437
+
438
+ These commands manage individual addresses in the current team's access group by slug. Addresses are lowercased; repeated adds and removals are safe to retry. Both mutations support `--json`, print `null` on success in JSON mode, and require no confirmation prompt. Invalid addresses and API failures exit nonzero. If a request times out, inspect the group with `get --json` to check whether the change completed.
439
+
440
+ No invitation is sent and no team membership is created. Removing an email preserves independent grants from domains, other groups, and team membership.