Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

The Jitterbit Command Line Interface (jbcli) is a command-line tool for interacting with Jitterbit recipes. Once logged in to Harmony through the jbcli, you can manage your own recipe repository by downloading, validating, uploading, updating, generating, deploying, or deleting recipe metadata and Jitterpaks. The sections on this page show how to install and use the jbcli.

Tip
TIP: Many administrative options provided through jbcli are now also available from within the Citizen Integrator web interface. See Citizen Integrator - My Recipes to learn more.

Installing Jitterbit Command Line Interface (jbcli)

  1. Download and install the Node.js JavaScript runtime environment v6.x or greater from nodejs.
  2. Enter the following into a command prompt in order to install jbcli from the Node.js Node Package Manager (NPM).

    Code Block
    npm install -g jbcli
  3. Use a command prompt to enter the commands as documented in the Using jbcli Commands section below. The general format for commands is as follows, with text between angle brackets being replaced by values, and text within square brackets being optional.

    Code Block
    jbcli <entity> <action> [options]
Anchorusing-jbcli-commandsusing-jbcli-commandsUsing jbcli Commands

To use jbcli, run these commands from a command prompt.

Anchorcheck-versioncheck-versionCheck Version

Use this command to check which version of jbcli you are running. The version number will be listed. The current jbcli version is 1.4.1.

Code Block
jbcli version
<version>
Anchorlog-inlog-inLog In

Use this command to log in to jbcli with your Harmony credentials, depending on whether your organization is associated with an NA, EMEA, or APAC region (see Finding My Region). A message will confirm successful authentication.

Code Block
titleNA
jbcli login --email <myHarmonyUsername> --password <myHarmonyPassword> --host https://citizen.jitterbit.net
User <myHarmonyUsername> authenticated successfully into https://citizen.jitterbit.net.
Code Block
titleEMEA
jbcli login --email <myHarmonyUsername> --password <myHarmonyPassword> --host https://citizen.jitterbit.eu
User <myHarmonyUsername> authenticated successfully into https://citizen.jitterbit.eu.
Code Block
titleAPAC
jbcli login --email <myHarmonyUsername> --password <myHarmonyPassword> --host https://citizen.jitterbit.cc
User <myHarmonyUsername> authenticated successfully into https://citizen.jitterbit.cc.
Anchorlog-outlog-outLog Out

Use this command to log out of jbcli. A message will confirm successful logout.

Code Block
jbcli logout
User <myHarmonyUsername> logged out.
Anchorlist-user-organizationslist-user-organizationsList User Organizations

Use this command to list the Organizations of which you are a member. The IDs and names of the organizations available to you will be listed.

Code Block
jbcli org list
[orgId1] orgName1
[orgId2] orgName2
...
Anchorlist-user-environmentslist-user-environmentsList User Environments

Use this command to list the Environments in the current organization. The IDs and names of the environments available to you will be listed.

Code Block
jbcli env list
[envId1] envName1
[envId2] envName2
...
Anchorget-propertiesget-propertiesGet Properties

Use this command to get the value assigned to a specific key. The key and value will be listed. 

Code Block
jbcli config get <key>
<key>: <assignment>

For example, this command can be used see which organization or environment is the default.

  • To see which organization is default, use the key defaultOrgId. The ID of the default organization will be listed.

    Code Block
    jbcli config get defaultOrgId
    defaultOrgId: orgId
  • To see which environment is default, use the key defaultEnvId. The ID of the default environment will be listed.

    Code Block
    jbcli config get defaultEnvId
    defaultEnvId: envId
Tip
TIP: Remember, if you want to see the name of the organization or environment the ID is associated with, you can use the commands in List User Organizations or List User Environments.
Anchorset-propertiesset-propertiesSet Properties

Use this command to set keys and values. The keys and values will be listed.

Code Block
jbcli config set <key1>=<assignment1> <key2>=<assignment2> ...
<key1>=<assignment1> set
<key2>=<assignment2> set
...

