swaggerbot 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +77 -2
- package/dist/swaggerbot.mjs +1824 -0
- package/package.json +30 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 evolv3ai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,78 @@
|
|
|
1
|
-
#
|
|
1
|
+
# swaggerbot
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[swagger.bot](https://swaggerbot.dev) turns the name of an API into a verified OpenAPI/Swagger Spec with its Provenance: where the Spec came from and when it was last checked. When it can't, it says honestly why: the name is Ambiguous, the API has No Spec, or it is Unknown.
|
|
4
|
+
|
|
5
|
+
This is its command line: the name of an API in, the Spec or the reason out.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Node 20 or later.
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install -g swaggerbot
|
|
13
|
+
# or run it without installing
|
|
14
|
+
npx swaggerbot lookup "Val Town"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## `login`
|
|
18
|
+
|
|
19
|
+
A name the Index already answers needs no key. Finding a new one on the live web (Discovery), `--fresh` and `key` do: get one at <https://swaggerbot.dev/keys>, then store it:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
swaggerbot login # asks for the key, hidden; or: echo "$KEY" | swaggerbot login
|
|
23
|
+
swaggerbot key # the key in use and its credits left today
|
|
24
|
+
swaggerbot logout # forget the stored key
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`login` checks the key with the service (at no cost to its credits) and stores it only when it is live. A command sends `--key <key>`, else `SWAGGERBOT_API_KEY`, else the stored key.
|
|
28
|
+
|
|
29
|
+
## Commands
|
|
30
|
+
|
|
31
|
+
| Command | What it does | Example |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `lookup <name>` | Resolves a name to one API and its Current Spec, and prints the Outcome, the Spec's URL and its Provenance. `--api-version V`, `--community`, `--fresh`. | `swaggerbot lookup "Val Town"` |
|
|
34
|
+
| `spec <name \| apiId \| specId>` | Downloads a Spec, as its Source published it or (`--form normalized`) as OpenAPI 3.1 JSON; to `-o FILE`, a pipe, or a file in the current directory. | `swaggerbot spec stripe.com/stripe-api \| jq .info` |
|
|
35
|
+
| `outline <name \| apiId>` | The Spec Outline: title, servers, security, tags and a table of operations. `--tag T`, `--query Q`, `--all`. | `swaggerbot outline stripe.com/stripe-api --query customers` |
|
|
36
|
+
| `operation <name \| apiId> <method> <path>` | One operation, with every `$ref` it reaches inlined. | `swaggerbot operation stripe.com/stripe-api post /v1/customers` |
|
|
37
|
+
| `schema <name \| apiId> <schemaName>` | One schema of `components.schemas`, inlined the same way. | `swaggerbot schema stripe.com/stripe-api customer` |
|
|
38
|
+
| `vendors [<query>]` | The Vendors in the Index, by name. | `swaggerbot vendors str` |
|
|
39
|
+
| `vendor <vendor>` | One Vendor's APIs, each with its Current Spec and download URLs. | `swaggerbot vendor stripe.com` |
|
|
40
|
+
| `login`, `key`, `logout` | Store, show and forget an API key (above). | `swaggerbot key` |
|
|
41
|
+
|
|
42
|
+
An apiId has a `/` (`stripe.com/stripe-api`) and is used as is; a name is looked up first, and only a Resolved answer goes on. `swaggerbot --help` lists every flag.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
$ swaggerbot lookup "Val Town"
|
|
46
|
+
Resolved Val API (val.town/api) Official https://swaggerbot.dev/api/specs/4b446f57…/published verified 2026-09-24
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## `--json` and exit codes
|
|
50
|
+
|
|
51
|
+
`--json` prints the service's answer unchanged, for `jq` and programs, and on a failed request its error body too. When no answer came at all (unreachable, timed out) it prints `{"status":0,"error":"…"}`. `spec --json` prints what it wrote: `{ "specId", "apiId", "form", "path", "bytes", "sha256" }`.
|
|
52
|
+
|
|
53
|
+
| Exit | Meaning |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `0` | Resolved, or the command did what it was asked |
|
|
56
|
+
| `3` | Ambiguous |
|
|
57
|
+
| `4` | Unconfirmed |
|
|
58
|
+
| `5` | No Spec |
|
|
59
|
+
| `6` | Unknown |
|
|
60
|
+
| `1` | Refused or failed: no key, quota used, the service unreachable, a download that isn't its Spec |
|
|
61
|
+
| `2` | Usage error |
|
|
62
|
+
|
|
63
|
+
`--json` exits the same.
|
|
64
|
+
|
|
65
|
+
## The config file
|
|
66
|
+
|
|
67
|
+
`login` stores keys in a config file readable only by you (`0600`): `$XDG_CONFIG_HOME/swaggerbot/config.json` (`~/.config/swaggerbot/config.json`), `%APPDATA%\swaggerbot\config.json` on Windows, or wherever `SWAGGERBOT_CONFIG` points. Each key is kept under the origin it was checked with and sent to that origin only. The key is never printed or written anywhere else.
|
|
68
|
+
|
|
69
|
+
## `--url`
|
|
70
|
+
|
|
71
|
+
`--url <origin>` (or `SWAGGERBOT_URL`) points the CLI at another swagger.bot than `https://swaggerbot.dev`, such as one running locally. A key stored for one origin is never sent to another. The other global flags are `--no-color` (or `NO_COLOR`), `--version` and `--help`.
|
|
72
|
+
|
|
73
|
+
## More
|
|
74
|
+
|
|
75
|
+
- The documentation: <https://swaggerbot.dev/docs#cli>
|
|
76
|
+
- The repository: <https://github.com/evolv3ai/swaggerbot>
|
|
77
|
+
|
|
78
|
+
License: MIT
|