Skip to main content

Prism CLI Overview

The Prismatic CLI tool enables programmatic interaction with the Prismatic API, allowing you to build, deploy, and support integrations from the command line. The CLI tool is built on the Prismatic API, so any action that can be completed through the web application or API can also be completed through the CLI tool.

ReferencePrism CLI command reference

Look up every Prism command and its flags.

GuideBash scripting with Prism

Chain Prism commands in scripts and run Prism headlessly in CI/CD pipelines.

GuideTroubleshooting and FAQ

Fix common errors, including login problems in WSL and Prism commands that aren't found.

Installing the CLI tool​

Prism NPM version

Install the Prism CLI using npm or yarn:

npm install -g @prismatic-io/prism@11
# OR
yarn global add @prismatic-io/prism@11
Pin Prism to a major version in CI/CD

Pin Prism to a major version so your pipelines aren't impacted by breaking changes upon release. The @11 in these commands allows minor updates and bug fixes within version 11 without automatically installing new major versions. Installing with @latest or without a version allows major upgrades.

Prism's source code is available on GitHub and serves as an excellent example of how to wrap the Prismatic API.

Authenticating with the CLI tool​

Once prism has been installed, log in by running:

prism login

This will open a web browser for you to authenticate with your Prismatic credentials. Once you authenticate, your CLI tool will store an authentication token for subsequent prism commands.

If your user is associated with multiple tenants in a single region, you will be prompted to select which tenant to use for your CLI session. You can switch between tenants within a region by running prism login switch.

To verify that you are logged in, run prism me to view information about your account and active profile.

prism me

Name: Alex Cooper
Email: alexander.cooper@progix.io
Organization: Progix Software
Endpoint URL: https://app.prismatic.io
Profile: default

To view the authentication token that your CLI tool uses, run prism me token.

To clear your token from memory and log out, run prism logout.

Authentication profiles​

Profiles let you stay logged in to multiple Prismatic stacks or tenants. Each profile stores its endpoint, tenant, and credentials. Prism uses the default profile unless you select another one.

# Create or update a named profile
PRISMATIC_URL=https://app.eu-west-1.prismatic.io prism login --profile eu

# Use a profile for one command
prism integrations list --profile eu

# Use a profile for the current shell
export PRISM_PROFILE=eu

# Change the default profile
prism profiles use eu

Run prism profiles list to view saved profiles and prism profiles delete <name> to delete one. The --profile flag takes precedence over PRISM_PROFILE and the saved default.

PRISM_ACCESS_TOKEN and PRISM_REFRESH_TOKEN take precedence over saved profile credentials. When you use environment credentials, Prism also reads the endpoint and tenant from PRISMATIC_URL and PRISMATIC_TENANT_ID rather than from the selected profile.

Logging in to other regions

By default, your data is stored in the US commercial region and prism authenticates against that region. If your plan includes additional regions or private cloud, you will need to configure prism to point to that region. See Integrations in Multiple Regions.

Autocomplete in Prism​

Enable autocomplete in prism by running prism autocomplete and then follow the displayed instructions. Instructions differ depending on which shell you use (bash, zsh, etc.).

Running CLI commands and getting help​

All Prismatic CLI commands generally follow the form prism COMMAND. For example, you can run prism customers list to list all customers, or prism integrations create to create an integration. A complete list of prism commands can be found on the Prismatic CLI Command Reference page.

You can also get help from prism itself:

  • prism --help lists top-level topics and commands.
  • prism COMMAND --help lists the subcommands of a topic. For example, prism customers --help lists the commands for managing customers.
  • prism COMMAND SUBCOMMAND --help lists a command's flags, including which ones are required. For example, run prism customers create --help to see the flags for creating a customer.