For example, this command can be used to override the default organization or environment. Note that the keys defaultOrgId and defaultEnvId are read-only and cannot be changed, as they are defined by a user's Jitterbit account. However, you can set the organization or environment via the commands below in order to override the defaultOrgId and defaultEnvId for the purpose of interacting with recipes through the jbcli.

  • To set an organization, use the key orgId with the ID for the desired organization obtained from List User Organizations. The set organization ID will be listed.

    Code Block
    jbcli config set orgId=<orgId>
    orgId:<orgId> set
  • To set an environment, use the key envId with the ID for the desired environment obtained from List User Environments. The set environment ID will be listed.

    Code Block
    jbcli config set envId=<envId>
    envId:<envId> set

If the organization and/or environment are not set via this command, the orgId and/or envId will default to the defaultOrgId and defaultEnvId.

Anchorlist-all-recipeslist-all-recipesList All Recipes

A recipe consists of two parts: A Jitterpak (.JPK) and the .JSON metadata that provides the steps a user will need to go through to configure the recipe via Citizen Integrator (see Citizen Integrator - Configure Recipe). 

Use this command to list all recipes that are available for you to use. Optionally, you can limit the list to only those recipes private to your organization (shown in brackets). The ID, name, and author for each recipe will be listed.

Code Block
jbcli recipe list [--private]
[id1] name1 by author1 (organization1)
[id2] name2 by author2 (organization2)
...

In the list of recipes that is returned, recipes that are public and available to all users will be preceded by an asterisk (*). Recipes that are private and available only to those within your organization will not have an asterisk.

Anchorget-a-specific-recipe-and-save-the-jitterpak-locallyget-a-specific-recipe-and-save-the-jitterpak-locallyGet a Specific Recipe and Save the Jitterpak Locally

Use this command to return the .JSON metadata for a specific recipe and optionally save the accompanying Jitterpak to a specified location (shown in brackets). 

Code Block
jbcli recipe get <id> [--savejpk <location>]
{<recipe>}
[Jitterpak saved to <location>.]
Tip
TIP: The specific Recipe ID can be found using the List All Recipes command above.

You may wish to save a recipe's accompanying Jitterpak locally if you want to reference a Jitterpak from an existing recipe or use it as a starting point. Or, if you have already started a recipe and Jitterpak but decide you want to perform advanced customization within Design Studio, just download the Jitterpak here.

If you wish to save the metadata for the recipe locally, you can copy it and save as a .JSON file. You may want to get and save a recipe's .JSON metadata locally if you are authoring a new recipe and want to start with a similar recipe as an example.

Anchorvalidate-a-recipevalidate-a-recipeValidate a Recipe

Use this command to validate .JSON metadata for a local recipe. You should perform this command prior to uploading a recipe to make sure it has valid code.

Code Block
jbcli recipe validate --recipe <recipeLocation>
Recipe is valid.
Anchorupload-a-new-recipe-and-jitterpakupload-a-new-recipe-and-jitterpakUpload a New Recipe and Jitterpak

Use this command to upload a new recipe. You can choose to upload a new Jitterpak and optionally the .JSON metadata (shown in brackets). You will need to have both a Jitterpak and .JSON metadata uploaded for a specific recipe, but do not need to upload them at the same time. By default, your uploaded recipe will be private to your organization. 

Code Block
jbcli recipe upload --jpk <jpkLocation> [--recipe <recipeLocation>]
Recipe uploaded, assigned ID <id>, and can be found at <location>
Anchorupdate-an-existing-recipe-and-jitterpakupdate-an-existing-recipe-and-jitterpakUpdate an Existing Recipe and Jitterpak

Use this command to update an existing recipe. You can choose to update the existing Jitterpak and optionally update the .JSON metadata (shown in brackets). You do not need to upload both the Jitterpak and the .JSON metadata every time – you only need to update the files that you have made changes to.

Code Block
jbcli recipe update <id> --jpk <jpkLocation> [--recipe <recipeLocation>]
Recipe with ID <id> updated.
Tip
TIP: The specific Recipe ID can be found using the List All Recipes command above.

Recipes provided by Jitterbit are available to the public are unable to be updated/edited. If you wish to edit an existing public recipe, you can get the .JSON and save the .JPK, then edit the files locally, and reupload them as your own using the other commands described on this page.

