0.1.12 • Published 10 years ago

swagger-cli-client v0.1.12

Weekly downloads
4
License
-
Repository
github
Last release
10 years ago

Swagger CLI Client

Generates a command-line interface for any Swagger Specification so you can do things like:

Example usage

Usage

This intended to be embedded within a wrapper application which can provide it the schema object (which is generated using fetch-swagger-schema). For example, here's the petstore-cli file:

#!/usr/bin/env node

var swaggerCli = require('../'),
  schema = require('./petstore-schema.json');

swaggerCli(schema);

To create a cli app for your schema, just require your schema instead of the petstore schema.

Auth lookup strategy

By default the cli will first use the --auth param (if defined), then it'll use the <appname>_AUTH (e.g., PETSTORECLI_AUTH) env variable (if defined), and finally a yaml/json file called .<app-name> (e.g. ~/.petstore-cli which may contain "auth: MY_TOKEN").

Overriding the base path

You can override your api base path via the same lookup strategy as auth keys, this is useful for testing and development. Pass in --basePathOverride <path> or defined a <app-name>_BASE_PATH or a basePath key-value pair in the .<app-name> config file.

0.1.12

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago