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.

Installing the CLI tool

Prism NPM version

Prismatic's CLI tool, prism, is available at https://www.npmjs.com/package/@prismatic-io/prism and can be installed using npm or yarn:

npm install -g @prismatic-io/prism
# OR
yarn global add @prismatic-io/prism

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.

To verify that you are logged in, run prism me to view information about your user.

prism me

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

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

prism me:token
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik5lVV9aYzFNdFRrSE93bXB1T2ZlUCJ9.eyJodHRwczovL3ByaXNtYXRpYy5pby9lbWFpbCI6InRlc3QudXNlckBlbWFpbC5jb20iLCJodHRwczovL3ByaXNtYXRpYy5pby9sYXN0X2xvZ2luIjoiMzAyMS0wMS0wMVQwMDowMDowMC4wMDFaIiwiaXNzIjoiaHR0cHM6Ly9wcmlzbWF0aWMtaW8udXMuYXV0aDAuY29tLyIsImF1ZCI6WyJodHRwczovL3ByaXNtYXRpYy5pby9hcGkiLCJodHRwczovL3ByaXNtYXRpYy1pby51cy5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNjEyMjA4NjQyLCJleHAiOjE2MTIyOTUwNDIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwgb2ZmbGluZV9hY2Nlc3MifQ.iKQWx95vUWTxF62O3-mZFqHPgfapH7TQjsy-BunqWWDJrhk88byJpJQYy__hJE779qAahkEtZD914zgpZ8UnjGW0i_PUcCf5nZsDJBR-jfTEARCLmeVYge3Hy40BAFzj3eCcCouDFqxMNaD3oeXSjfizO9Cy_P-XKEkDdIOJ-rk

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

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.

Running prism --help will also list top-level commands that you can execute.

$ prism --help

Build, deploy, and support integrations in Prismatic from the comfort of your command line

VERSION
@prismatic-io/prism/4.2.6 darwin-arm64 node-v14.17.6

USAGE
$ prism [COMMAND]

TOPICS
alerts Manage Alerting resources
authorization-methods List Authorization Methods that Components can use
components Manage, create, and publish Components
customers Manage Customers
executions Fetch results of Instance executions or Integration test runs
instances Manage Instances
integrations Manage and import Integrations
logs List Log Severities for use by Alert Triggers
me Print your user profile information
organization Manage your Organization

COMMANDS
help Display help for prism.
login Log in to your Prismatic account
logout Log out of your Prismatic account
me Print your user profile information

To view subcommands of top-level commands, run prism COMMAND --help. For example, to see customer management options, run:

$ prism customers --help

Manage Customers

USAGE
$ prism customers:COMMAND

TOPICS
customers:credentials Manage Customer Credentials
customers:users Manage Customer Users

COMMANDS
customers:create Create a new Customer
customers:delete Delete a Customer
customers:list List your Customers
customers:update Update a Customer

For a list of all required arguments for a command, run prism COMMAND:SUBCOMMAND --help. For example, to view the required arguments for creating a customer, run:

prism customers:create --help

Create a new Customer

USAGE
$ prism customers:create -n <value> [-d <value>]

FLAGS
-d, --description=<value> longer description of the customer
-n, --name=<value> (required) short name of the new customer

DESCRIPTION
Create a new Customer