Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Generates a command-line interface for any Swagger Specification

Notifications You must be signed in to change notification settings

signalfx/swagger-cli-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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" }.

About

Generates a command-line interface for any Swagger Specification

Resources

Stars

Watchers

Forks

Packages

No packages published