From 1c1a7feaa7dea8012bb4ad98f923d7b453f56503 Mon Sep 17 00:00:00 2001
From: lcampos
Date: Wed, 24 Jul 2024 07:14:58 -0700
Subject: [PATCH] Update CLI docs (#257)
---
packages/cli/README.md | 41 +++++++++++++++++++++--------------
packages/cli/src/cmds/lint.ts | 4 ++--
2 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/packages/cli/README.md b/packages/cli/README.md
index 056d5bf..f8ebfc8 100644
--- a/packages/cli/README.md
+++ b/packages/cli/README.md
@@ -7,11 +7,30 @@
-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
@@ -19,23 +38,13 @@ rmoa
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...
-```
-
diff --git a/packages/cli/src/cmds/lint.ts b/packages/cli/src/cmds/lint.ts
index 9aa2aaa..a1f6d50 100644
--- a/packages/cli/src/cmds/lint.ts
+++ b/packages/cli/src/cmds/lint.ts
@@ -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 => {
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", {