Command Line Options for Packaging Tool

This page explains the Packaging tool command line options. To see the full list of options, run pfxpackage without arguments. The options are specified in the command line using either -option=value or -option value1 value2 syntax.

Communication with Server

Security

  • User credentials are specified with -user USER and -password PASSWORD options. You have to enter the password if the password option is not supplied.

  • When two factor authentication is required by the server, supply either a 6-digit verification code using -twoFactorVerificationCode option or a user secret token with -twoFactorSecretToken option.

  • Add -insecure option to skip the server certificate verification.

  • When you want to fetch/deploy objects from/to PlatformManager (Event Orchestration, Event Orchestration Scheduler), you need to set -platformToken USERNAME:TOKEN option. The token can be generated in PlatformManager > Account > Account API Token section; USERNAME is taken from the Username column (for example 3354_technical_user).

Package Selection and Filtering

  • Add several -include=<part> options to process (export or import) only specific package parts.

  • Add several -exclude=<part> options to exclude specified parts during processing.

  • You can list available parts by running the tool with the -listParts argument.

  • When no -include or -exclude options are present, all parts are processed.

  • Add -filter=FILTERSPEC option to process only items that match the FILTERSPEC expression.  It consists of:

    • Constants: "double-quoted-string", number (starts with +-0123456789), true, false, null.

    • Path Expression extracts value from the processed item (JSON node), such as .uniqueName. 

      • Dots are used to describe a path to a specific value in item's tree representation. It always has to start with a dot. 

    • Binary operator combines constants and other expressions : ==, != ~= and or.

    • Parentheses and white spaces separate expressions from operators. Parentheses are required to combine binary operators.

  • A FILTERSPEC expression matches the process item if it evaluates anything that is not: false, "false", "", null.

    • To filter items with a specific a specific status value: -filter .status=="ACTIVE"

    • To filter items that are draft: -filter .draft=true

    • To filter items, in which formulaNature is not "library":  -filter .formulaNature!="library"

    • To filter items, in which status is not "INACTIVE" and uniqueName (when ignoring character case) does not end with test: -filter (.uniqueName~="(?i).*test")and(.status!="INACTIVE")

  • To include also Company Parameters data (CSV files) during import or export, add -withData option.

  • All files with names that start with a dot are ignored during import, unless -includeDotFiles option is present.

Package Content

  • Package is supplied either as a directory or as a ZIP file (file name with a .zip extension).

  • When import is run,  the -from PACKAGE option is required.

  • When export is run,  the -to PACKAGE option is required.

  • You cannot export to an existing package, unless you add the -additive option. New files and directories are added, existing files are overwritten.

  • You can overwrite an existing package ZIP file if you add the -overwrite option, it deletes the ZIP file before running export.

  • When importing users, you can add the password property to user's JSON file in order to set up the user password. Passwords are never exported.

Logging and Troubleshooting

  • When using the filter option from the command line, double quotes might get consumed by shell/cmd. You have to escape them, for example:

    • Windows (cmd): -filter .status=="""ACTIVE"""

    • Mac/Unix (bash): -filter .status==\"ACTIVE\"

    • Mac/Unix (bash): -filter '.status=="ACTIVE"'

  • The -version option prints out a full version specification, a newer version might fix this.

  • To log HTTP communication to the console, add the  -httpDebug option.

  • To record communication with the server, add  -httpRecordTo=filename.zip or -httpRecordTo=directory. The created ZIP file or directory can be then passed for further analysis. It is especially handy when troubleshooting data-driven issues.

Found an issue in documentation? Write to us.

Â