SwaggerHub CLI 使团队能够围绕 SwaggerHub 构建自动化和工作流程。团队可以在 CI/CD 管道等地方使用它来创建新的 API,创建和更新 API 版本,并将 API 版本标记为已发布和默认等功能。每个团队都有自己的工作流程,SwaggerHub CLI 可以帮助团队构建适合他们需求的工作流程。
Node.js 18.x 或更高版本。
$ npm i -g swaggerhub-cli
SwaggerHub CLI 可以通过环境变量或通过swaggerhub configure
命令进行配置。 CLI 将查找以下环境变量。
SWAGGERHUB_API_KEY
(必需) -重要提示:请确保此密钥的安全。这是 CLI 将用于身份验证的 SwaggerHub API 密钥。您可以在 SwaggerHub 的用户设置页面上找到您的 API 密钥。SWAGGERHUB_URL
(可选,默认为https://api.swaggerhub.com
) – 进行本地安装的客户需要将其指向其本地 API,即http(s)://{swaggerhub-host}/v1
(不要附加反斜杠)。或者,您可以使用swaggerhub configure
命令创建配置文件以供 CLI 使用。此命令将引导您完成设置必要配置的步骤。
$ swaggerhub configure
? SwaggerHub URL: https://api.swaggerhub.com
? API Key: <your-api-key>
环境变量优先于此命令创建的配置文件。
如果您的 SwaggerHub 本地实例使用自签名或私人签名的 SSL 证书,则需要执行其他步骤才能使 SwaggerHub CLI 信任此证书。
默认情况下,Node.js 拒绝自签名或私签名的 SSL 证书,因为它们的根 CA 未知。您将在 CLI 输出中看到如下错误:
FetchError: request to https://... failed, reason: self signed certificate
解决方案是使用NODE_EXTRA_CA_CERTS
环境变量为 Node.js 指定自定义受信任证书。
首先创建一个 .pem 文件,其中包含 PEM 格式的自定义受信任证书。
-----BEGIN CERTIFICATE-----
CA root certificate
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
Intermediate certificate 1
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
Intermediate certificate 2
-----END CERTIFICATE-----
在NODE_EXTRA_CA_CERTS
环境变量中指定此 PEM 文件的路径。
macOS/*nix/bash 示例:
export NODE_EXTRA_CA_CERTS=~/Work/extra-ca-certs.pem # '~' means the home folder of the logged-in user
export NODE_EXTRA_CA_CERTS=$HOME/.ssh/extra-ca-certs.pem
export NODE_EXTRA_CA_CERTS=/Users/username/Work/extra-ca-certs.pem
Windows 示例:
:: Both forward and backslashes are OK
set NODE_EXTRA_CA_CERTS=C:Workextra-ca-certs.pem
set NODE_EXTRA_CA_CERTS=C:/Work/extra-ca-certs.pem
:: You can also define the path itself using environment variables
set NODE_EXTRA_CA_CERTS=%USERPROFILE%extra-ca-certs.pem
$ 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:delete 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 api:validate OWNER/API_NAME/[VERSION]
swaggerhub api:validate:download-rules OWNER
swaggerhub api:validate:local
swaggerhub configure
swaggerhub domain:create OWNER/DOMAIN_NAME/[VERSION]
swaggerhub domain:delete OWNER/DOMAIN_NAME/[VERSION]
swaggerhub domain:get OWNER/DOMAIN_NAME/[VERSION]
swaggerhub domain:publish OWNER/DOMAIN_NAME/VERSION
swaggerhub domain:setdefault OWNER/DOMAIN_NAME/VERSION
swaggerhub domain:unpublish OWNER/DOMAIN_NAME/VERSION
swaggerhub domain:update OWNER/DOMAIN_NAME/[VERSION]
swaggerhub help [COMMANDS]
swaggerhub integration:create OWNER/API_NAME/[VERSION]
swaggerhub integration:delete OWNER/API_NAME/VERSION/INTEGRATION_ID
swaggerhub integration:execute OWNER/API_NAME/VERSION/INTEGRATION_ID
swaggerhub integration:get OWNER/API_NAME/VERSION/INTEGRATION_ID
swaggerhub integration:list OWNER/API_NAME/[VERSION]
swaggerhub integration:update OWNER/API_NAME/VERSION/INTEGRATION_ID
swaggerhub plugins
swaggerhub plugins:install PLUGIN...
swaggerhub plugins:inspect PLUGIN...
swaggerhub plugins:install PLUGIN...
swaggerhub plugins:link PLUGIN
swaggerhub plugins:uninstall PLUGIN...
swaggerhub plugins:uninstall PLUGIN...
swaggerhub plugins:uninstall PLUGIN...
swaggerhub plugins:update
swaggerhub project:api:add OWNER/PROJECT_NAME API
swaggerhub project:api:remove OWNER/PROJECT_NAME API
swaggerhub project:create OWNER/PROJECT_NAME
swaggerhub project:delete OWNER/PROJECT_NAME
swaggerhub project:domain:add OWNER/PROJECT_NAME DOMAIN
swaggerhub project:domain:remove OWNER/PROJECT_NAME DOMAIN
swaggerhub project:get OWNER/PROJECT_NAME
swaggerhub project:list [OWNER]
swaggerhub project:member:list OWNER/PROJECT_NAME
swaggerhub api:create
从 YAML/JSON 文件创建新的 API/API 版本
USAGE
$ swaggerhub api:create OWNER/API_NAME/[VERSION] [--visibility public|private] (--published publish|unpublish
-f <value>) [--setdefault ] [-h]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to create on SwaggerHub
FLAGS
-f, --file=<value> (required) file location of API to create
-h, --help Show CLI help.
--published=<option> [default: unpublish] sets the lifecycle setting of the API version
<options: publish|unpublish>
--setdefault sets API version to be the default
--visibility=<option> [default: private] visibility of API in SwaggerHub
<options: public|private>
DESCRIPTION
creates a new API / API version from a YAML/JSON file
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
$ swaggerhub api:create organization/api/1.0.0 --published=publish --file api.json
$ swaggerhub api:create organization/api/1.0.0 --setdefault --file api.json
$ swaggerhub api:create organization/api/1.0.0 --published=publish --setdefault --file api.json
参见代码:src/commands/api/create.js
swaggerhub api:delete
删除 API 或 API 版本
USAGE
$ swaggerhub api:delete OWNER/API_NAME/[VERSION] [-f] [-h]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to delete on SwaggerHub
FLAGS
-f, --force delete API without prompting for confirmation
-h, --help Show CLI help.
DESCRIPTION
delete an API or API version
EXAMPLES
$ swaggerhub api:delete organization/api/1.0.0
$ swaggerhub api:delete organization/api
$ swaggerhub api:delete organization/api --force
参见代码:src/commands/api/delete.js
swaggerhub api:get
获取 API 定义
USAGE
$ swaggerhub api:get OWNER/API_NAME/[VERSION] [-j] [-r] [-h]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to fetch from Swaggerhub
FLAGS
-h, --help Show CLI help.
-j, --json returns the API in JSON format.
-r, --resolved gets the resolved API definition (supported in v1.25+).
DESCRIPTION
fetches an API definition
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
参见代码:src/commands/api/get.js
swaggerhub api:publish
发布 API 版本
USAGE
$ swaggerhub api:publish OWNER/API_NAME/VERSION [-f] [-h]
ARGUMENTS
OWNER/API_NAME/VERSION API to publish on Swaggerhub
FLAGS
-f, --force publish API without prompting for confirmation
-h, --help Show CLI help.
DESCRIPTION
publish an API version
EXAMPLES
$ swaggerhub api:publish organization/api/1.0.0
$ swaggerhub api:publish organization/api/1.0.0 --force
参见代码:src/commands/api/publish.js
swaggerhub api:setdefault
设置 API 的默认版本
USAGE
$ swaggerhub api:setdefault OWNER/API_NAME/VERSION [-h]
ARGUMENTS
OWNER/API_NAME/VERSION API to set as default on Swaggerhub
FLAGS
-h, --help Show CLI help.
DESCRIPTION
set the default version of an API
EXAMPLES
$ swaggerhub api:setdefault organization/api/2.0.0
参见代码:src/commands/api/setdefault.js
swaggerhub api:unpublish
取消发布 API 版本
USAGE
$ swaggerhub api:unpublish OWNER/API_NAME/VERSION [-h]
ARGUMENTS
OWNER/API_NAME/VERSION API identifier
FLAGS
-h, --help Show CLI help.
DESCRIPTION
unpublish an API version
EXAMPLES
$ swaggerhub api:unpublish organization/api/1.0.0
请参阅代码:src/commands/api/unpublish.js
swaggerhub api:update
更新 API
USAGE
$ swaggerhub api:update OWNER/API_NAME/[VERSION] [-f <value>] [--visibility public|private] [--published
publish|unpublish] [--setdefault] [-h]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to update on SwaggerHub
FLAGS
-f, --file=<value> file location of API to update
-h, --help Show CLI help.
--published=<option> sets the lifecycle setting of the API version
<options: publish|unpublish>
--setdefault sets API version to be the default
--visibility=<option> visibility of API in SwaggerHub
<options: public|private>
DESCRIPTION
update an API
The API version from the file will be used unless the version is specified in the command argument.
When no file is specified then the default API version will be updated.
The API visibility can be changed by using visibility flag.
EXAMPLES
$ swaggerhub api:update organization/api --file api.yaml
$ swaggerhub api:update organization/api/1.0.0 --file api.json
$ swaggerhub api:update organization/api/1.0.0 --published=publish --file api.json
$ swaggerhub api:update organization/api/1.0.0 --setdefault --file api.json
$ swaggerhub api:update organization/api/1.0.0 --published=unpublish --setdefault --file api.json
$ swaggerhub api:update organization/api/1.0.0 --visibility=private
请参阅代码:src/commands/api/update.js
swaggerhub api:validate
获取 API 版本的验证结果
USAGE
$ swaggerhub api:validate OWNER/API_NAME/[VERSION] [-c] [-j] [-h]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to fetch validation errors for from Swaggerhub
FLAGS
-c, --fail-on-critical Exit with error code 1 if there are critical standardization errors present
-h, --help Show CLI help.
-j, --json Print output in JSON instead of table format
DESCRIPTION
Get validation result for an API version
When VERSION is not included in the argument, the default version will be validated.
An error will occur if the API version does not exist.
If the flag `-c` or `--failOnCritical` is used and there are standardization
errors with `Critical` severity present, the command will exit with error code `1`.
EXAMPLES
$ swaggerhub api:validate organization/api/1.0.0
$ swaggerhub api:validate -c -j organization/api/1.0.0
$ swaggerhub api:validate --fail-on-critical --json organization/api
请参阅代码:src/commands/api/validate/index.js
swaggerhub api:validate:download-rules
获取现有 SwaggerHub 的组织标准化规则集。
USAGE
$ swaggerhub api:validate:download-rules OWNER [-s] [-d] [-h]
ARGUMENTS
OWNER Which organization standardization rules to fetch from SwaggerHub
FLAGS
-d, --include-disabled-rules Includes disabled rules in fetched organization's ruleset
-h, --help Show CLI help.
-s, --include-system-rules Includes system rules in fetched organization's ruleset
DESCRIPTION
Get existing SwaggerHub's organization standardization ruleset.
Requires organization name argument. An error will occur if provided organization doesn't exist
or your account is not permitted to access that organization's settings.
If the flag `-s` or `--include-system-rules` is used, the returned ruleset will also include SwaggerHub system rules.
If the flag `-d` or `--include-disabled-rules` is used, the returned ruleset will also include disabled custom rules
EXAMPLES
$ swaggerhub api:validate:download-rules myOrg -s
$ swaggerhub api:validate:download-rules myOrg --include-disabled-rules -s
请参阅代码:src/commands/api/validate/download-rules.js
swaggerhub api:validate:local
使用 SwaggerHub 上组织的标准化配置对本地 API 定义运行扫描。
USAGE
$ swaggerhub api:validate:local -f <value> -o <value> [-c] [-j] [-h]
FLAGS
-c, --fail-on-critical Exit with error code 1 if there are critical standardization errors present
-f, --file=<value> (required) Path of API definition file to run scan against
-h, --help Show CLI help.
-j, --json Print output in JSON instead of table format
-o, --organization=<value> (required) Which organization's standardization settings to use for linting the target
definition
DESCRIPTION
Runs a scan against a local API definition using the organization's standardization configuration on SwaggerHub.
If the flag `-c` or `--failOnCritical` is used and there are standardization
errors with `Critical` severity present, the command will exit with error code `1`.
EXAMPLES
$ swaggerhub api:validate:local -o myOrg -f ./my-api.yaml -c -j
$ swaggerhub api:validate:local --organization myOrg --file ./my-api/json --fail-on-critical --json
请参阅代码:src/commands/api/validate/local.js
swaggerhub configure
配置应用程序设置
USAGE
$ swaggerhub configure [-h]
FLAGS
-h, --help Show CLI help.
DESCRIPTION
configure application settings
Enter the SwaggerHub URL - default is https://api.swaggerhub.com
Customers with on-premise installations need to point this to their on-premise API, which is
http(s)://{swaggerhub-host}/v1
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.
参见代码:src/commands/configure.js
swaggerhub domain:create
从 YAML/JSON 文件创建新的域/域版本
USAGE
$ swaggerhub domain:create OWNER/DOMAIN_NAME/[VERSION] [--visibility public|private] (--published
publish|unpublish -f <value>) [--setdefault ] [-h]
ARGUMENTS
OWNER/DOMAIN_NAME/[VERSION] Domain to create on SwaggerHub
FLAGS
-f, --file=<value> (required) file location of domain to create
-h, --help Show CLI help.
--published=<option> [default: unpublish] sets the lifecycle setting of the domain version
<options: publish|unpublish>
--setdefault sets domain version to be the default
--visibility=<option> [default: private] visibility of domain in SwaggerHub
<options: public|private>
DESCRIPTION
creates a new domain / domain version from a YAML/JSON file
The domain version from the file will be used unless the version is specified in the command argument.
An error will occur if the domain version already exists.
EXAMPLES
$ swaggerhub domain:create organization/domain/1.0.0 --file domain.yaml --visibility public
$ swaggerhub domain:create organization/domain --file domain.yaml
$ swaggerhub domain:create organization/domain/1.0.0 --publish --file domain.json
$ swaggerhub domain:create organization/domain/1.0.0 --setdefault --file domain.json
$ swaggerhub domain:create organization/domain/1.0.0 --publish --setdefault --file domain.json
请参阅代码:src/commands/domain/create.js
swaggerhub domain:delete
删除域或域版本
USAGE
$ swaggerhub domain:delete OWNER/DOMAIN_NAME/[VERSION] [-f] [-h]
ARGUMENTS
OWNER/DOMAIN_NAME/[VERSION] Domain to delete on SwaggerHub
FLAGS
-f, --force delete domain without prompting for confirmation
-h, --help Show CLI help.
DESCRIPTION
delete a domain or domain version
EXAMPLES
$ swaggerhub domain:delete organization/domain/1.0.0
$ swaggerhub domain:delete organization/domain
$ swaggerhub domain:delete organization/domain --force
参见代码:src/commands/domain/delete.js
swaggerhub domain:get
获取域定义
USAGE
$ swaggerhub domain:get OWNER/DOMAIN_NAME/[VERSION] [-j] [-h]
ARGUMENTS
OWNER/DOMAIN_NAME/[VERSION] Domain to fetch from SwaggerHub
FLAGS
-h, --help Show CLI help.
-j, --json returns the domain in JSON format.
DESCRIPTION
fetches a domain definition
When VERSION is not included in the argument, the default version will be returned.
Returns the domain in YAML format by default.
EXAMPLES
$ swaggerhub domain:get organization/domain
$ swaggerhub domain:get organization/domain/1.0.0 --json
参见代码:src/commands/domain/get.js
swaggerhub domain:publish
发布域版本
USAGE
$ swaggerhub domain:publish OWNER/DOMAIN_NAME/VERSION [-h]
ARGUMENTS
OWNER/DOMAIN_NAME/VERSION Domain to publish on SwaggerHub
FLAGS
-h, --help Show CLI help.
DESCRIPTION
publish a domain version
EXAMPLES
$ swaggerhub domain:publish organization/domain/1.0.0
请参阅代码:src/commands/domain/publish.js
swaggerhub domain:setdefault
设置域的默认版本
USAGE
$ swaggerhub domain:setdefault OWNER/DOMAIN_NAME/VERSION [-h]
ARGUMENTS
OWNER/DOMAIN_NAME/VERSION Domain to set as default on SwaggerHub
FLAGS
-h, --help Show CLI help.
DESCRIPTION
set the default version of a domain
EXAMPLES
$ swaggerhub domain:setdefault organization/domain/2.0.0
请参阅代码:src/commands/domain/setdefault.js
swaggerhub domain:unpublish
取消发布域版本
USAGE
$ swaggerhub domain:unpublish OWNER/DOMAIN_NAME/VERSION [-h]
ARGUMENTS
OWNER/DOMAIN_NAME/VERSION Domain to unpublish on SwaggerHub
FLAGS
-h, --help Show CLI help.
DESCRIPTION
unpublish a domain version
EXAMPLES
$ swaggerhub domain:unpublish organization/domain/1.0.0
请参阅代码:src/commands/domain/unpublish.js
swaggerhub domain:update
更新域
USAGE
$ swaggerhub domain:update OWNER/DOMAIN_NAME/[VERSION] [-f <value>] [--visibility public|private] [--published
publish|unpublish] [--setdefault] [-h]
ARGUMENTS
OWNER/DOMAIN_NAME/[VERSION] Domain to update on SwaggerHub
FLAGS
-f, --file=<value> file location of domain to update
-h, --help Show CLI help.
--published=<option> sets the lifecycle setting of the domain version
<options: publish|unpublish>
--setdefault sets domain version to be the default
--visibility=<option> visibility of domain in SwaggerHub
<options: public|private>
DESCRIPTION
update a domain
The domain version from the file will be used unless the version is specified in the command argument.
When no file is specified then the default domain version will be updated.
The domain visibility can be changed by using visibility flag.
EXAMPLES
$ swaggerhub domain:update organization/domain --file domain.yaml
$ swaggerhub domain:update organization/domain/1.0.0 --file domain.json
$ swaggerhub domain:update organization/domain/1.0.0 --published=publish --file domain.json
$ swaggerhub domain:update organization/domain/1.0.0 --setdefault --file domain.json
$ swaggerhub domain:update organization/domain/1.0.0 --published=unpublish --setdefault --file domain.json
$ swaggerhub domain:update organization/domain/1.0.0 --visibility=private
请参阅代码:src/commands/domain/update.js
swaggerhub help
显示 swaggerhub 的帮助。
USAGE
$ swaggerhub help [COMMANDS] [-n]
ARGUMENTS
COMMANDS Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for swaggerhub.
请参阅代码:@oclif/plugin-help
swaggerhub integration:create
从 JSON 配置文件创建新的 API 集成。
USAGE
$ swaggerhub integration:create OWNER/API_NAME/[VERSION] -f <value> [-h]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to add integration to on SwaggerHub
FLAGS
-f, --file=<value> (required) location of integration configuration file
-h, --help Show CLI help.
DESCRIPTION
creates a new API integration from a JSON configuration file.
See the documentation for configuration files:
https://github.com/SmartBear/swaggerhub-cli/tree/main/examples/integrations
When VERSION is not included in the argument, the integration will be added to be default API version.
EXAMPLES
$ swaggerhub integration:create organization/api/1.0.0 --file config.json
请参阅代码:src/commands/integration/create.js
swaggerhub integration:delete
从给定 API 中删除集成。
USAGE
$ swaggerhub integration:delete OWNER/API_NAME/VERSION/INTEGRATION_ID [-h]
ARGUMENTS
OWNER/API_NAME/VERSION/INTEGRATION_ID Integration to delete for given API on Swaggerhub
FLAGS
-h, --help Show CLI help.
DESCRIPTION
deletes the integration from the given API.
EXAMPLES
$ swaggerhub integration:delete organization/api/1.0.0/503c2db6-448a-4678-a310-f465429e9704
请参阅代码:src/commands/integration/delete.js
swaggerhub integration:execute
执行给定 API 的集成。
USAGE
$ swaggerhub integration:execute OWNER/API_NAME/VERSION/INTEGRATION_ID [-h]
ARGUMENTS
OWNER/API_NAME/VERSION/INTEGRATION_ID Integration to execute for given API on Swaggerhub
FLAGS
-h, --help Show CLI help.
DESCRIPTION
executes an integration for the given API.
EXAMPLES
$ swaggerhub integration:execute organization/api/1.0.0/503c2db6-448a-4678-a310-f465429e9704
请参阅代码:src/commands/integration/execute.js
swaggerhub integration:get
检索给定 API 的集成。
USAGE
$ swaggerhub integration:get OWNER/API_NAME/VERSION/INTEGRATION_ID [-h]
ARGUMENTS
OWNER/API_NAME/VERSION/INTEGRATION_ID Integration to fetch for given API on Swaggerhub
FLAGS
-h, --help Show CLI help.
DESCRIPTION
retieves an integration for the given API.
EXAMPLES
$ swaggerhub integration:get organization/api/1.0.0/503c2db6-448a-4678-a310-f465429e9704
请参阅代码:src/commands/integration/get.js
swaggerhub integration:list
列出 API 上的集成。
USAGE
$ swaggerhub integration:list OWNER/API_NAME/[VERSION] [-h]
ARGUMENTS
OWNER/API_NAME/[VERSION] API to list integrations for on Swaggerhub
FLAGS
-h, --help Show CLI help.
DESCRIPTION
list integrations on an API.
EXAMPLES
$ swaggerhub integration:list organization/api/1.0.0
请参阅代码:src/commands/integration/list.js
swaggerhub integration:update
更新 API 集成的配置。
USAGE
$ swaggerhub integration:update OWNER/API_NAME/VERSION/INTEGRATION_ID -f <value> [-h]
ARGUMENTS
OWNER/API_NAME/VERSION/INTEGRATION_ID Integration to update for given API on Swaggerhub
FLAGS
-f, --file=<value> (required) location of integration configuration file
-h, --help Show CLI help.
DESCRIPTION
update the configuration of an API integration.
EXAMPLES
$ swaggerhub integration:update organization/api/1.0.0/503c2db6-448a-4678-abcd-0123456789abc --file config.json
请参阅代码:src/commands/integration/update.js
swaggerhub plugins
列出已安装的插件。
USAGE
$ swaggerhub plugins [--json] [--core]
FLAGS
--core Show core plugins.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List installed plugins.
EXAMPLES
$ swaggerhub plugins
请参阅代码:@oclif/plugin-plugins
swaggerhub plugins:install
将插件安装到 CLI 中。
USAGE
$ swaggerhub plugins:install PLUGIN...
ARGUMENTS
PLUGIN Plugin to install.
FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ swaggerhub plugins:add
EXAMPLES
$ swaggerhub plugins:install myplugin
$ swaggerhub plugins:install https://github.com/someuser/someplugin
$ swaggerhub plugins:install someuser/someplugin
swaggerhub plugins:inspect
显示插件的安装属性。
USAGE
$ swaggerhub plugins:inspect PLUGIN...
ARGUMENTS
PLUGIN [default: .] Plugin to inspect.
FLAGS
-h, --help Show CLI help.
-v, --verbose
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Displays installation properties of a plugin.
EXAMPLES
$ swaggerhub plugins:inspect myplugin
请参阅代码:@oclif/plugin-plugins
swaggerhub plugins:install
将插件安装到 CLI 中。
USAGE
$ swaggerhub plugins:install PLUGIN...
ARGUMENTS
PLUGIN Plugin to install.
FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ swaggerhub plugins:add
EXAMPLES
$ swaggerhub plugins:install myplugin
$ swaggerhub plugins:install https://github.com/someuser/someplugin
$ swaggerhub plugins:install someuser/someplugin
请参阅代码:@oclif/plugin-plugins
swaggerhub plugins:link
将插件链接到 CLI 中进行开发。
USAGE
$ swaggerhub plugins:link PLUGIN
ARGUMENTS
PATH [default: .] path to plugin
FLAGS
-h, --help Show CLI help.
-v, --verbose
--[no-]install Install dependencies after linking the plugin.
DESCRIPTION
Links a plugin into the CLI for development.
Installation of a linked plugin will override a user-installed or core plugin.
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
command will override the user-installed or core plugin implementation. This is useful for development work.
EXAMPLES
$ swaggerhub plugins:link myplugin
请参阅代码:@oclif/plugin-plugins
swaggerhub plugins:uninstall
从 CLI 中删除插件。
USAGE
$ swaggerhub plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ swaggerhub plugins:unlink
$ swaggerhub plugins:remove
swaggerhub plugins:uninstall
从 CLI 中删除插件。
USAGE
$ swaggerhub plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ swaggerhub plugins:unlink
$ swaggerhub plugins:remove
请参阅代码:@oclif/plugin-plugins
swaggerhub plugins:uninstall
从 CLI 中删除插件。
USAGE
$ swaggerhub plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ swaggerhub plugins:unlink
$ swaggerhub plugins:remove
swaggerhub plugins:update
更新已安装的插件。
USAGE
$ swaggerhub plugins:update [-h] [-v]
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Update installed plugins.
请参阅代码:@oclif/plugin-plugins
swaggerhub project:api:add
将 API 添加到现有项目。
USAGE
$ swaggerhub project:api:add OWNER/PROJECT_NAME API [-h]
ARGUMENTS
OWNER/PROJECT_NAME The project to add the API to on Swaggerhub
API The name of the API on Swaggerhub to add
FLAGS
-h, --help Show CLI help.
DESCRIPTION
Adds an API to an existing project.
EXAMPLES
$ swaggerhub project:api:add organization/project_name my_api
参见代码:src/commands/project/api/add.js
swaggerhub project:api:remove