Skip to content

Commit

Permalink
Update CLI docs (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcampos authored Jul 24, 2024
1 parent c96d557 commit 1c1a7fe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
41 changes: 25 additions & 16 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,44 @@
</a>
</p>

This CLI project aims to give a rating to OpenAPI definitions so you can understand
how helpful they are for the OpenAPI lifecycle. Having a low score might mean
that your journey of governing your API is going to be harder than it should.
This CLI project aims to give a rating to OpenAPI definitions so you can
understand how helpful they are for the OpenAPI lifecycle. Having a low score
might mean that your journey of governing your API is going to be harder than it
should.

# RMOA CLI
## Installation

```bash
npm install -g rmoa
```

## Usage

You can use the CLI to lint & get a score for your OpenAPI definition. You'll
need to create your api key on the
[Rate My Open API Portal](https://api.ratemyopenapi.com/docs) to use the CLI.

To start using the CLI, run:

```bash
rmoa --help
```

### Commands

```
rmoa <command>
Commands:
rmoa lint
Uploads an Open API file & gets it's Rate My Open API results
Lint & get a score for your OpenAPI definition using the Rate My OpenAPI ruleset
Options:
--version Show version number [boolean]
--help Show help [boolean]
--api-key The API Key from Zuplo [string] [required]
--api-key Your Rate My OpenAPI API Key [string] [required]
--filename The OpenApi file name to process [string] [required]
--dir The directory containing your Open API file[string] [default: "."]
--output default, json [string] [default: "default"]
```

## Using the CLI

You can also use the CLI to lint & get a score for your OpenAPI definition.
Create your api key on the [Rate My Open API Portal](https://api.ratemyopenapi.com/docs)

```
npx rmoa lint --dir /path/to/your/ --filename openapi.json --api-key zpka_1b...
```

4 changes: 2 additions & 2 deletions packages/cli/src/cmds/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { syncReport } from "../sync-report/handler.js";
import { Argv } from "yargs";

export default {
desc: "Uploads an Open API file & gets it's Rate My Open API results",
desc: "Lint & get a score for your OpenAPI definition using the Rate My OpenAPI ruleset",
command: "lint",

builder: (yargs: Argv): Argv<unknown> => {
return yargs
.option("api-key", {
type: "string",
describe: "The API Key from Zuplo",
describe: "Your Rate My OpenAPI API Key",
envVar: "API_KEY",
})
.option("filename", {
Expand Down

0 comments on commit 1c1a7fe

Please sign in to comment.