Skip to content
Kong Logo | Kong Docs Logo
search
  • We're Hiring!
  • Docs
    • Kong Gateway
    • Kong Konnect
    • Kong Mesh
    • Plugin Hub
    • decK
    • Kubernetes Ingress Controller
    • Insomnia
    • Kuma

    • Docs contribution guidelines
  • Plugin Hub
  • Support
  • Community
  • Kong Academy
Get a Demo Start Free Trial
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Plugin Hub
  • decK
  • Kubernetes Ingress Controller
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • 3.3.x (latest)
  • 3.2.x
  • 3.1.x
  • 3.0.x
  • 2.8.x
  • 2.7.x
  • 2.6.x
  • Older Enterprise versions (2.1-2.5)
  • Older OSS versions (2.1-2.5)
  • Archive (pre-2.1)

github-edit-pageEdit this page

report-issueReport an issue

enterprise-switcher-iconSwitch to OSS

On this pageOn this page
  • Install
  • Usage
Kong Gateway
3.1.x
  • Home
  • Kong Gateway
  • Kong Enterprise
  • Dev Portal
  • Dev Portal CLI
You are browsing documentation for an outdated version. See the latest documentation here.

Dev Portal CLI

The Kong Dev Portal CLI is used to manage your Dev Portals from the command line. It is built using clipanion.

This is the next generation TypeScript based Dev Portal CLI. The goal of this project is to make a higher quality CLI tool over the initial sync script.

Install

> npm install -g kong-portal-cli

Usage

The easiest way to start is by cloning the portal-templates repo master branch locally.

Next, edit workspaces/default/cli.conf.yaml to set the workspace kong_admin_url and kong_admin_token to match your setup.

You can also override the values set in workspaces/default/cli.conf.yaml by using the environment variables KONG_ADMIN_URL and KONG_ADMIN_TOKEN.

Make sure Kong is running and portal is on.

Now, from the root folder of the templates repo, you can run:

portal [-h,--help] [--config PATH] [-v,--verbose] <command> <workspace>

Where <command> is one of:

  • config Output or change configuration of the portal on the given workspace, locally.
  • 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.
  • wipe Deletes all content and themes from upstream workspace

Where <workspace> indicates the directory/workspace pairing you would like to operate on.

You can set environment variables to override the values in the workspaces/default/cli.conf.yaml file:

KONG_ADMIN_URL=<kong_admin_base_url> \
KONG_ADMIN_TOKEN=<kong_admin_token> \
portal [-h,--help] [--config PATH] [-v,--verbose] <command> <workspace>

Where <kong_admin_base_url> is the location of the Kong Admin API that manages the developer portal and <kong_admin_token> is an RBAC token that has access to manage the portal.

For deploy

  • Add -W or --watch to make changes reactive.
  • Add -P or --preserve to avoid deleting files upstream that you do not have locally.
  • Add -D or --disable-ssl-verification to disable SSL verification and use self-signed certs.
  • Add -I or --ignore-specs to ignore the /specs directory.

For fetch

  • Add -K or --keep-encode to keep binary assets as base64-encoded strings locally.
  • Add -D or --disable-ssl-verification to disable SSL verification and use self-signed certs.
  • Add -I or --ignore-specs to ignore the /specs directory.

For wipe

  • Add -D or --disable-ssl-verification to disable SSL verification and use self-signed certs.
  • Add -I or --ignore-specs to ignore the /specs directory.

For enable and disable

  • Add -D or --disable-ssl-verification to disable SSL verification and use self-signed certs.
Thank you for your feedback.
Was this page useful?
  • Kong
    THE CLOUD CONNECTIVITY COMPANY

    Kong powers reliable digital connections across APIs, hybrid and multi-cloud environments.

    • Company
    • Customers
    • Events
    • Investors
    • Careers Hiring!
    • Partners
    • Press
    • Contact
  • Products
    • Kong Konnect
    • Kong Gateway
    • Kong Mesh
    • Get Started
    • Pricing
  • Resources
    • eBooks
    • Webinars
    • Briefs
    • Blog
    • API Gateway
    • Microservices
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Solutions
    • Decentralize
    • Secure & Govern
    • Create a Dev Platform
    • API Gateway
    • Kubernetes
    • Service Mesh
Star
  • Terms•Privacy
© Kong Inc. 2023