Prismatic CLI Usage
#
CLI Tool OverviewThe 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 ToolPrismatic's CLI tool, prism
, is available at https://www.npmjs.com/package/@prismatic-io/prism and can be installed using npm
or yarn
:
#
Authenticating with the CLI ToolOnce prism
has been installed login by typing:
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.
If you want 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
.
#
Running CLI Commands and Getting HelpAll 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.
To see subcommands of top level commands, you can type prism COMMAND --help
.
For example, to see what you can do with customers run
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
#
Listing ResourcesAll types of prismatic resources (customers, components, integrations, instances, actions, etc.) have :list
subcommands.
By default, list commands show basic information about the resource, like name and description, but additional information like resource ID can be displayed.
You can optionally select exactly what attributes of resources you want to list, you can filter the results, and you can format the results as CSV, JSON, or YAML.
#
Listing Resource IDsAll Prismatic resources have unique IDs.
IDs are not displayed by default through list
subcommands, but can optionally be displayed with the --extended
flag.
For example, to see IDs for components, run
#
Configuring Columns of a List to DisplayYou can optionally choose which attributes of a resource to display using the --columns
flag.
For example, to get the Key, Label, and ID of all components, you can run
#
Filtering List OutputYou can filter the output that a :list
subcommand displays using a --filter
flag.
For example, to only show the component with the key "aws-s3", run
In a bash script, you can combine the --filter
flag with the --columns
and --no-header
flags to get the ID of a specific resource
#
Formatting List OutputLists can be optionally formatted as CSV, JSON, or YAML using the --output
flag.
This flag can be combined with the --columns FORMAT
and --filter
flag, as well.
For example, if you want id and key of all components in CSV format, run
#
Using the Prismatic CLI in Bash ScriptsMultiple prism
commands can be strung together to manage prismatic resources.
For example, to create an instance of an integration you need to know the ID of the integration, and the ID of the customer you want to deploy an instance to.
You can use customers:list
, integrations:list
and instances:create
commands together to create a new instance.