Setup Content Publisher CLI
This guide walks you through setting up Content Publisher CLI (PCC) command line interface for the first time
The instructions below will guide developers through the commands to install and connect Pantheon Content Publisher to a site.
Before proceeding, please ensure you have a NextJS-ready development environment available:
Skip this step if you already have Node and NPM installed in your dev environment.
To run the Content Publisher CLI, you’ll need Node and NPM.
Download the latest version of Node.JS for your OS:
- Go to https://nodejs.org/en/download/package-manager and follow the instructions there (we recommend running each command individually vs the full command at once).
- Install Node.js - for this field select the latest version with LTS.
- OS - Select the operating system (OS) where you will be installing Node.JS.
- Using - We recommend using NVM, although select the package manager that you are comfortable with.
Now that you have Node and NPM installed, the first step to implementing Pantheon Content Publisher is installing the Content Publisher CLI (pcc). Run the following command to download and install the CLI.
npm add @pantheon-systems/pcc-cli --global
Note that we currently require Node v.18x to install. Please let us know if your team requires a lower Node version ([email protected]).
Setup
To login to the CLI, run:
pcc login
You will need a Google account to login. This command will open a tab in your web browser where you can either select an already logged-in Google account or login to a new one.
Once logged in, you can use all the CLI features. Use the help command to explore capabilities and check exact syntax:
% pcc --help
pcc <cmd>
Commands:
pcc version Prints the version of this CLI
pcc init <project_directory> [options] Sets up project with required files.
pcc token <cmd> [options] Manage tokens for a PCC project.
pcc config <cmd> [options] Manage configuration for this CLI.
pcc site <cmd> [options] Manage sites for a PCC project.
pcc document <cmd> [options] Manage documents for a PCC Project.
pcc import Imports posts from a Drupal JSON API endpoint into PCC
pcc whoami Print information about yourself.
pcc login Logs you in you to PCC client.
pcc logout Logs you out you from PCC client.