Skip to content

document360/d360

Repository files navigation

Document360 official command-line interface (CLI)

NPM Version MIT License Build status

The d360 package provides the capability to both manage and synchronize your API Definition with Document360. By utilizing this package within Document360, you will be able to effortlessly generate API documentation for both internal and external consumers, automatically generated from your API definition files

Table of Contents

Setup

In order to install our package, it is required that you have Node.js already installed on your system. Once Node.js is successfully installed, you can proceed to directly install our package from the npm registry.

npm install -g d360

Commands

Our npm package includes a list of available commands, which are as follows:

  • apidocs - Generate API Documentation from your API Definition file
  • apidocs:resync - Resync your API Definition

apidocs

By utilizing the 'apidocs' command, you will have the ability to generate API documentation directly from your API Definition file.

d360 apidocs --apiKey=c92e71ab-ebdf-4007-89ed-5d47493052cd
             --userId=3340e95e-2b68-4a3f-a8c9-124bcaec9972
             --versionId=d486783f-b833-446e-aa71-615ac51392c3
             --path=https://petstore.swagger.io/v2/swagger.json
Options Description
apiKey string Project API Key
userId string User Id that's used to generate API Docs
versionId string Project Version Id
apihubUrl string APIHUB Base URL. The default value for this parameter is 'https://apihub.document360.io'
path string File path of your respective API Reference
force boolean Force import your API Reference. It will import even if there are errors or warnings present within your specification files.
publish boolean Publish articles after import. By default, all the articles will be in draft state after import

apidocs:resync

With the 'apidocs:resync' command, you are able to update or resynchronize your API Definition.

d360 apidocs:resync --apiKey=c92e71ab-ebdf-4007-89ed-5d47493052cd
                    --userId=3340e95e-2b68-4a3f-a8c9-124bcaec9972
                    --apiReferenceId=d486783f-b833-446e-aa71-615ac51392c3
                    --path=https://petstore.swagger.io/v2/swagger.json
Options Description
apiKey string Project API Key
userId string User Id that's used to resync API Reference
apiReferenceId string API Reference Id to resync
apihubUrl string APIHUB Base URL. The default value for this parameter is 'https://apihub.document360.io'
path string File path of your respective API Definitions
force boolean Force resync your API Reference. It will resync even your spec files has errors and warnings
publish boolean Publish articles after resync. By default, all the articles will be in draft state after resync

apidocs:validate

With the 'apidocs:validate' command, you will be able to validate your OpenAPI Specification(OAS) file.

d360 apidocs:validate --apiKey=c92e71ab-ebdf-4007-89ed-5d47493052cd
                      --apihubUrl=https://apihub.document360.io
                      --path=https://petstore.swagger.io/v2/swagger.json
Options Description
apiKey string Project API Key
apihubUrl string APIHUB Base URL. The default value for this parameter is 'https://apihub.document360.io'
path string File path of your respective API Definitions

What's next ?

As part of our ongoing efforts to enhance the user experience of our d360 npm package, we are committed to support backward compatibility to the best of our ability.