Skip to content

Commit 520edd1

Browse files
committed
OAI -> OAS
1 parent 86e6d8c commit 520edd1

File tree

8 files changed

+43
-21
lines changed

8 files changed

+43
-21
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
oai
1+
oas
22
===
33

4-
Creating Swagger / Open API Initiative files is hard. This makes it easier.
4+
Creating Swagger / Open API Spec files is hard. This makes it easier.
55

66
[![](https://cl.ly/1h271F1M1e2T/Untitled-2.png)](http://readme.io)
77

88
Installation
99
------------
1010

11-
npm install oai -g
11+
npm install oas -g
1212

1313
Usage
1414
-----
1515

1616
Go to a directory with your API, and type:
1717

18-
oai init
18+
oas init
1919

2020
It will walk you through how to document your API with Open API Initiave.
2121

2222
Swagger Inline
2323
--------------
2424

25-
Rather than trying to juggle one gigantic repo, `oai` uses something called
25+
Rather than trying to juggle one gigantic repo, `oas` uses something called
2626
[swagger-inline](https://github.com/readmeio/swagger-inline). It lets you include
2727
a little swagger snippet in a comment above your code, and collects them all
2828
together into one Swagger file:
@@ -54,7 +54,7 @@ Host your Swagger file
5454
Hosting Swagger files is hard! So, we have an online component that hosts your
5555
Swagger file for you. Just type the following to get a URL:
5656

57-
oai host
57+
oas host
5858

5959
This will upload your Swagger file and give you a URL you can use.
6060

api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exports.api = function(args, opts) {
3131
info.token = login.token;
3232
} catch(e) {
3333
console.log('You need to log in to do this!'.red);
34-
console.log('Run ' + 'oai login'.yellow);
34+
console.log('Run ' + 'oas login'.yellow);
3535
return process.exit();
3636
}
3737
}
@@ -110,7 +110,7 @@ exports.load = function(action) {
110110
}
111111

112112
console.log('Action not found.'.red);
113-
console.log('Type ' + 'oai help'.yellow + ' to see all commands');
113+
console.log('Type ' + 'oas help'.yellow + ' to see all commands');
114114
process.exit();
115115
};
116116

lib/docs.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var utils = require('../utils');
2+
3+
exports.swagger = true;
4+
exports.swaggerUrl = true;
5+
exports.login = true;
6+
exports.desc = "Host your docs on ReadMe";
7+
exports.category = "services";
8+
9+
exports.run = function(config, info) {
10+
console.log("");
11+
console.log("Success! ".green + "You can now access your Swagger from the following publicly sharable URL:");
12+
console.log("");
13+
console.log(" " + info.swaggerUrl + "?docs");
14+
console.log("");
15+
console.log("To use in ReadMe for documentation, follow the URL for setup information.");
16+
17+
utils.open(info.swaggerUrl + "?docs", info);
18+
19+
process.exit();
20+
};

lib/help.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ var _ = require('lodash');
55
exports.swagger = false;
66
exports.login = false;
77
exports.category = "basic";
8-
exports.desc = "Learn what you can do with oai";
8+
exports.desc = "Learn what you can do with oas";
99
exports.weight = 2;
1010

1111
exports.run = function(config, info) {
1212
console.log("");
13-
console.log("Usage: oai <command> [swagger url]");
13+
console.log("Usage: oas <command> [swagger url]");
1414
var files = glob.sync(path.join(__dirname, "*"));
1515

1616
var categories = {
@@ -35,7 +35,7 @@ exports.run = function(config, info) {
3535

3636
if(f.category) {
3737
categories[f.category].commands.push({
38-
text: " $".grey + pad(" oai " + action) + " " + info.grey,
38+
text: " $".grey + pad(" oas " + action) + " " + info.grey,
3939
weight: f.weight,
4040
});
4141
}
@@ -51,7 +51,7 @@ exports.run = function(config, info) {
5151

5252
console.log("");
5353
console.log("Just getting started?".green);
54-
console.log("Run " + "oai init".yellow + " to create your Swagger file.");
54+
console.log("Run " + "oas init".yellow + " to create your Swagger file.");
5555
console.log("");
5656

5757
process.exit();

lib/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ exports.run = function(config, info) {
151151
console.log('');
152152
console.log('For more information on this syntax, see https://github.com/readmeio/swagger-inline');
153153
console.log('');
154-
console.log('To see what you can do with your API, type ' + 'oai help'.yellow + '.');
154+
console.log('To see what you can do with your API, type ' + 'oas help'.yellow + '.');
155155
console.log('');
156-
console.log('To publish your OAI file, type ' + 'oai host'.yellow + '!');
156+
console.log('To publish your OAS file, type ' + 'oas host'.yellow + '!');
157157
console.log('');
158158

159159
process.exit();

lib/manage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports.run = function(config, info) {
1212
console.log("GRANT PUSH ACCESS".cyan);
1313
console.log("Run the following command to add them (must match their GitHub email):");
1414
console.log("");
15-
console.log(" $ oai add user@email.com".grey);
15+
console.log(" $ oas add user@email.com".grey);
1616
console.log("");
1717
console.log("");
1818

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
{
22
"author": "ReadMe <support@readme.io> (http://readme.io)",
3-
"name": "oai",
3+
"name": "oas",
44
"description": "A collection of Open API Initiative (Swagger) tools",
55
"bin": {
6-
"oai": "index.js"
6+
"oas": "index.js"
77
},
88
"tags": [
99
"api",
1010
"apis",
1111
"swagger",
1212
"open api initiative",
13+
"open api spec",
1314
"oai",
15+
"oas",
1416
"apidoc",
1517
"microservice",
1618
"documentation"
1719
],
18-
"version": "0.6.1",
20+
"version": "0.6.2",
1921
"repository": {
2022
"type": "git",
21-
"url": "git://github.com/readmeio/oai.git"
23+
"url": "git://github.com/readmeio/oas.git"
2224
},
2325
"bugs": {
24-
"url": "https://github.com/readmeio/oai/issues"
26+
"url": "https://github.com/readmeio/oas/issues"
2527
},
2628
"main": "index.js",
2729
"dependencies": {

utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ exports.findSwagger = function(cb, opts) {
3333

3434
if(!generatedSwagger['x-si-base']) {
3535
console.log("We couldn't find a Swagger file.".red);
36-
console.log("Run " + "oai init".yellow + " to get started.");
36+
console.log("Don't worry, it's easy to get started! Run " + "oas init".yellow + " to get started.");
3737
process.exit();
3838
}
3939

0 commit comments

Comments
 (0)