Command Line Interface (CLI)
Licenses | COMMUNITY, ENTERPRISE, CORPORATE |
Since | VERSION 6.0 |
- 1 Introduction
- 2 Most important actions
- 2.1 pi command
- 2.2 pi delete
- 2.3 pi get
- 2.4 pi help
- 2.5 pi list
- 2.6 pi localrun deprecated
- 2.7 pi new
- 2.8 pi pipeline
- 2.9 pi publish
- 2.10 pi pull deprecated
- 2.11 pi push deprecated
- 2.12 pi setup
- 2.13 pi status
- 2.14 pi update
Introduction
The PI Command Line Interface (short “CLI” or “pi tool”) is a local command line tool which allows remote control PIPEFORCE from the command line.
It allows to execute commands and pipelines, store and read data to and from the server and helps to setup a local development environment quickly.
See the Downloads section on how to install this tool: Downloads
This tutorial Tutorial: Setup local workspace + CLI shows, how to install and work with the CLI.
We also recommend you to install Visual Studio Code since it works nicely together with the CLI.
Most important actions
The main structure of a CLI command is always like this:
pi <action> <args>
To get a list off all supported actions and their parameters use the help command:
pi help
Below you can find the description of the most important actions.
pi command
Executes a single pipeline command at server side and returns the result.
Each command parameter will become a command line parameter.
Example 1:
pi command log message=HELLO
This executes the log
command at server side with the parameter message
set to HELLO
.
Example 2:
This command sends an email.
Note
Use the command pi help command
to get the documentation of all available commands activated in your license.
Or use the command pi help command COMMAND_NAME
to get the documentation for a specific command.
pi delete
Deletes the remote resources inside a given app. It doesn’t delete any local resource.
Example 1:
Deletes the pipeline helloworld.
Example 2:
Deletes all resources of the app myapp
.
This command deletes remote resources without the option to recover. So be careful in using it!
pi get
Downloads all resources of a given app, stores them into the local workspace in order to be able to edit them. If a local resource already exists, asks for overwrite or skip.
Example 1:
This command line call downloads all resources of the app myapp
and its sub-folders and stores them into the local workspace folder src/global/app/myapp
. Note that you have to define the property key here, not the local file path.
Example 2:
This downloads only the resources inside the myapp
folder but no resource from inside its sub-folders.
Example 3:
This downloads a single resource by its key:
pi help
Lists all available CLI options or pipeline commands.
Example 1:
Lists all available command line options.
Example 2:
Lists the documentation of all available pipeline commands for the currently logged-in user.
Example 2:
Explains the log pipeline command. The output could look like this:
pi list
Lists all remote resources of a given path.
Example 1:
Lists all resources of the app myapp
recursively.
Example 2:
Lists all resources of the folder myapp
but not the resources inside any sub-folder.
pi localrun deprecated
Since version 6.0 this command has been deprecated. Please use pi pipeline
instead.
pi new
Creates a new resource based on a wizard.
Example 1:
Would print this wizard:
Example 2:
You can also directly start the resource wizard:
Example 3:
And if you are inside a app folder, the app you want to create the resource for is already pre-selected for you.
pi pipeline
Executes a locally stored pipeline file, a remote pipeline or a pipeline uri.
Example 1:
This example uploads the content of the helloworld.pi.yaml
to the server, executes it there and returns the result. It doesn't store the pipeline at server side.
Example 2:
This example takes the given pipeline uri and executes it at server side.
The syntax of a pipeline uri looks like this:
<command>[?<arg1>=<value1>&<arg2>=<value2>
]
It is also possible to combine multiple commands to form a pipeline using the pipe |
character:
<commandA>?<arg1>=<value1>&<arg2>=<value2>|<commandB>?<arg1>=<value1>&<arg2>=<value2>
Here is an example to re-write this YAML pipeline configuration:
To this pipeline uri format:
Therefore, a call of this pipeline uri would look like this:
Output:
The idea of a pipeline uri is to adhoc execute commands without the need to create a pipeline file and/or upload it.
pi publish
Uploads your created or changed resources like pipeline or form configurations to the server.
In case a resource already exists at the server updates only in case it has changed since last upload.
Example 1:
This command uploads / updates all resources inside the src
folder.
Example 2:
If you want to publish only a certain subset of the src folder, you can specify the folder like this:
This will recursively publish any resource inside this folder and its sub-folders.
Example 3:
In case you want to publish only the files inside this folder but not its sub-folders and files, you can use a single asterisk instead:
Example 4:
If you want to publish a single resource, define it by its filename:
Example 5:
Note that the path argument is always relatively to your current working dir, as long as you are inside the workspace home folder $USER_HOME/pipeforce:
This will publish all resources inside src/gobal/app/myapp
recursively.
For security reasons (for example to no accidentally publish a huge path structure of your file system to the server), publish is only possible in case your current working dir is inside the workspace folder.
pi pull deprecated
Since version 6.0 this command has been deprecated. Please use pi get
instead.
pi push deprecated
Since version 6.0 this command has been deprecated. Please use pi publish
instead.
pi setup
Changes the settings of the CLI tool using a wizard and/or installs the CLI if not already done.
This writes the final result into the file $USER_HOME/pipeforce/conf/cli.conf.json
.
Example 1:
Example 2:
For more advanced users, you can use the flag advanced in order to be able to adjust more settings:
pi status
Returns status information about the CLI.
Example:
pi update
Looks for an update of the CLI and installs it if a newer version exists.
Example: