Skip to main content

Prism CLI Tool

The Prismatic CLI tool allows you to interact with the Prismatic API programmatically so you can build, deploy, and support integrations from the command line. The CLI tool is built using the Prismatic API, so any action that can be completed through the web app or API can be completed through the CLI tool, as well.

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 a great example for how to wrap the Prismatic API.

Authenticating with the CLI Tool

Once prism has been installed login by typing:

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 you can run prism me to see information about your user.

prism me

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

If you want 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 instruct 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 instructions that are displayed. Instructions are different 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 of your customers, or prism integrations:create to create an integration. A full list of prism commands can be found on the Prismatic CLI Command Reference page.

Typing prism --help will also list top-level commands that you can run.

$ 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 see subcommands of top level commands, you can type prism COMMAND --help. For example, to see what you can do with customers 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 of a command, type prism COMMAND:SUBCOMMAND --help. For example, to see the required arguments to create 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