Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
swaggerhub-cli
Advanced tools
A command-line interface for SwaggerHub API (https://api.swaggerhub.com). Supports SwaggerHub SaaS and On-Premise.
Node.js 10 or later.
$ npm i -g swaggerhub-cli
$ swaggerhub configure
? SwaggerHub URL: https://api.swaggerhub.com
? API Key: <your-api-key>
SwaggerHub URL defaults to the SaaS version, https://api.swaggerhub.com
. The URL can be reset using the configure command
Alternatively, these values can be set using the SWAGGERHUB_URL
and SWAGGERHUB_API_KEY
environment variables. These take precedence over config values.
$ swaggerhub COMMAND
running command...
$ swaggerhub (-v|--version|version)
swaggerhub/0.1.2 darwin-x64 node-v12.13.0
$ swaggerhub --help [COMMAND]
USAGE
$ swaggerhub COMMAND
...
swaggerhub api:create OWNER/API_NAME/[VERSION]
swaggerhub api:get OWNER/API_NAME/[VERSION]
swaggerhub api:publish OWNER/API_NAME/VERSION
swaggerhub api:setdefault OWNER/API_NAME/VERSION
swaggerhub api:unpublish OWNER/API_NAME/VERSION
swaggerhub api:update OWNER/API_NAME/[VERSION]
swaggerhub configure
swaggerhub domain:publish OWNER/DOMAIN_NAME/VERSION
swaggerhub domain:unpublish OWNER/DOMAIN_NAME/VERSION
swaggerhub help [COMMAND]
swaggerhub api:create OWNER/API_NAME/[VERSION]
creates a new API / API version from a YAML/JSON file
USAGE
$ swaggerhub api:create OWNER/API_NAME/[VERSION]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to create in SwaggerHub
OPTIONS
-f, --file=file (required) file location of API to create
-h, --help show CLI help
--visibility=public|private [default: private] visibility of API in SwaggerHub
DESCRIPTION
The API version from the file will be used unless the version is specified in the command argument.
An error will occur if the API version already exists.
EXAMPLES
swaggerhub api:create organization/api/1.0.0 --file api.yaml --visibility public
swaggerhub api:create organization/api --file api.yaml
See code: src/commands/api/create.js
swaggerhub api:get OWNER/API_NAME/[VERSION]
fetches an API definition
USAGE
$ swaggerhub api:get OWNER/API_NAME/[VERSION]
ARGUMENTS
OWNER/API_NAME/[VERSION] SwaggerHub API to fetch
OPTIONS
-h, --help show CLI help
-j, --json returns the API in JSON format.
-r, --resolved gets the resolved API definition.
DESCRIPTION
When VERSION is not included in the argument, the default version will be returned.
Returns the API in YAML format by default.
EXAMPLES
swaggerhub api:get organization/api
swaggerhub api:get organization/api/1.0.0 --json
See code: src/commands/api/get.js
swaggerhub api:publish OWNER/API_NAME/VERSION
publish an API version
USAGE
$ swaggerhub api:publish OWNER/API_NAME/VERSION
ARGUMENTS
OWNER/API_NAME/VERSION API identifier
OPTIONS
-h, --help show CLI help
EXAMPLE
swaggerhub api:publish organization/api/1.0.0
See code: src/commands/api/publish.js
swaggerhub api:setdefault OWNER/API_NAME/VERSION
set the default version of an API
USAGE
$ swaggerhub api:setdefault OWNER/API_NAME/VERSION
ARGUMENTS
OWNER/API_NAME/VERSION API identifier
OPTIONS
-h, --help show CLI help
EXAMPLE
swaggerhub api:setdefault organization/api/2.0.0
See code: src/commands/api/setdefault.js
swaggerhub api:unpublish OWNER/API_NAME/VERSION
unpublish an API version
USAGE
$ swaggerhub api:unpublish OWNER/API_NAME/VERSION
ARGUMENTS
OWNER/API_NAME/VERSION API identifier
OPTIONS
-h, --help show CLI help
EXAMPLE
swaggerhub api:unpublish organization/api/1.0.0
See code: src/commands/api/unpublish.js
swaggerhub api:update OWNER/API_NAME/[VERSION]
update an API version
USAGE
$ swaggerhub api:update OWNER/API_NAME/[VERSION]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to update in SwaggerHub
OPTIONS
-f, --file=file (required) file location of API to update
-h, --help show CLI help
--visibility=public|private [default: private] visibility of API in SwaggerHub
DESCRIPTION
The API version from the file will be used unless the version is specified in the command argument.
An error will occur if the API version does not exist.
EXAMPLES
swaggerhub api:update organization/api --file api.yaml
swaggerhub api:update organization/api/1.0.0 --file api.json
See code: src/commands/api/update.js
swaggerhub configure
configure application settings
USAGE
$ swaggerhub configure
DESCRIPTION
Enter the SwaggerHub URL - default is https://api.swaggerhub.com
Enter the API Key - this can be retrieved from https://app.swaggerhub.com/settings/apiKey
You can set these as environment variables: SWAGGERHUB_URL, SWAGGERHUB_API_KEY. These take priority over config
settings.
See code: src/commands/configure.js
swaggerhub domain:publish OWNER/DOMAIN_NAME/VERSION
publish a domain version
USAGE
$ swaggerhub domain:publish OWNER/DOMAIN_NAME/VERSION
ARGUMENTS
OWNER/DOMAIN_NAME/VERSION Domain identifier
OPTIONS
-h, --help show CLI help
EXAMPLE
swaggerhub domain:publish organization/domain/1.0.0
See code: src/commands/domain/publish.js
swaggerhub domain:unpublish OWNER/DOMAIN_NAME/VERSION
unpublish a domain version
USAGE
$ swaggerhub domain:unpublish OWNER/DOMAIN_NAME/VERSION
ARGUMENTS
OWNER/DOMAIN_NAME/VERSION Domain identifier
OPTIONS
-h, --help show CLI help
EXAMPLE
swaggerhub domain:unpublish organization/domain/1.0.0
See code: src/commands/domain/unpublish.js
swaggerhub help [COMMAND]
display help for swaggerhub
USAGE
$ swaggerhub help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
The SwaggerHub CLI is currently in an active development phase—we will not be accepting Pull Requests at this time. If you’ve found any bugs or typos, or have a feature requests or general feedback you’d like to share, please open an issue and let us know.
testing changelog
FAQs
SwaggerHub CLI
The npm package swaggerhub-cli receives a total of 1,693 weekly downloads. As such, swaggerhub-cli popularity was classified as popular.
We found that swaggerhub-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.