kong-portal-cli v3.6.3
Kong Developer Portal CLI
The Kong Developer Portal CLI is used to manage your Developer Portals from the command line. It is built using clipanion.
Overview
This is the next generation TypeScript based Developer Portal CLI. The goal of this project is to make a higher quality CLI tool over the initial sync script.
This project is built for Kong Enterprise >= 1.3.
For Kong Enterprise <= 0.36, or for legacy mode on Kong Enterprise >= 1.3 use the legacy sync script.
Install
npm install -g kong-portal-cliUsage
The easiest way to start is by cloning the portal-templates repo master branch locally.
Then edit workspaces/default/cli.conf.yaml to set kong_admin_url and kong_admin_token to match your setup.
Make sure Kong is running and portal is on:
Now from root folder of the templates repo you can run:
portal <command> <workspace>
Where <command> is one of:
configOutput or change configuration of the portal on the given workspace.deployDeploy changes made locally under the given workspace upstream.disableDisable the portal on the given workspace.enableEnable the portal on the given workspace.fetchFetches content and themes from the given workspace.initInitialize a local workspace with a default cli.conf.yaml configuration file.syncSync changes made locally under the given workspace upstream with the upstream workspace.wipeDeletes all content and themes from upstream workspace.
Where <workspace> indicates the directory/workspace pairing you would like to operate on.
For deploy
- Add
-Wor--watchto make changes reactive. - Add
-Por--preserveto avoid deleting files upstream that you do not have locally. - Add
-Dor--disable-ssl-verificationto disable SSL verification and use self-signed certs. - Add
-Ior--ignore-specsto ignore the '/specs' directory. - Add
-Sor--skip-pathto skip files or directories that match the given path. This option can be repeated.
For fetch
- Add
-Kor--keep-encodeto keep binary assets as base64 encoded strings locally. - Add
-Dor--disable-ssl-verificationto disable SSL verification and use self-signed certs. - Add
-Ior--ignore-specsto ignore the '/specs' directory.
For sync
- Add
-Wor--watchto make changes reactive. - Add
-Dor--disable-ssl-verificationto disable SSL verification and use self-signed certs. - Add
-Ior--ignore-specsto ignore the '/specs' directory. - Add
-Sor--skip-pathto skip files or directories that match the given path. This option can be repeated.
For wipe
- Add
-Dor--disable-ssl-verificationto disable SSL verification and use self-signed certs. - Add
-Ior--ignore-specsto ignore the '/specs' directory. - Add
-Sor--skip-pathto skip files or directories that match the given path. This option can be repeated.
For enable and disable
- Add
-Dor--disable-ssl-verificationto disable SSL verification and use self-signed certs.
Using cli.conf.yaml
In addition to kong_admin_uri and kong_admin_token, you can also add:
disable_ssl_verification: trueandignore_specs: truemax_content_length_mb- maximum size allowed to be transferred in Mb - default is 10 (10Mb)
Set the options in the CLI configuration file to always enable those settings on that Workspace instead of passing the option flags with every command.
Using Environment Variables
You can override some config values set in cli.conf.yaml via environment variables. For example, If you wanted to override the Kong Admin URL, you can run:
KONG_ADMIN_URL=http://new-admin-url.com portal deploy defaultEnvironment variables are useful for scripting as well as temporarily overriding particular settings.
Available environment variables include:
KONG_ADMIN_URLKong Admin URL the CLI should target for uploading files.KONG_ADMIN_TOKEN_FILEKong Admin Token token file path used to authenticate with the Kong Admin API, this will take precedence toKONG_ADMIN_TOKEN.KONG_ADMIN_TOKENKong Admin Token token used to authenticate with the Kong Admin API.
Contributing
For problems directly related to the CLI, add an issue on GitHub.
For other issues, submit a support ticket.