Estimated reading time:
You are browsing documentation for an outdated version of Kong Enterprise. Go here
to browse the documentation for the latest version.
The Kong Developer Portal CLI is used to manage your Developer Portals from the
command line. It is built using clipanion.
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
For Kong Enterprise
<= 0.36, or for
legacy mode on Kong Enterprise
>= 1.3 use the legacy sync script.
> npm install -g kong-portal-cli
The easiest way to start is by cloning the portal-templates repo master branch locally.
workspaces/default/cli.conf.yaml to set
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>
<command> is one of:
config Output or change configuration of the portal on the given workspace.
deploy Deploy changes made locally under the given workspace upstream.
disable Disable the portal on the given workspace.
enable Enable the portal on the given workspace.
fetch Fetches content and themes from the given workspace.
serve Run the portal of a given workspace locally.
wipe Deletes all content and themes from upstream workspace.
<workspace> indicates the directory/workspace pairing you would like to operate on.
--watch to make changes reactive.
--preserve to avoid deleting files upstream that you do not have locally.
--keep-encode to keep binary assets as base64 encoded strings locally.
Using Environment Variables
You can override config values set in
cli.conf.yaml via environment variables. If you wanted to override the kong admin url for example, you can run:
KONG_ADMIN_URL=http://new-admin-url.com portal deploy default
Environment variables are useful for scripting as well as temporarily overriding particular settings.
Available environment variables include:
KONG_ADMIN_URL Kong Admin URL the CLI should target for uploading files.
KONG_ADMIN_TOKEN Kong Admin Token token used to authenticate with the Kong Admin API.