You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-15Lines changed: 27 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,16 @@
6
6
7
7
`rdme` is the CLI wrapper for [ReadMe's RESTful API](https://docs.readme.com/reference/intro-to-the-readme-api). It allows you to upload and edit [OpenAPI](https://swagger.io/specification/) and [Swagger](https://swagger.io/specification/v2/) files associated with projects you create on [ReadMe](https://readme.com/). Additionally, you can sync documentation with your project, and manage project versions.
8
8
9
-
*[Configuration](#installation)
10
-
*[Installation](#installation)
11
-
*[Authentication](#authentication)
12
-
*[Usage](#usage)
13
-
*[Common options](#common-rdme-options)
14
-
*[OpenAPI / Swagger](#openapi--swagger)
15
-
*[Docs](#docs)
16
-
*[Versions](#versions)
17
-
*[Opening a Project](#open)
18
-
*[Future](#future)
19
-
20
9
## Configuration
10
+
21
11
### Installation
12
+
22
13
```sh
23
14
npm install rdme
24
15
```
25
16
26
17
### Authentication
18
+
27
19
If you authenticate `rdme` to your ReadMe project, we will save your API key to a local configuration file (`~/.config/configstore/rdme-production.json`) so you will not have to provide the `--key` option to commands that require it.
28
20
29
21
```sh
@@ -33,34 +25,40 @@ rdme login
33
25
`rdme whoami` is also available to you to determine who you are logged in as, and to what project, as well as `rdme logout` for logging out of that account.
34
26
35
27
## Usage
28
+
36
29
If you wish to get more information about any command within `rdme`, you can execute `rdme help <command>` or `rdme <command> --help`. You an also execute `rdme help` to see a global list of commands that `rdme` offers.
37
30
38
31
### Common `rdme` Options
39
-
*`--key <string>`: The API key associated with your ReadMe project. You can obtain this from your dashboard, or alternatively if you log in with `rdme login`, we will save your API key to a local configuration file (`~/.config/configstore/rdme-production.json`), saving you the hassle of having to supply this argument on commands that have it.
40
-
*`--version <string>`: Your project version.
32
+
33
+
-`--key <string>`: The API key associated with your ReadMe project. You can obtain this from your dashboard, or alternatively if you log in with `rdme login`, we will save your API key to a local configuration file (`~/.config/configstore/rdme-production.json`), saving you the hassle of having to supply this argument on commands that have it.
34
+
-`--version <string>`: Your project version.
41
35
42
36
### OpenAPI / Swagger
37
+
43
38
ReadMe supports [OpenAPI 3.0](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md), [OpenAPI 3.1](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md), and [Swagger 2.x](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md).
44
39
45
40
The following examples use JSON files, but we support API Definitions that are written in either JSON or YAML.
46
41
47
42
> ℹ️ Note that the `rdme openapi` command supports both OpenAPI and Swagger API definitions. The `rdme swagger` command is an alias for `rdme openapi` and is deprecated.
48
43
49
44
#### Uploading a New API Definition to ReadMe
45
+
50
46
This will upload `path-to-openapi.json` to your project and return an ID and URL for you to later update your file, and view it in the client.
51
47
52
48
```sh
53
49
rdme openapi [path-to-file.json]
54
50
```
55
51
56
52
#### Editing (Re-Syncing) an Existing API Definition
53
+
57
54
This will edit (re-sync) an existing API definition (identified by `--id`) within your ReadMe project.
If you run `rdme` within a directory that contains your OpenAPI or Swagger definition, you can omit the file path. We will then look for a file with the following names, and upload that: `openapi.json`, `openapi.yaml`, `swagger.json`, and `swagger.yaml`.
76
75
77
76
```sh
78
77
rdme openapi
79
78
```
80
79
81
80
#### Validating an API Definition
81
+
82
82
You can also perform a local validation of your API definition without uploading it to ReadMe, which can be useful when constructing or editing your API definition.
If you wish to automate the process of creating a new project version, and not have the CLI prompt you for input, you can do so by supplying the necessary flags to `versions:create`.
See `rdme versions:create --help` for a full list of flags.
129
137
130
138
#### Update a Version
139
+
131
140
```sh
132
141
rdme versions:update --version={project-version}
133
142
```
134
143
135
144
Like `versions:create`, if you wish to automate this process and not be blocked by CLI input, you can supply the necessary flags to this command. See `rdme versions:update --help` for more information.
136
145
137
146
#### Delete a Version
147
+
138
148
You can remove a specific version from your project, as well as all of the attached specs
139
149
140
150
```sh
141
151
rdme versions:delete --version={project-version}
142
152
```
143
153
144
154
### Open Your ReadMe Project in Your Browser
155
+
145
156
If you are logged in, this will open the project in your browser:
146
157
147
158
```sh
148
159
rdme open
149
160
```
150
161
151
162
## Future
163
+
152
164
We are continually expanding and improving the offerings of this application as we expand our public API and are able. Some interactions may change over time, but we will do our best to retain backwards compatibility.
0 commit comments