@scalar/cli 2.10.0 → 2.12.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 -1289
- package/chunks/action-2OPUQFUY.js +164 -0
- package/chunks/{action-4GZI2M5B.js → action-36LZ6XXE.js} +19 -17
- package/chunks/{action-KDUFU7TZ.js → action-3XMTJJRT.js} +19 -16
- package/chunks/{action-R4PGILN4.js → action-6CLEENBI.js} +47 -36
- package/chunks/{action-ZFI77WA5.js → action-7HXYZPOT.js} +10 -10
- package/chunks/{action-X7BA7PQQ.js → action-AC5ENU6Z.js} +20 -18
- package/chunks/{action-PPTFYZWD.js → action-ADGLTNFC.js} +28 -22
- package/chunks/{action-7XOHYWYM.js → action-AOKHLTZ6.js} +25 -21
- package/chunks/{action-XOADBXSX.js → action-AVSJ3AJY.js} +17 -16
- package/chunks/{action-GFLRD7LO.js → action-D3IVCY24.js} +8 -8
- package/chunks/action-EBZJS367.js +130 -0
- package/chunks/{action-ZKA3RR3S.js → action-EZXHSAJ2.js} +18 -17
- package/chunks/{action-5LF4XYHX.js → action-FDTVHVHF.js} +12 -12
- package/chunks/{action-JEYDBB3P.js → action-FUO5F7NV.js} +15 -15
- package/chunks/{action-DKDRAIKV.js → action-HA3CMV3P.js} +13 -15
- package/chunks/{action-YSVTZVKV.js → action-IG3BK2LF.js} +37 -26
- package/chunks/{action-H3RTILLM.js → action-IIQMZVRJ.js} +1 -1
- package/chunks/{action-DTEO4YNX.js → action-JT6C472I.js} +13 -11
- package/chunks/{action-UUL6SWV4.js → action-KDT6H6ML.js} +12 -14
- package/chunks/{action-PAM2EZ22.js → action-KJDIJQ3A.js} +8 -7
- package/chunks/{action-HT42NUUX.js → action-NF5E7JKA.js} +40 -38
- package/chunks/{action-EAUTQ77U.js → action-NIZBME45.js} +26 -24
- package/chunks/{action-CB55NWAU.js → action-O757TFA2.js} +9 -9
- package/chunks/{action-XLE37MZL.js → action-ONR7QSN7.js} +23 -22
- package/chunks/{action-5RL4NWUZ.js → action-QM2BMMHG.js} +33 -30
- package/chunks/{action-GWYYTUTM.js → action-QVTAZCKY.js} +5 -5
- package/chunks/action-SLB52XRG.js +65 -0
- package/chunks/{action-CABLS46Q.js → action-UTFRCKGE.js} +11 -11
- package/chunks/{action-4W5GUGEG.js → action-VESBFIP3.js} +20 -19
- package/chunks/{action-657A4K2D.js → action-VGFAIFYE.js} +26 -23
- package/chunks/action-WCU5O2VT.js +100 -0
- package/chunks/{action-TOBU74JH.js → action-XS5EESHW.js} +51 -27
- package/chunks/action-XVNRZ5VX.js +38 -0
- package/chunks/action-Y7EBKCUU.js +16 -0
- package/chunks/{action-5N3P43MD.js → action-YWQ2OKS3.js} +16 -15
- package/chunks/{actions-3SAMH7A5.js → actions-6QG7LH7P.js} +23 -20
- package/chunks/{agent-2ESZI7NO.js → agent-ONXROEAE.js} +44 -9
- package/chunks/{asyncapi-4HGVM3PR.js → asyncapi-7IFXAIE3.js} +13 -12
- package/chunks/{build.action-VBGFGACM.js → build.action-FI4OWY3T.js} +28 -26
- package/chunks/{chunk-ZGNDXPLU.js → chunk-26VIHQGL.js} +3 -3
- package/chunks/{chunk-JXGF5EHC.js → chunk-3HCEUGOE.js} +42 -13
- package/chunks/{chunk-G4HRW2FZ.js → chunk-5TNKTLQP.js} +370 -254
- package/chunks/{chunk-XAGJJNQW.js → chunk-BB6WWG25.js} +10 -10
- package/chunks/{chunk-K2HIB5BA.js → chunk-BCFUMXMC.js} +3 -3
- package/chunks/{action-F2ZJNURT.js → chunk-EBNFCIKS.js} +7 -10
- package/chunks/{chunk-MC4EMNOR.js → chunk-EJSGWV2K.js} +7 -6
- package/chunks/{chunk-GYRQPDTK.js → chunk-FJCOYEKT.js} +139 -3
- package/chunks/{chunk-ZKJPLWRJ.js → chunk-HU47OMI4.js} +4 -4
- package/chunks/{chunk-VVRUSQCY.js → chunk-I57ID5K7.js} +13 -0
- package/chunks/{chunk-43WALAW3.js → chunk-JLNHOA5Z.js} +64 -115
- package/chunks/{chunk-5SMP756H.js → chunk-LCSU43NJ.js} +2 -2
- package/chunks/{chunk-KHF2QXBG.js → chunk-N645RGAB.js} +1853 -683
- package/chunks/{chunk-3ZJYGGAA.js → chunk-ORCUZITN.js} +1 -1
- package/chunks/{chunk-H467HDVV.js → chunk-PERC34BV.js} +1 -1
- package/chunks/chunk-Q26DFKTY.js +37 -0
- package/chunks/{chunk-MMWSCTDB.js → chunk-QJQTSRU4.js} +19 -19
- package/chunks/{chunk-WDIWLXLV.js → chunk-RLBS4HJT.js} +3 -3
- package/chunks/{chunk-ATNTXKMS.js → chunk-RNZVZMYC.js} +198 -42
- package/chunks/{chunk-IPZP3VRA.js → chunk-RYWXF3LO.js} +12 -21
- package/chunks/{chunk-CWVYOXXM.js → chunk-SNOAL2C5.js} +11 -7
- package/chunks/{chunk-UDBSV3CK.js → chunk-T3R66THO.js} +6085 -4167
- package/chunks/{chunk-VYFGRLVQ.js → chunk-U73OW57G.js} +1 -1
- package/chunks/chunk-U764PQUA.js +1034 -0
- package/chunks/{chunk-KZNRQVMY.js → chunk-UAFCSWQ6.js} +1 -1
- package/chunks/{chunk-WB6PWTMU.js → chunk-UBLFIMUA.js} +1 -1
- package/chunks/{chunk-WIEXQUTD.js → chunk-UODTHS76.js} +1 -1
- package/chunks/chunk-V3MYP5SQ.js +247 -0
- package/chunks/{chunk-36LXIJIZ.js → chunk-V6LUKXBV.js} +1 -16
- package/chunks/{chunk-6M7TL2G2.js → chunk-VRZSDUZK.js} +45 -5
- package/chunks/{chunk-GLWTVLKM.js → chunk-VUNOOPEG.js} +9 -2
- package/chunks/chunk-VUXPDHTQ.js +22 -0
- package/chunks/{chunk-DHZW7Q7U.js → chunk-VVQOFG76.js} +2 -4
- package/chunks/chunk-XP5UM7SF.js +21 -0
- package/chunks/{chunk-ZYBLQ5CT.js → chunk-Y6C3H27E.js} +9 -4
- package/chunks/{chunk-35Z7VTJT.js → chunk-YTFFBGNQ.js} +52 -38
- package/chunks/{chunk-BIMLCGKS.js → chunk-ZNLMQKDU.js} +1 -1
- package/chunks/{create.action-DBNIS665.js → create.action-PPMZEMZL.js} +34 -32
- package/chunks/{delete.action-GBOZC45K.js → delete.action-GDOHATRZ.js} +30 -28
- package/chunks/{delete.action-K7BLK7DK.js → delete.action-VAHKEHEU.js} +29 -27
- package/chunks/{get.action-QHKMYZBK.js → get.action-UXFTGO7W.js} +24 -20
- package/chunks/{get.action-N3JOY3OU.js → get.action-XON3EZDT.js} +16 -15
- package/chunks/{list.action-TJCS6UEY.js → list.action-24F5WDGR.js} +37 -26
- package/chunks/{list.action-6SSO3JVN.js → list.action-OQEAEJ5U.js} +39 -29
- package/chunks/{publish.action-T24VHRMR.js → publish.action-G7FPDRBZ.js} +45 -43
- package/chunks/{scripts-VIBLGKYG.js → scripts-6CI6U32J.js} +1 -1
- package/chunks/{update.action-VOE6PH5F.js → update.action-IFIFXZWA.js} +29 -27
- package/chunks/{update.action-OGYNBXRU.js → update.action-MJDHVVR3.js} +30 -28
- package/index.js +290 -284
- package/package.json +2 -2
- package/skills/scalar-cli/SKILL.md +49 -49
- package/template.md +68 -252
- package/chunks/action-FBRY5JKU.js +0 -37
- package/chunks/action-LYCNT3KA.js +0 -73
- package/chunks/action-OJ2NK25F.js +0 -121
- package/chunks/action-U2L5DCFG.js +0 -91
- package/chunks/chunk-MNNGUUKJ.js +0 -405
- package/chunks/chunk-ZGVZU6L2.js +0 -422
- package/docs.html +0 -6977
package/package.json
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.
|
|
8
|
+
"version": "2.12.0",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"scalar",
|
|
11
11
|
"openapi",
|
|
12
12
|
"swagger",
|
|
13
13
|
"cli"
|
|
14
14
|
],
|
|
15
|
-
"description": "
|
|
15
|
+
"description": "Validate, lint, bundle, mock, and preview OpenAPI and AsyncAPI descriptions, and publish them to Scalar",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"bin": {
|
|
18
18
|
"scalar": "./index.js"
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: scalar-cli
|
|
3
|
-
description: "Operate the Scalar CLI (`scalar`, or `npx @scalar/cli`) to validate, lint, format, bundle, split, upgrade, mock, and preview OpenAPI
|
|
3
|
+
description: "Operate the Scalar CLI (`scalar`, or `npx @scalar/cli`) to validate, lint, format, bundle, split, upgrade, mock, and preview OpenAPI and AsyncAPI descriptions, and to publish API Reference documentation, Scalar Docs projects, Scalar Registry entries, schemas, and SDKs to Scalar. Use when a task involves the Scalar CLI or working with API descriptions through Scalar."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Scalar CLI
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Validate, lint, bundle, mock, and preview OpenAPI and AsyncAPI descriptions, and publish them to Scalar (`@scalar/cli` 2.12.0).
|
|
9
9
|
|
|
10
10
|
## Operating notes
|
|
11
11
|
|
|
12
12
|
- Run `scalar <command>` when the CLI is installed, or `npx @scalar/cli <command>` when it is not.
|
|
13
13
|
- Run `scalar context` for this command tree as JSON, or `scalar <command> --help` for a single command.
|
|
14
|
-
-
|
|
14
|
+
- Log in with a personal token: `scalar auth login --token <token>`, or set `SCALAR_API_KEY` and run `scalar auth login`. Both store the session on disk for later commands. Without a token, `scalar auth login` opens a browser and waits for a person to log in, so do not run it that way. Check the session with `scalar auth whoami`.
|
|
15
15
|
- Many commands prompt when a value is left out, such as a slug, a team, or a confirmation before overwriting a file, and a prompt blocks a non-interactive run. Pass every value as an argument or flag: for example `--output` on `document bundle` and `document upgrade`, `--yes` on `project rollback`, and `--force` on `project init`.
|
|
16
16
|
- Results go to stdout. Errors go to stderr, prefixed with `[ERROR]`.
|
|
17
17
|
|
|
@@ -24,14 +24,14 @@ CLI to work with your OpenAPI files (`@scalar/cli` 2.10.0).
|
|
|
24
24
|
|
|
25
25
|
Run `scalar context` for the arguments, options, defaults, and choices of each command.
|
|
26
26
|
|
|
27
|
-
- `scalar readme [options] [command]`: Open documentation
|
|
28
|
-
- `scalar readme generate [options]`:
|
|
29
|
-
- `scalar upgrade [options]`: Upgrade
|
|
27
|
+
- `scalar readme [options] [command]`: Open CLI documentation in your browser
|
|
28
|
+
- `scalar readme generate [options]`: Generate the CLI README from the command tree
|
|
29
|
+
- `scalar upgrade [options]`: Upgrade the Scalar CLI to the latest version
|
|
30
30
|
- `scalar context [options]`: Print every command, argument, and option as JSON for AI agents
|
|
31
31
|
- `scalar completion [options] <shell>`: Generate shell completion definitions
|
|
32
|
-
- `scalar auth login [options]`:
|
|
33
|
-
- `scalar auth whoami [options]`:
|
|
34
|
-
- `scalar auth logout [options]`:
|
|
32
|
+
- `scalar auth login [options]`: Log in to Scalar
|
|
33
|
+
- `scalar auth whoami [options]`: Show the logged-in user and current team
|
|
34
|
+
- `scalar auth logout [options]`: Log out of Scalar
|
|
35
35
|
- `scalar access-group list [options]`: List access groups for the current team
|
|
36
36
|
- `scalar access-group create [options] <slug>`: Create an access group (Pro or above)
|
|
37
37
|
- `scalar access-group get [options] <slug>`: Get an access group and its allowlists
|
|
@@ -39,45 +39,45 @@ Run `scalar context` for the arguments, options, defaults, and choices of each c
|
|
|
39
39
|
- `scalar access-group delete [options] <slug>`: Delete an access group and remove its project assignments
|
|
40
40
|
- `scalar access-group domain add [options] <slug> <domain>`: Add an exact email domain to an access group
|
|
41
41
|
- `scalar access-group domain remove [options] <slug> <domain>`: Remove an exact email domain from an access group
|
|
42
|
-
- `scalar document bundle [options] [file|url]`: Bundle
|
|
43
|
-
- `scalar document split [options] [file|url]`: Split OpenAPI or AsyncAPI
|
|
44
|
-
- `scalar document join [options] <files...>`:
|
|
45
|
-
- `scalar document format [options] [file|url]`: Format an OpenAPI or AsyncAPI
|
|
46
|
-
- `scalar document convert [options] [file|url]`: Convert a Postman collection to an OpenAPI
|
|
47
|
-
- `scalar document markdown [options] [file|url]`: Generate Markdown from an OpenAPI
|
|
48
|
-
- `scalar document mock [options] [file|url]`: Mock
|
|
49
|
-
- `scalar document serve [options] [file|url]`: Serve
|
|
50
|
-
- `scalar document share [options] [file]`:
|
|
51
|
-
- `scalar document validate [options] [file|url]`: Validate an OpenAPI or AsyncAPI
|
|
52
|
-
- `scalar document void [options]`:
|
|
53
|
-
- `scalar document lint [options] [file|url]`: Lint
|
|
54
|
-
- `scalar document upgrade [options] [file|url]`: Upgrade an OpenAPI or
|
|
55
|
-
- `scalar project list [options]`: List projects and their slugs for the current team
|
|
56
|
-
- `scalar project get [options] <slug>`:
|
|
57
|
-
- `scalar project init [options]`:
|
|
58
|
-
- `scalar project check-config [options] [file]`:
|
|
59
|
-
- `scalar project create [options]`: Create a
|
|
60
|
-
- `scalar project preview [options] [config]`: Preview
|
|
61
|
-
- `scalar project publish [options]`: Publish new build
|
|
42
|
+
- `scalar document bundle [options] [file|url]`: Bundle external references into a single API description
|
|
43
|
+
- `scalar document split [options] [file|url]`: Split an OpenAPI or AsyncAPI description into referenced JSON files
|
|
44
|
+
- `scalar document join [options] <files...>`: Join API descriptions of the same format into one description
|
|
45
|
+
- `scalar document format [options] [file|url]`: Format an OpenAPI or AsyncAPI description
|
|
46
|
+
- `scalar document convert [options] [file|url]`: Convert a Postman collection to an OpenAPI description
|
|
47
|
+
- `scalar document markdown [options] [file|url]`: Generate Markdown documentation from an OpenAPI description
|
|
48
|
+
- `scalar document mock [options] [file|url]`: Run a Mock Server for OpenAPI operations or AsyncAPI WebSocket and SSE channels
|
|
49
|
+
- `scalar document serve [options] [file|url]`: Serve API Reference documentation from an OpenAPI or AsyncAPI description
|
|
50
|
+
- `scalar document share [options] [file]`: Publish an OpenAPI or AsyncAPI description to a public sandbox
|
|
51
|
+
- `scalar document validate [options] [file|url]`: Validate an OpenAPI or AsyncAPI description
|
|
52
|
+
- `scalar document void [options]`: Mirror HTTP requests with a local server
|
|
53
|
+
- `scalar document lint [options] [file|url]`: Lint an OpenAPI or AsyncAPI description with Spectral rules
|
|
54
|
+
- `scalar document upgrade [options] [file|url]`: Upgrade an API description to OpenAPI 3.1 or the latest supported AsyncAPI version
|
|
55
|
+
- `scalar project list [options]`: List projects and their slugs for the current team
|
|
56
|
+
- `scalar project get [options] <slug>`: Show project details for the current team
|
|
57
|
+
- `scalar project init [options]`: Initialize a local Scalar Docs project
|
|
58
|
+
- `scalar project check-config [options] [file]`: Validate a Scalar configuration file
|
|
59
|
+
- `scalar project create [options]`: Create a Scalar project without a linked GitHub repository
|
|
60
|
+
- `scalar project preview [options] [config]`: Preview a Scalar Docs project locally
|
|
61
|
+
- `scalar project publish [options]`: Publish a new build of a Scalar project
|
|
62
62
|
- `scalar project rollback [options]`: Roll the live deployment back to a previously deployed build.
|
|
63
|
-
- `scalar project deployments list [options]`: List
|
|
64
|
-
- `scalar project upgrade [options] [config]`: Upgrade
|
|
65
|
-
- `scalar registry publish [options] [file]`: Publish an OpenAPI
|
|
66
|
-
- `scalar registry update [options] [namespace] [slug]`: Update
|
|
67
|
-
- `scalar registry delete [options] [namespace] [slug]`: Delete
|
|
68
|
-
- `scalar registry list [options]`: List
|
|
69
|
-
- `scalar registry get [options] [namespace] [slug]`:
|
|
70
|
-
- `scalar team list [options]`: List
|
|
71
|
-
- `scalar team get [options]`:
|
|
72
|
-
- `scalar team set [options]`:
|
|
73
|
-
- `scalar sdk list [options]`: List
|
|
63
|
+
- `scalar project deployments list [options]`: List production deployments for a project
|
|
64
|
+
- `scalar project upgrade [options] [config]`: Upgrade a Scalar Docs configuration
|
|
65
|
+
- `scalar registry publish [options] [file]`: Publish an OpenAPI description to the Scalar Registry
|
|
66
|
+
- `scalar registry update [options] [namespace] [slug]`: Update API description metadata in the Scalar Registry
|
|
67
|
+
- `scalar registry delete [options] [namespace] [slug]`: Delete an API description from the Scalar Registry
|
|
68
|
+
- `scalar registry list [options]`: List Scalar Registry API descriptions in a team namespace
|
|
69
|
+
- `scalar registry get [options] [namespace] [slug]`: Download an API description version from the Scalar Registry
|
|
70
|
+
- `scalar team list [options]`: List your Scalar teams
|
|
71
|
+
- `scalar team get [options]`: Show the current team and its namespaces
|
|
72
|
+
- `scalar team set [options]`: Select the current team
|
|
73
|
+
- `scalar sdk list [options]`: List SDKs in a team namespace
|
|
74
74
|
- `scalar sdk get [options]`: Inspect SDK metadata, API source, versions, and build status
|
|
75
|
-
- `scalar sdk create [options]`: Create
|
|
76
|
-
- `scalar sdk update [options]`: Update SDK metadata
|
|
77
|
-
- `scalar sdk delete [options]`: Delete an SDK
|
|
78
|
-
- `scalar sdk build [options]`:
|
|
79
|
-
- `scalar schema delete [options]`: Delete a schema
|
|
80
|
-
- `scalar schema update [options]`: Update schema metadata
|
|
81
|
-
- `scalar schema list [options]`: List
|
|
82
|
-
- `scalar schema get [options] [namespace] [slug]`:
|
|
83
|
-
- `scalar schema publish [options] [file]`: Publish a shared schema to the Scalar
|
|
75
|
+
- `scalar sdk create [options]`: Create an SDK in the namespace of its source API
|
|
76
|
+
- `scalar sdk update [options]`: Update SDK metadata
|
|
77
|
+
- `scalar sdk delete [options]`: Delete an SDK
|
|
78
|
+
- `scalar sdk build [options]`: Start an SDK build
|
|
79
|
+
- `scalar schema delete [options]`: Delete a shared schema
|
|
80
|
+
- `scalar schema update [options]`: Update shared schema metadata
|
|
81
|
+
- `scalar schema list [options]`: List shared schemas in a team namespace
|
|
82
|
+
- `scalar schema get [options] [namespace] [slug]`: Download a shared schema version from the Scalar Registry
|
|
83
|
+
- `scalar schema publish [options] [file]`: Publish a shared schema to the Scalar Registry
|
package/template.md
CHANGED
|
@@ -2,333 +2,149 @@
|
|
|
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
|
-
## Projects
|
|
19
|
-
|
|
20
|
-
Discover project slugs and inspect project details without opening the Dashboard:
|
|
9
|
+

|
|
21
10
|
|
|
22
11
|
```bash
|
|
23
|
-
scalar
|
|
24
|
-
scalar project list
|
|
25
|
-
scalar project get my-docs
|
|
26
|
-
scalar project deployments list --slug my-docs
|
|
12
|
+
npx @scalar/cli document validate openapi.yaml
|
|
27
13
|
```
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
|
|
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.
|
|
32
|
-
|
|
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.
|
|
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)
|
|
34
16
|
|
|
35
|
-
##
|
|
17
|
+
## Common tasks
|
|
36
18
|
|
|
37
|
-
|
|
19
|
+
Every example works with `npx @scalar/cli` in place of `scalar` if you have not installed the CLI.
|
|
38
20
|
|
|
39
|
-
|
|
21
|
+
### Validate and lint an API description
|
|
40
22
|
|
|
41
23
|
```bash
|
|
42
|
-
|
|
24
|
+
scalar document validate openapi.yaml
|
|
25
|
+
scalar document lint openapi.yaml
|
|
26
|
+
scalar document lint openapi.yaml --rule .spectral.yaml
|
|
43
27
|
```
|
|
44
28
|
|
|
45
|
-
|
|
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)
|
|
46
30
|
|
|
47
|
-
###
|
|
48
|
-
|
|
49
|
-
Install the latest stable release without Node.js, npm, or administrator access.
|
|
50
|
-
|
|
51
|
-
macOS and Linux (Bash):
|
|
31
|
+
### Bundle split files into one
|
|
52
32
|
|
|
53
33
|
```bash
|
|
54
|
-
|
|
34
|
+
scalar document bundle openapi.yaml --output openapi.bundled.yaml
|
|
35
|
+
scalar document bundle openapi.yaml --output openapi.bundled.yaml --treeShake
|
|
36
|
+
scalar document bundle openapi.yaml --output - > openapi.bundled.yaml
|
|
55
37
|
```
|
|
56
38
|
|
|
57
|
-
|
|
39
|
+
Pulls every external `$ref` into a single file. `--treeShake` drops components nothing uses. The input can be a URL.
|
|
58
40
|
|
|
59
|
-
|
|
60
|
-
irm https://cdn.scalar.com/cli/install.ps1 | iex
|
|
61
|
-
```
|
|
41
|
+
Use `--output -` (or `-o -`) to write YAML to stdout for piping. Timings, diagnostics, and upgrade notices go to stderr. Without `--output`, local input requires an interactive overwrite confirmation; URL and non-interactive input require an explicit output destination.
|
|
62
42
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
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.
|
|
66
|
-
|
|
67
|
-
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.
|
|
68
|
-
|
|
69
|
-
### npm
|
|
70
|
-
|
|
71
|
-
If you already use Node.js, install the CLI with npm:
|
|
43
|
+
### Preview the API reference
|
|
72
44
|
|
|
73
45
|
```bash
|
|
74
|
-
|
|
46
|
+
scalar document serve openapi.yaml --watch
|
|
75
47
|
```
|
|
76
48
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
### Conflict: EXIST: file already exists
|
|
49
|
+
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).
|
|
80
50
|
|
|
81
|
-
|
|
51
|
+
### Mock the API
|
|
82
52
|
|
|
83
53
|
```bash
|
|
84
|
-
|
|
54
|
+
scalar document mock openapi.yaml --watch
|
|
85
55
|
```
|
|
86
56
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
# Execute without installation (npm)
|
|
91
|
-
npx @scalar/cli help
|
|
92
|
-
|
|
93
|
-
# Execute without installation (pnpm)
|
|
94
|
-
pnpm dlx @scalar/cli help
|
|
95
|
-
```
|
|
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.
|
|
57
|
+
Starts a mock server that answers with the examples and schemas in your document, so you can try requests before the API exists.
|
|
100
58
|
|
|
101
|
-
###
|
|
59
|
+
### Upgrade and convert
|
|
102
60
|
|
|
103
61
|
```bash
|
|
104
|
-
|
|
105
|
-
scalar
|
|
106
|
-
source ~/.local/share/scalar/completion.bash
|
|
62
|
+
scalar document upgrade swagger.json --output openapi.json
|
|
63
|
+
scalar document convert postman-collection.json --output openapi.json
|
|
107
64
|
```
|
|
108
65
|
|
|
109
|
-
|
|
66
|
+
Upgrades Swagger 2.0 and OpenAPI 3.0 to OpenAPI 3.1, and converts Postman collections to OpenAPI.
|
|
110
67
|
|
|
111
|
-
###
|
|
68
|
+
### Publish to Scalar
|
|
112
69
|
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
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
|
|
70
|
+
```bash
|
|
71
|
+
scalar auth login
|
|
72
|
+
scalar registry publish openapi.yaml --namespace acme --slug my-api --version 1.0.0
|
|
73
|
+
scalar project preview
|
|
74
|
+
scalar project publish --slug my-docs
|
|
134
75
|
```
|
|
135
76
|
|
|
136
|
-
|
|
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 `>>`.
|
|
77
|
+
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`.
|
|
141
78
|
|
|
142
|
-
|
|
79
|
+
## Install
|
|
143
80
|
|
|
144
|
-
|
|
81
|
+
Standalone binary, no Node.js required:
|
|
145
82
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
```sh
|
|
151
|
-
scalar document serve openapi.yaml --config ./reference.config.json
|
|
83
|
+
```bash
|
|
84
|
+
# macOS and Linux
|
|
85
|
+
curl -fsSL https://cdn.scalar.com/cli/install.sh | bash
|
|
152
86
|
```
|
|
153
87
|
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"theme": "purple"
|
|
158
|
-
}
|
|
88
|
+
```powershell
|
|
89
|
+
# Windows (PowerShell)
|
|
90
|
+
irm https://cdn.scalar.com/cli/install.ps1 | iex
|
|
159
91
|
```
|
|
160
92
|
|
|
161
|
-
|
|
162
|
-
is loaded at startup; restart the command after changing it. `--watch` continues
|
|
163
|
-
to watch the API document. Options requiring JavaScript functions are not supported
|
|
164
|
-
in a JSON file.
|
|
165
|
-
|
|
166
|
-
## Authentication in automation
|
|
167
|
-
|
|
168
|
-
Use `scalar auth login --token <personal-token>` to authenticate without a browser.
|
|
169
|
-
Alternatively, set `SCALAR_API_KEY`. When both are provided, `SCALAR_API_KEY` takes
|
|
170
|
-
precedence over `--token`. Unset it to use a different explicit token.
|
|
171
|
-
|
|
172
|
-
Supply required options in automation instead of relying on interactive prompts.
|
|
173
|
-
For example, pass `--output` for document transformations.
|
|
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:
|
|
93
|
+
Or with npm:
|
|
180
94
|
|
|
181
95
|
```bash
|
|
182
|
-
|
|
183
|
-
scalar team get --json
|
|
96
|
+
npm install --global @scalar/cli
|
|
184
97
|
```
|
|
185
98
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
## Commands
|
|
189
|
-
|
|
190
|
-
<COMMANDS>
|
|
99
|
+
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.
|
|
191
100
|
|
|
192
|
-
## AI agents
|
|
101
|
+
## Use with AI agents
|
|
193
102
|
|
|
194
|
-
`scalar context` prints
|
|
103
|
+
`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`:
|
|
195
104
|
|
|
196
105
|
```bash
|
|
197
106
|
scalar context
|
|
198
107
|
```
|
|
199
108
|
|
|
200
|
-
The
|
|
109
|
+
The package also ships an [Agent Skill](https://agentskills.io) at `skills/scalar-cli/SKILL.md`. Copy it into your project:
|
|
201
110
|
|
|
202
111
|
```bash
|
|
203
112
|
mkdir -p .claude/skills
|
|
204
|
-
|
|
205
|
-
# npm (global install)
|
|
206
113
|
cp -r "$(npm root -g)/@scalar/cli/skills/scalar-cli" .claude/skills/
|
|
207
|
-
|
|
208
|
-
# Standalone CLI on macOS or Linux (the installer links `scalar` into its release directory)
|
|
209
|
-
cp -r "$(dirname "$(readlink "$(command -v scalar)")")/app/skills/scalar-cli" .claude/skills/
|
|
210
114
|
```
|
|
211
115
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
## Inspect SDKs
|
|
215
|
-
|
|
216
|
-
Use your current team login to inspect an SDK by slug. The namespace defaults to the team's first namespace.
|
|
217
|
-
|
|
218
|
-
```bash
|
|
219
|
-
scalar sdk get --slug widgets --namespace acme
|
|
220
|
-
scalar sdk get --slug widgets --namespace acme --json
|
|
221
|
-
scalar sdk list --namespace acme --json
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
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.
|
|
225
|
-
|
|
226
|
-
## Registry metadata for scripts
|
|
227
|
-
|
|
228
|
-
Use `scalar registry list --json` to write a JSON array to stdout. Without
|
|
229
|
-
`--namespace`, the command uses the first namespace of your current team, just
|
|
230
|
-
like the default table output. You must be logged in; errors go to stderr and
|
|
231
|
-
exit with a nonzero status.
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
scalar registry list --namespace scalar --json > registry-apis.json
|
|
235
|
-
scalar registry get scalar demo-api --version 1.2.3 > openapi.json
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
Each array entry contains `namespace` and `slug` (the coordinates accepted by
|
|
239
|
-
`registry get`), `title` (a string, which may be empty), `version` (the current
|
|
240
|
-
version served by default), and `isPrivate` (a boolean). JSON output includes
|
|
241
|
-
only these metadata fields, without document content or credentials. An empty
|
|
242
|
-
namespace returns `[]`. Omit `--json` for the human-readable table.
|
|
243
|
-
|
|
244
|
-
## GitHub Actions
|
|
245
|
-
|
|
246
|
-
To validate your OpenAPI file in GitHub Actions, add this workflow:
|
|
116
|
+
## Use in CI
|
|
247
117
|
|
|
248
118
|
```yml
|
|
249
|
-
# .github/workflows/
|
|
250
|
-
name:
|
|
251
|
-
|
|
252
|
-
on:
|
|
253
|
-
push:
|
|
254
|
-
branches:
|
|
255
|
-
- main
|
|
256
|
-
pull_request:
|
|
257
|
-
branches:
|
|
258
|
-
- main
|
|
119
|
+
# .github/workflows/openapi.yml
|
|
120
|
+
name: OpenAPI
|
|
121
|
+
on: [push, pull_request]
|
|
259
122
|
|
|
260
123
|
jobs:
|
|
261
|
-
|
|
124
|
+
lint:
|
|
262
125
|
runs-on: ubuntu-latest
|
|
263
|
-
|
|
264
126
|
steps:
|
|
265
|
-
- uses: actions/checkout@
|
|
266
|
-
-
|
|
267
|
-
uses: actions/setup-node@v4
|
|
127
|
+
- uses: actions/checkout@v6
|
|
128
|
+
- uses: actions/setup-node@v6
|
|
268
129
|
with:
|
|
269
130
|
node-version: 24
|
|
270
|
-
-
|
|
271
|
-
# Replace `./my-openapi-file.yaml` with the correct path and filename for your project.
|
|
272
|
-
run: npx @scalar/cli document validate ./my-openapi-file.yaml
|
|
131
|
+
- run: npx --yes @scalar/cli document lint openapi.yaml --format github-actions
|
|
273
132
|
```
|
|
274
133
|
|
|
275
|
-
|
|
134
|
+
`--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)
|
|
276
135
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
```sh
|
|
280
|
-
scalar document lint openapi.yaml --format codeframe
|
|
281
|
-
scalar document lint openapi.yaml --format markdown --output lint-results.md
|
|
282
|
-
scalar document lint openapi.yaml --format summary
|
|
283
|
-
scalar document lint openapi.yaml --format github-actions
|
|
284
|
-
scalar document lint openapi.yaml --format json --output lint-results.json
|
|
285
|
-
scalar document lint openapi.yaml --format junit --output lint-results.xml
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
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.
|
|
289
|
-
|
|
290
|
-
`--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.
|
|
291
|
-
|
|
292
|
-
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:
|
|
293
|
-
|
|
294
|
-
```sh
|
|
295
|
-
scalar document lint openapi.yaml --format json > lint-results.json
|
|
296
|
-
scalar document lint openapi.yaml --format json --output lint-results.json
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
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.
|
|
300
|
-
|
|
301
|
-
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.
|
|
302
|
-
|
|
303
|
-
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.
|
|
304
|
-
|
|
305
|
-
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.
|
|
306
|
-
|
|
307
|
-
To adopt linting with existing findings:
|
|
308
|
-
|
|
309
|
-
```sh
|
|
310
|
-
scalar document lint openapi.yaml --generate-ignore-file
|
|
311
|
-
scalar document lint openapi.yaml --format github-actions
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
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`.
|
|
315
|
-
|
|
316
|
-
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.
|
|
317
|
-
|
|
318
|
-
The YAML mapping uses Redocly's source → rule → JSON-pointer structure:
|
|
319
|
-
|
|
320
|
-
```yaml
|
|
321
|
-
openapi.yaml:
|
|
322
|
-
info-description:
|
|
323
|
-
- '#/info'
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
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.
|
|
136
|
+
## Commands
|
|
327
137
|
|
|
328
|
-
|
|
138
|
+
<COMMANDS>
|
|
329
139
|
|
|
330
|
-
|
|
140
|
+
Run `scalar <command> --help` for options, or see the [command reference](https://scalar.com/tools/cli/commands).
|
|
331
141
|
|
|
332
|
-
###
|
|
142
|
+
### Authentication details
|
|
333
143
|
|
|
334
|
-
|
|
144
|
+
Run `scalar auth whoami` to show your email, current team name and ID, role, and
|
|
145
|
+
authentication method (browser session or personal token). Use
|
|
146
|
+
`scalar auth whoami --json` for structured output with `email`,
|
|
147
|
+
`team: { uid, name }`, `role`, and `authentication` (`browser_session` or
|
|
148
|
+
`personal_token`). If the team name cannot be loaded, the team ID remains
|
|
149
|
+
available and JSON returns `null` for the name. Missing email or role values
|
|
150
|
+
also return `null`. Credentials are never included.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
apiService
|
|
4
|
-
} from "./chunk-ATNTXKMS.js";
|
|
5
|
-
import "./chunk-43WALAW3.js";
|
|
6
|
-
import "./chunk-ZYBLQ5CT.js";
|
|
7
|
-
import "./chunk-KHF2QXBG.js";
|
|
8
|
-
import "./chunk-IPZP3VRA.js";
|
|
9
|
-
import "./chunk-5ENKYZA4.js";
|
|
10
|
-
import "./chunk-G4HRW2FZ.js";
|
|
11
|
-
import "./chunk-35Z7VTJT.js";
|
|
12
|
-
import "./chunk-WB6PWTMU.js";
|
|
13
|
-
import "./chunk-DHZW7Q7U.js";
|
|
14
|
-
import "./chunk-GYRQPDTK.js";
|
|
15
|
-
import "./chunk-6M7TL2G2.js";
|
|
16
|
-
import "./chunk-GLWTVLKM.js";
|
|
17
|
-
import "./chunk-MNNGUUKJ.js";
|
|
18
|
-
import {
|
|
19
|
-
output
|
|
20
|
-
} from "./chunk-T5HJUAWB.js";
|
|
21
|
-
import "./chunk-ZGVZU6L2.js";
|
|
22
|
-
import "./chunk-VVRUSQCY.js";
|
|
23
|
-
import "./chunk-3MZYUBJ6.js";
|
|
24
|
-
|
|
25
|
-
// src/domains/registry/delete/action.ts
|
|
26
|
-
async function deleteAction(namespace, slug) {
|
|
27
|
-
const client = await apiService();
|
|
28
|
-
const logger = output.info().line().loader("Deleting the api document");
|
|
29
|
-
const deleteDocument = await client.managedDocs.delete(namespace, slug);
|
|
30
|
-
if (deleteDocument.error) {
|
|
31
|
-
return output.error().title(deleteDocument.message).exit("error");
|
|
32
|
-
}
|
|
33
|
-
logger.update("loader", 0, { content: "Successfully deleted document." }).print();
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
deleteAction
|
|
37
|
-
};
|