Anchordelete-an-existing-recipe-and-jitterpakdelete-an-existing-recipe-and-jitterpakDelete an Existing Recipe and Jitterpak

Use this command to delete an existing recipe that has not yet been deployed. To delete multiple recipes, add additional Recipe IDs separated by a space. Both the Jitterpak and the .JSON metadata will be deleted.

Code Block
jbcli recipe delete <id> [<id>] [<id>] [...]
Recipe with ID <id> [<id>] [<id>] [...] deleted.
Tip
TIP: The specific Recipe ID can be found using the List All Recipes command above.

Recipes provided by Jitterbit are available to the public are unable to be deleted. You can delete only those recipes that you have created. Or, if you are the administrator of an organization, you can also delete any recipes that belong to your organization.

Anchorgenerate-a-recipe-and-or-a-configure-filegenerate-a-recipe-and-or-a-configure-fileGenerate a Recipe and/or a Configure File

Use this command with a provided Jitterpak to generate the skeleton of a recipe, that you can then use as a recipe template.

The command results in two files being created, <project-name>-recipe.json and <project-name>-configure.json. To generate only one or the other of these files, add the appropriate option shown in brackets below.

Code Block
jbcli recipe generate --jpk <location> [--recipeonly | --cfgonly]
[Configure file saved to <location>.]
[Recipe saved to <location>.]

The recipe file is a template of a recipe that you can then open in a text editor in order to fill in fields such as description.

The configure file is a template of the file that the command used in Deploy a Recipe expects, which contains the actual values of the fields that are normally exposed within the Citizen Integrator web interface. Users are expected to fill in the configure file with values, and then use the Deploy a Recipe command to deploy the recipe.

Anchordeploy-a-recipedeploy-a-recipeDeploy a Recipe

Use this command to deploy a recipe. You must provide a recipe and configure file (see Generate a Recipe and/or a Configure File). The deployed Recipe ID will be listed.

Code Block
jbcli recipe deploy <ID> --cfg <location>
Recipe deployed, ID <id>.

Upon deploying a recipe, each action step of the recipe will be run, similar to the deployment process from the Citizen Integrator web interface.

Tip
TIP: The configure file can be generated as described in Generate a Recipe and/or a Configure File. The specific Recipe ID can be found using the List All Recipes command above.
Anchorlist-deployed-recipeslist-deployed-recipesList Deployed Recipes

Use this command to list deployed recipes. Optionally, you can show all deployed recipes or limit the list to a specific environment by ID (shown in brackets). The ID, name, and author for each deployed recipe will be listed.

Code Block
jbcli deployed-recipe list <--all | --environment <envID>>
[id1] name1 by author1
[id2] name2 by author2
...
Anchorundeploy-and-delete-a-deployed-recipeundeploy-and-delete-a-deployed-recipeUndeploy and Delete a Deployed Recipe

Use this command to undeploy and delete a deployed recipe. To undeploy and delete multiple recipes, add additional Recipe IDs separated by a space. Both the Jitterpak and the .JSON metadata will be deleted.

Code Block
jbcli deployed-recipe delete <id> [<id>] [<id>] [...]
Deployed recipe with ID <id> [<id>] [<id>] [...] deleted.
Tip
TIP: The specific Recipe ID can be found using the List All Recipes command above.

Recipes provided by Jitterbit are available to the public are unable to be deleted. You can delete only those recipes that you have created. Or, if you are the administrator of an organization, you can also delete any recipes that belong to your organization.

Panel
borderColor#65379B
titleColor#FFFFFF
titleBGColor#65379B
titleOn This Page
Table of Content Zone

Table of Contents
maxLevel3
minLevel2

Panel
borderColor#FF7C4C
titleColor#FFFFFF
titleBGColor#FF7C4C
titleRelated Articles
Panel
borderColor#00B886
titleColor#FFFFFF
titleBGColor#00B886
titleRelated Topics

HideElements
metastrue

Last updated: lastmodifieddate

Redirect
visiblefalse
locationhttps://developer.jitterbit.com/citizen-recipes/jitterbit-command-line-interface/

HideElements
metastrue