2.0.0 • Published 20 days ago

@go1/apim-cli v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
20 days ago

⚡️ Installation

First of all, make sure you have node v20 or higher installed. Then install the CLI and run the initialise command with:

npm i @go1/apim-cli -g

@go1/apim-cli init

You can alternatively use npx to install and initialise together

npx @go1/apim-cli init

This will kick off a wizard asking a few configuration questions including where to find the openapi.yml file. Afer the wizard has successfully finished, you should see a new folder called apim with all the required files for your service inside.

  • /apim
    • openapi.yml
    • config.yml
    • auth.policy.xml
    • /policies
      • endpoint_1.xml
      • endpoint_...xml

You're ready to push those files with your next commit and let the CI/CD pipeline handle the rest for you.

📖 Project Wiki

You can find more information about APIM here Add link here

⚙️ Commands & Options

init

CLI command for creating a new apim directory

@go1/apim-cli init [OPTION]
OptionDescriptionTypeDefaultRequired?
openapiPass the openapi.yml file, this will try to use configuration from the swagger doc to populate the wizardstringnullNo
namePass the display name of your servicestringnullNo
pathPass the public path for your servicestringnullNo
backendPass the internal path for your servicestringnullNo

update

CLI command for updating an existing apim directory so that you don't need to input the wizard again

@go1/apim-cli update

validate

CLI command for validating an open api doc follows the standard schema, you can also optionally pass a --master flag to validate against a source api to check if any breaking changes have been added. Input OpenAPI files can be either JSON or YAML format. There is also a --skip flag to still show breaking changes but don't throw an error in the console.

@go1/apim-cli validate <openapi.yml> [OPTION]

@go1/apim-cli validate openapi.yml --master=source.json --skip=true
OptionDescriptionTypeDefaultRequired?
openapiPass the incoming openapi.yml file that you want to validatestringnullYes
masterPass the source openapi.yml file to compare the incoming changes withstringnullNo
skipWhether you want to skip any breaking changes from throwing an errorbooleanfalseNo

merge

CLI command for merging two openapi docs into a single file. This is useful for merging individual services into a master open api doc.

@go1/apim-cli merge changes.yml source.yml output.json

Local Development

Clone this repo and run the following commands to setup and test locally

npm install
npm run build

chmod +x ./build
./build/cli.js init
npm run test

⚠️ License

Go1 APIM CLI is free and open-source software licensed under the Apache 2.0 License.

2.0.0

20 days ago

1.0.19

9 months ago

1.0.18

10 months ago

1.0.20

9 months ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago