{"id":27012037,"url":"https://github.com/salesforcecommercecloud/sfcc-ci","last_synced_at":"2025-05-14T22:08:20.615Z","repository":{"id":38388905,"uuid":"138774245","full_name":"SalesforceCommerceCloud/sfcc-ci","owner":"SalesforceCommerceCloud","description":"Salesforce Commerce Cloud CLI","archived":false,"fork":false,"pushed_at":"2025-02-09T04:33:33.000Z","size":1403,"stargazers_count":239,"open_issues_count":98,"forks_count":100,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-05-12T19:49:14.814Z","etag":null,"topics":["ccdx","cli","commercecloud","salesforce","salesforce-developers","salesforcedx"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/sfcc-ci","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SalesforceCommerceCloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-06-26T17:57:16.000Z","updated_at":"2025-04-17T13:17:59.000Z","dependencies_parsed_at":"2024-02-02T09:28:26.653Z","dependency_job_id":"89537438-10f4-4f3a-97a3-70e54e7bce62","html_url":"https://github.com/SalesforceCommerceCloud/sfcc-ci","commit_stats":{"total_commits":685,"total_committers":36,"mean_commits":19.02777777777778,"dds":0.3386861313868613,"last_synced_commit":"fc7f1423fbfd027031c06116a50d5f102a37301f"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalesforceCommerceCloud%2Fsfcc-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalesforceCommerceCloud%2Fsfcc-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalesforceCommerceCloud%2Fsfcc-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalesforceCommerceCloud%2Fsfcc-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SalesforceCommerceCloud","download_url":"https://codeload.github.com/SalesforceCommerceCloud/sfcc-ci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235700,"owners_count":22036964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ccdx","cli","commercecloud","salesforce","salesforce-developers","salesforcedx"],"created_at":"2025-04-04T11:47:38.029Z","updated_at":"2025-05-14T22:08:15.593Z","avatar_url":"https://github.com/SalesforceCommerceCloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Salesforce Commerce Cloud CLI #\n\nThe Salesforce Commerce Cloud CLI is a command line interface (CLI) for Salesforce Commerce Cloud. It can be used to facilitate deployment and continuous integration practices using Salesforce B2C Commerce.\n\nThe CLI can be used from any machine either locally or from build tools, like Jenkins, Travis CI, Bitbucket Pipelines, Heroku CI etc.\n\nIn addition to the CLI a basic JavaScript API is included which can be used to integrate with higher level applications on Node.js.\n\n# License #\n\nAs of version 2.3.0 this project is released under the BSD-3-Clause license. For full license text, see the [LICENSE](LICENSE.txt) file in the repo root or https://opensource.org/licenses/BSD-3-Clause.\n\n# Contributing #\n\nTo contribute to this project, follow the [Contribution Guidelines](CONTRIBUTING.md). All external contributors must sign the [Contributor License Agreement (CLA)](https://cla.salesforce.com/sign-cla).\n\n# How to get further support? #\n\nFeel free to create issues and enhancement requests or browse and discuss existing ones at https://github.com/SalesforceCommerceCloud/sfcc-ci/issues, this will help us understanding in which area the biggest need is. Please refer to documentation below before doing so. If you need help, advice, discuss something, start a thread in our community at https://sfcc-unofficial.slack.com/ in channel #sfcc-ci ([request an invitation here](https://docs.google.com/forms/d/e/1FAIpQLSdy875PlJuib35naCkr3-Frn2qtaSuuRgYezRSb2uBYkhXt7g/viewform)).\n\n* Maintainer: @tobiaslohr\n\n# What is this repository for? #\n\nThe focus of the tool is to streamline and easy the communication with Commerce Cloud instances as part of the CI/CD processes. It focuses on the deployment part supporting quality checks such as test execution, not on the quality checks itself.\n\n**Features:**\n\n* Interactive and headless authentication against Account Manager\n* Support for B2C On-Demand Developer Sandboxes\n* Uses Open Commerce APIs completely\n* Authentication using Oauth2\n* Configuration of multiple instances incl. aliasing\n* WebDAV connectivity\n* Code deployment and code version management\n* System job execution and monitoring (site import)\n* Custom job execution and monitoring\n* Add cartridges to site cartridge path\n* Exploring Account Manager orgs and management of users and roles\n* JavaScript API\n\n# How do I get set up? #\n\n## Prerequisites ##\n\n### Configure an API key ###\n\nEnsure you have a valid Commerce Cloud API key (client ID) set up. If you don't have a API key, you can create one using the [Account Manager](https://account.demandware.com). Management of API keys is done in _Account Manager \u003e API Client_ and requires _Account Administrator_ or _API Administrator_ role.\n\nFor automation (e.g. a build server integration) you'll need the API key as well as the API secret for authentication. If you want to use authentication in interactive mode, you have to set _Redirect URIs_ to `http://localhost:8080`. If you want to manage sandboxes you have to set _Default Scopes_ to `roles tenantFilter profile`.\n\n### SLAS Prerequisites ###\nIn order to use your API key with SLAS, please ensure the following are configured for your client:\n\n1. Has `Roles` \u003e `Commerce Cloud Developer Experience` \u003e `Sandbox API User` with \"All Sandboxes\" scope.\u003cbr/\u003e\n  ![Account Manager Client ID](docs/images/client-api-user.png)\n2. Set _Default Scopes_ to:\n```txt\nmail\nroles\ntenantFilter\nprofile\nopenId\n```\n3. Set \"Token Endpoint Auth Method\" to `client_secret_post`\n4. Set \"Access Token Format\" to `JWT`\n    \n### Grant your API key access to your instances ###\n\nIn order to perform CLI commands, you have to permit API calls to the Commerce Cloud instance(s) you wish to integrate with. You do that by modifying the Open Commerce API Settings as well as the WebDAV Client Permissions on the Commerce Cloud instance.\n\n1. Log into the Business Manager\n2. Navigate to _Administration \u003e Site Development \u003e Open Commerce API Settings_\n3. Make sure, that you select _Data API_ and _Global_ from the select boxes\n4. Add the permission set for your client ID to the settings.\n\nUse the following snippet as your client's permission set, replace `my_client_id` with your own client ID. Note, if you already have Open Commerce API Settings configured on your instance, e.g. for other API keys, you have to merge this permission set into the existing list of permission sets for the other clients.\n```JSON\n    {\n      \"_v\": \"19.5\",\n      \"clients\":\n      [\n        {\n          \"client_id\": \"my_client_id\",\n          \"resources\":\n          [\n            {\n              \"resource_id\": \"/code_versions\",\n              \"methods\": [\"get\"],\n              \"read_attributes\": \"(**)\",\n              \"write_attributes\": \"(**)\"\n            },\n            {\n              \"resource_id\": \"/code_versions/*\",\n              \"methods\": [\"patch\", \"delete\"],\n              \"read_attributes\": \"(**)\",\n              \"write_attributes\": \"(**)\"\n            },\n            {\n              \"resource_id\": \"/jobs/*/executions\",\n              \"methods\": [\"post\"],\n              \"read_attributes\": \"(**)\",\n              \"write_attributes\": \"(**)\"\n            },\n            {\n              \"resource_id\": \"/jobs/*/executions/*\",\n              \"methods\": [\"get\"],\n              \"read_attributes\": \"(**)\",\n              \"write_attributes\": \"(**)\"\n            },\n            { \n              \"resource_id\": \"/sites/*/cartridges\", \n              \"methods\": [\"post\"], \n              \"read_attributes\": \"(**)\", \n              \"write_attributes\": \"(**)\"\n            },\n            {\n              \"resource_id\":\"/role_search\",\n              \"methods\":[\"post\"],\n              \"read_attributes\":\"(**)\",\n              \"write_attributes\":\"(**)\"\n            },\n            {\n              \"resource_id\":\"/roles/*\",\n              \"methods\":[\"get\"],\n              \"read_attributes\":\"(**)\",\n              \"write_attributes\":\"(**)\"\n            },\n            {\n              \"resource_id\":\"/roles/*/user_search\",\n              \"methods\":[\"post\"],\n              \"read_attributes\":\"(**)\",\n              \"write_attributes\":\"(**)\"\n            },\n            {\n              \"resource_id\":\"/roles/*/users/*\",\n              \"methods\":[\"put\",\"delete\"],\n              \"read_attributes\":\"(**)\",\n              \"write_attributes\":\"(**)\"\n            },\n            {\n              \"resource_id\":\"/user_search\",\n              \"methods\":[\"post\"],\n              \"read_attributes\":\"(**)\",\n              \"write_attributes\":\"(**)\"\n            },\n            {\n              \"resource_id\":\"/users\",\n              \"methods\":[\"get\"],\n              \"read_attributes\":\"(**)\",\n              \"write_attributes\":\"(**)\"\n            },\n            {\n              \"resource_id\":\"/users/*\",\n              \"methods\":[\"put\",\"get\",\"patch\",\"delete\"],\n              \"read_attributes\":\"(**)\",\n              \"write_attributes\":\"(**)\"\n            }\n          ]\n        }\n      ]\n    }\n```\n\n5. Navigate to _Administration \u003e Organization \u003e WebDAV Client Permissions_\n6. Add the permission set for your client ID to the permission settings.\n\nUse the following snippet as your client's permission set, replace `my_client_id` with your client ID. Note, if you already have WebDAV Client Permissions configured, e.g. for other API keys, you have to merge this permission set into the existing list of permission sets for the other clients.\n```JSON\n    {\n      \"clients\":\n      [\n        {\n          \"client_id\": \"my_client_id\",\n          \"permissions\":\n          [\n            {\n              \"path\": \"/impex\",\n              \"operations\": [\n                \"read_write\"\n              ]\n            },\n            {\n              \"path\": \"/cartridges\",\n              \"operations\": [\n                \"read_write\"\n              ]\n            },\n            {\n              \"path\": \"/static\",\n              \"operations\": [\n                \"read_write\"\n              ]\n            },\n            {\n              \"path\": \"/catalogs/\u003cyour-catalog-id\u003e\",\n              \"operations\": [\n                \"read_write\"\n              ]\n            },\n            {\n              \"path\": \"/libraries/\u003cyour-library-id\u003e\",\n              \"operations\": [\n                \"read_write\"\n              ]\n            },\n            {\n              \"path\": \"/dynamic/\u003cyour-site-id\u003e\",\n              \"operations\": [\n                \"read_write\"\n              ]\n            }\n          ]\n        }\n      ]\n    }\n```\n\n## Dependencies ##\n\nIf you plan to integrate with the JavaScript API or if you want to download the sources and use the CLI through Node you need Node.js and npm to be installed. No other dependencies.\n\nPlease check [this guide](https://docs.npmjs.com/files/package.json#git-urls-as-dependencies) on how to define dependency to the right version using a GIT url.\n\nIf do not want to use the JavaScript API, but just the CLI you don't need Node.js and npm necessarily. See \"Installation Instructions\" for details below.\n\n## Installation Instructions ##\n\nYou can install the CLI from `npm`, using a pre-built binary or from source using Node.js.\n\n### Install from `npm` ###\n\nIf you already have [Node.js](https://nodejs.org/en/download/) installed, you can install globally using `npm` or run using [`npx`](https://docs.npmjs.com/cli/v7/commands/npx):\n\n```sh\nnpm install -g sfcc-ci\n\n# Or alternatively, using npx:\nnpx sfcc-ci\n```\n\n### Install Prebuilt Binary ###\n\nIf you are using the CLI but don't want to mess around with Node.js you can simply download the latest binaries for your OS at [Releases](https://github.com/SalesforceCommerceCloud/sfcc-ci/releases/latest). The assets with each release contain binaries for MacOS, Linux and Windows.\n\n#### MacOS ####\n\n1. Download the binary for MacOS.\n\n2. Make the binary executable:\n\n        chmod +x ./sfcc-ci-macos\n\n3. Move the binary in to your PATH:\n\n        sudo mv ./sfcc-ci-macos /usr/local/bin/sfcc-ci\n\n### Linux ###\n\n1. Download the binary for Linux.\n\n2. Make the binary executable:\n\n        chmod +x ./sfcc-ci-linux\n\n3. Move the binary in to your PATH:\n\n        sudo mv ./sfcc-ci-linux /usr/local/bin/sfcc-ci\n\n### Windows ###\n\n1. Download the binary for Windows.\n\n2. Add the binary in to your PATH:\n\n        set PATH=%PATH%;C:\\path\\to\\binary\n\nYou are now ready to use the tool by running the main command `sfcc-ci`.\n\n### Building from Source using Node.js ###\n\n* Make sure Node.js and npm are installed.\n* Clone or download the sources.\n* * If you choose to clone, it best done through ssh along with an ssh key which you have to create with your Github account.\n* * If you choose to download the latest sources, you can do so from [Releases](https://github.com/SalesforceCommerceCloud/sfcc-ci/releases/latest), after which you have to unzip the archive.\n* `cd` into the directory and run `npm install`. You may choose to install globally, by running `npm install -g` instead.\n* Check if installation was successful by running `sfcc-ci --help`. In case you encouter any issues with running `sfcc-ci`, you may run `npm link` to create a symbolic link explicitly. The symbolic link enables you to run `sfcc-ci` from any location on your machine.\n\n# Using the Command Line Interface #\n\n## Commands ##\n\nUse `sfcc-ci --help` or just `sfcc-ci` to get started and see the full list of commands available:\n\n```bash\n  Usage: cli [options] [command]\n\n  Options:\n    -V, --version                                                   output the version number\n    -D, --debug                                                     enable verbose output\n    --selfsigned                                                    allow connection to hosts using self-signed certificates\n    -I, --ignorewarnings                                            ignore any warnings logged to the console\n    -h, --help                                                      output usage information\n\n  Commands:\n    auth:login [options] [client] [secret]                          Authenticate a present user for interactive use\n    auth:logout                                                     End the current sessions and clears the authentication\n    client:auth [options] [client] [secret] [user] [user_password]  Authenticate an API client with an optional user for automation use\n    client:auth:renew                                               Renews the client authentication. Requires the initial client authentication to be run with the --renew option.\n    client:auth:token                                               Return the current authentication token\n    client:list [options]                                           Lists a Oauth clients you have access to\n    client:create [options]                                         Creates a new Oauth client\n    client:update [options]                                         Update an Oauth client\n    client:rotate [options]                                         Rotate credentials of an Oauth client\n    client:delete [options]                                         Delete an Oauth client\n    data:upload [options]                                           Uploads a file onto a Commerce Cloud instance\n    sandbox:realm:list [options]                                    List realms eligible to manage sandboxes for\n    sandbox:realm:update [options]                                  Update realm settings\n    sandbox:list [options]                                          List all available sandboxes\n    sandbox:ips [options]                                           List inbound and outbound IP addresses for sandboxes\n    sandbox:create [options]                                        Create a new sandbox\n    sandbox:get [options]                                           Get detailed information about a sandbox\n    sandbox:update [options]                                        Update a sandbox\n    sandbox:start [options]                                         Start a sandbox\n    sandbox:stop [options]                                          Stop a sandbox\n    sandbox:restart [options]                                       Restart a sandbox\n    sandbox:reset [options]                                         Reset a sandbox\n    sandbox:delete [options]                                        Delete a sandbox\n    sandbox:alias:add [options]                                     Registers a hostname alias for a sandbox.\n    sandbox:alias:list [options]                                    Lists all hostname aliases, which are registered for the given sandbox.\n    sandbox:alias:delete [options]                                  Removes a sandbox alias by its ID\n    instance:add [options] \u003cinstance\u003e [alias]                       Adds a new Commerce Cloud instance to the list of configured instances\n    instance:set \u003calias_or_host\u003e                                    Sets a Commerce Cloud instance as the default instance\n    instance:clear                                                  Clears all configured Commerce Cloud instances\n    instance:list [options]                                         List instance and client details currently configured\n    instance:upload [options] \u003carchive\u003e                             Uploads an instance import file onto a Commerce Cloud instance\n    instance:import [options] \u003carchive\u003e                             Perform a instance import (aka site import) on a Commerce Cloud instance\n    instance:export [options]                                       Run an instance export\n    code:list [options]                                             List all custom code versions deployed on the Commerce Cloud instance\n    code:deploy [options] \u003carchive\u003e                                 Deploys a custom code archive onto a Commerce Cloud instance\n    code:activate [options] \u003cversion\u003e                               Activate the custom code version on a Commerce Cloud instance\n    code:delete [options]                                           Delete a custom code version\n    code:manifest:generate [options] \u003clocaldirectorypaths\u003e          Generates the manifest file based on the given local directories.\n    code:compare [options] \u003clocaldirectorypaths\u003e                    Compare the given local directories with the given code version (or the active one if none specified) of the Commerce Cloud instance and provide a diff between the two.\n    code:deploy:diff [options] \u003ccodeversion\u003e \u003clocaldirectorypaths\u003e  Generate a manifest for the given local directories. Compare this manifest with the one within the active code version of the instance. Deploy only the files which have been updated locally comparing to the remote, within a newly created code version.Activate this newly generated code version if required in the options\n    job:run [options] \u003cjob_id\u003e [job_parameters...]                  Starts a job execution on a Commerce Cloud instance\n    job:status [options] \u003cjob_id\u003e \u003cjob_execution_id\u003e                Get the status of a job execution on a Commerce Cloud instance\n    cartridge:add [options] \u003ccartridgename\u003e                         Adds a cartridge-name to the site cartridge path\n    org:list [options]                                              List all orgs eligible to manage\n    role:list [options]                                             List roles\n    role:grant [options]                                            Grant a role to a user\n    role:revoke [options]                                           Revoke a role from a user\n    user:list [options]                                             List users eligible to manage\n    user:create [options]                                           Create a new user\n    user:update [options]                                           Update a user\n    user:delete [options]                                           Delete a user\n    user:reset [options]                                            Reset a user\n    slas:tenant:list [options]                                      Lists all tenants that belong to a given organization\n    slas:tenant:add [options]                                       Adds a SLAS tenant to a given organization or updates an existing one\n    slas:tenant:get [options]                                       Gets a SLAS tenant from a given organization\n    slas:tenant:delete [options]                                    Deletes a SLAS tenant from a given organization\n    slas:client:add [options]                                       Adds a SLAS client to a given tenant or updates an existing one\n    slas:client:get [options]                                       Gets a SLAS client from a given tenant\n    slas:client:list [options]                                      Lists all SLAS clients that belong to a given tenant\n    slas:client:delete [options]                                    Deletes a SLAS client from a given tenant\n\n    Environment:\n\n      $SFCC_LOGIN_URL                    set login url used for authentication\n      $SFCC_OAUTH_LOCAL_PORT             set Oauth local port for authentication flow\n      $SFCC_OAUTH_CLIENT_ID              client id used for authentication\n      $SFCC_OAUTH_CLIENT_SECRET          client secret used for authentication\n      $SFCC_OAUTH_USER_NAME              user name used for authentication\n      $SFCC_OAUTH_USER_PASSWORD          user password used for authentication\n      $SFCC_SANDBOX_API_HOST             set sandbox API host\n      $SFCC_SANDBOX_API_POLLING_TIMEOUT  set timeout for sandbox polling in minutes\n      $SFCC_SCAPI_SHORTCODE              the Salesforce Commerce (Headless) API Shortcode\n      $SFCC_SCAPI_TENANTID               the Salesforce Commerce (Headless) API TenantId\n      $DEBUG                             enable verbose output\n\n    Detailed Help:\n\n      Use sfcc-ci \u003csub:command\u003e --help to get detailed help and example usage of sub:commands\n\n    Useful Resources:\n\n      Salesforce Commerce Cloud CLI Release Notes: https://sfdc.co/sfcc-cli-releasenotes\n      Salesforce Commerce Cloud CLI Readme: https://sfdc.co/sfcc-cli-readme\n      Salesforce Commerce Cloud CLI Cheatsheet: https://sfdc.co/sfcc-cli-cheatsheet\n      Salesforce Commerce Cloud Account Manager: https://account.demandware.com\n      Salesforce Commerce Cloud API Explorer: https://api-explorer.commercecloud.salesforce.com\n      Salesforce Commerce Cloud Documentation: https://documentation.b2c.commercecloud.salesforce.com\n```\n\nUse `sfcc-ci \u003csub:command\u003e --help` to get detailed help and example usage of a sub:command.\n\n## Configuration ##\n\nThe CLI keeps it's own settings. The location of these settings are OS specific. On Linux they are located at `$HOME/.config/sfcc-ci-nodejs/`, on MacOS they are located at `$HOME/Library/Preferences/sfcc-ci-nodejs/`.\n\nIn addition the CLI can be configured by placing a `dw.json` file into the current working directory. The `dw.json` may carry details used run authentication.\n\n```json\n{\n    \"client-id\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n    \"client-secret\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n    \"username\": \"user\",\n    \"password\": \"password\",\n    \"hostname\": \"\u003cdev-sandbox\u003e.demandware.net\"\n}\n```\n\n## Environment Variables ##\n\nThe use of environment variables is optional. `sfcc-ci` respects the following environment variables which you can use to control, how the CLI works:\n\n* `SFCC_LOGIN_URL` set login url used for authentication\n* `SFCC_OAUTH_LOCAL_PORT` set Oauth local port for authentication flow\n* `SFCC_OAUTH_CLIENT_ID` client id used for authentication\n* `SFCC_OAUTH_CLIENT_SECRET` client secret used for authentication\n* `SFCC_OAUTH_USER_NAME` user name used for authentication\n* `SFCC_OAUTH_USER_PASSWORD` user password used for authentication\n* `SFCC_SANDBOX_API_HOST` set alternative sandbox API host\n* `SFCC_SANDBOX_API_POLLING_TIMEOUT` set timeout for sandbox polling in minutes\n* `DEBUG` enable verbose output\n\nIf you only want a single CLI command to write debug messages prepend the command using, e.g. `DEBUG=* sfcc-ci \u003csub:command\u003e`.\n\n## Parameter Precedence ##\n\nThe parameters are used with the following precedence:\n\n1. Passing explicit params to the commandline (e.g `sfcc-ci client:auth client_id client_secret`)\n2. Credentials in a `dw.json`\n3. Creating an `.env` file \n4. Setting `env vars` on your  machine\n\n## Authentication ##\n\n### Oauth Credentials and Secrets ###\n\nDepending on how you use `sfcc-ci` you make use of command `sfcc-ci auth:login` or `sfcc-ci client:auth` to authenticate. These commands accept credentials being explicitly passed as arguments to these commands. Use `sfcc-ci auth:login --help` and `sfcc-ci client:auth --help` for more info. However, there are alternative ways on how to make credentials available to the CLI for authentication:\n\n* You can define credentials in a `dw.json` file. The CLI will attempt to read this file (if present) from the current working directory.\n* Alternatively you can use a set of well-known env vars (if set) which the CLI will use. Namely, these are `SFCC_OAUTH_CLIENT_ID` (client id), `SFCC_OAUTH_CLIENT_SECRET` (client secret), `SFCC_OAUTH_USER_NAME` (user name) and `SFCC_OAUTH_USER_PASSWORD` (user password). \n```bash\nexport SFCC_OAUTH_CLIENT_ID=\u003cclient-id\u003e\nexport SFCC_OAUTH_CLIENT_SECRET=\u003cclient-secret\u003e\nexport SFCC_OAUTH_USER_NAME=\u003cuser-name\u003e\nexport SFCC_OAUTH_USER_PASSWORD=\u003cuser-password\u003e\n```\n* Lastly you can make use of a `.env` file, which holds the credentials in form of `NAME=VALUE` using the same set of well-known env vars as above. The CLI will attempt to make use of the env vars in this file (if present) from the current working directory. For example:\n```bash\nSFCC_OAUTH_CLIENT_ID=\u003cclient-id\u003e\nSFCC_OAUTH_CLIENT_SECRET=\u003cclient-secret\u003e\nSFCC_OAUTH_USER_NAME=\u003cuser-name\u003e\nSFCC_OAUTH_USER_PASSWORD=\u003cuser-password\u003e\n```\n\n### Authorization Server ###\n\n`sfcc-ci` uses a default authorization server. You can overwrite this authorization server and use an alternative login url using the env var `SFCC_LOGIN_URL`:\n\n```bash\nexport SFCC_LOGIN_URL=\u003calternative-authorization-server\u003e\n```\n\nRemoving the env var (`unset SFCC_LOGIN_URL`) will make the CLI use the default authorization server again.\n\n### Oauth Local Port ###\n\n`sfcc-ci` uses a default Oauth local port for authentication flow via command `sfcc-ci auth:login`. You can overwrite this port and use an alternative port number (e.g. if the default port is used on your machine and you cannot use is) using the env var `SFCC_OAUTH_LOCAL_PORT`:\n\n```bash\nexport SFCC_OAUTH_LOCAL_PORT=\u003calternative-port\u003e\n```\n\nRemoving the env var (`unset SFCC_OAUTH_LOCAL_PORT`) will make the CLI use the default port again.\n\n## Authorization ##\n\nDepending on which activities you want to want to perform, you have to ensure proper permissions have been granted beforehand. The required permissions and how to grant them depends on the commands you want to perform and whether you want to execute commands interactively (with the presence of a user) or implement automations (no user present).\n\nConsult the table below to set permissions depending on the activity desired:\n\nCommands | Interactive Use | Automation Use\n------------ | ------------ | -------------\ndata:* | OCAPI Data API Settings | OCAPI Data API Settings\nsandbox:* | Sandbox API User role assigned to user | Sandbox API User role assigned to API client\ninstance:* | OCAPI Data API Settings | OCAPI Data API Settings\ncode:* | OCAPI Data API Settings | OCAPI Data API Settings\njob:* | OCAPI Data API Settings | OCAPI Data API Settings\ncartridge:* | OCAPI Data API Settings | OCAPI Data API Settings\norg:* | Account Administrator role assigned to user | Account Administrator role assigned to API client\nrole:* | Account Administrator role assigned to user _or_ OCAPI Data API Settings | Account Administrator role assigned to API client _or_ OCAPI Data API Settings \nusers:* | Account Administrator role assigned to user _or_ OCAPI Data API Settings | Account Administrator role assigned to API client _or_ OCAPI Data API Settings\n\n### Authorizing a User ###\n\nAuthorizing a user usually requires assigning the required role to the user in Account Manager. Assigning a role to a user in Account Manager, such as the `Sandbox API User` role, itself requires the Account Administrator role.\n\n### Authorizing an API Client ###\n\nAuthorizing an API client requires assigning the required role to the API client in Account Manager or granting permissions to the API client on the B2C Commerce instance via the OCAPI Data API settings. Assigning a role to an API client in Account Manager, such as the `Sandbox API User` role, itself requires the Account Administrator or API Admin role.\n\n## Sandbox API ##\n\n### API Server ###\n\n`sfcc-ci` uses a default host for the sandbox API. This is the standard Sandbox API Gateway at admin.dx.commercecloud.salesforce.com. Usually this is fine and you don't need to change this. However, you can overwrite this host and use an alternative host using the env var `SFCC_SANDBOX_API_HOST`:\n\n```bash\nexport SFCC_SANDBOX_API_HOST=\u003calternative-sandbox-api-host\u003e\n```\n\nRemoving the env var (`unset SFCC_SANDBOX_API_HOST`) will make the CLI use the default host again.\n\n### API Polling Timeout ###\n\n`sfcc-ci` allows the creation of a sandbox in sync mode (see `sfcc-ci sandbox:create --help` for details). By default the polling of the sandbox status lasts for 10 minutes at maximum until the timeout is reached. You can overwrite this timeout and specify another timeout in minutes using the env var `SFCC_SANDBOX_API_POLLING_TIMEOUT`:\n\n```bash\nexport SFCC_SANDBOX_API_POLLING_TIMEOUT=\u003calternative-sandbox-api-polling-timeout-in-minutes\u003e\n```\n\nRemoving the env var (`unset SFCC_SANDBOX_API_POLLING_TIMEOUT`) will make the CLI use the default timeout again.\n\n## Debugging ##\n\nYou can force `sfcc-ci` to write debug messages to the console using the env var `DEBUG`. You can do this for globally by setting the env var, so that any following CLI command will write debug messages:\n\n```bash\nexport DEBUG=*\n```\n\nIf you only want a single CLI command to write debug messages use the the `-D,--debug` flag with any command, e.g. `sfcc-ci \u003csub:command\u003e --debug`.\n\n## Sorting list ##\n\nTo output objects to a sorted list, add the `-S,--sortby` option to one of the supported commands. Sort objects by specifying any field.\n\n## CLI Examples ##\n\nThe examples below assume you have defined a set of environment variables:\n\n* an API Key (the client ID)\n* an API Secret (the client secret)\n\nOn Linux and MacOS you can set environment variables as follows:\n\n```bash\nexport API_KEY=\u003cmy-api-key\u003e\nexport API_SECRET=\u003cmy-api-secret\u003e\n```\n\nOn Windows you set them as follows:\n\n```bash\nset API_KEY=\u003cmy-api-key\u003e\nset API_SECRET=\u003cmy-api-secret\u003e\n```\n\nThe remainder of the examples below assume you are on Linux or MacOS. If you are on Windows you access environment variables using `%MY_ENV_VAR%` instead of `$MY_ENV_VAR`.\n\nNote: Some CLI commands provide structured output of the operation result as JSON. To process this JSON a tool called `jq` comes in handy. Installation and documentation of `jq` is located at https://stedolan.github.io/jq/manual/. \n\n### Authentication ###\n\nIn an interactive mode you usually authenticate as follows:\n\n```bash\nsfcc-ci auth:login $API_KEY\n```\n\nIn an automation scenario (where no user is present) authentication is done using API client credentials as follows:\n\n```bash\nsfcc-ci client:auth $API_KEY $API_SECRET\n```\n\nLogging out (and removing auth tokens from the machine):\n\n```bash\nsfcc-ci auth:logout\n```\n\n### Pushing Code ###\n\nPushing code to any SFCC instance and activate it:\n\n```bash\nsfcc-ci code:deploy \u003cpath/to/code_version.zip\u003e -i your-instance.demandware.net\nsfcc-ci code:activate \u003ccode_version\u003e -i your-instance.demandware.net\n```\n\n### Data Import ###\n\nRunning an instance import (aka site import) on any SFCC instance:\n\n```bash\nsfcc-ci instance:upload \u003cpath/to/data.zip\u003e -i your-instance.demandware.net\nsfcc-ci instance:import \u003cdata.zip\u003e -i your-instance.demandware.net -s\n```\n\nRunning the instance import without waiting for the import to finish you omit the `--sync,-c` flag:\n\n```bash\nsfcc-ci instance:import \u003cdata.zip\u003e -i your-instance.demandware.net\n```\n\n### Sandboxes ###\n\nProvision a new sandbox, outputting the inbound and outbound IP addresses, uploading code and running an instance import:\n\n```bash\nSANDBOX=`sfcc-ci sandbox:create \u003ca-realm\u003e -s -j`\nSANDBOX_HOST=`$SANDBOX | jq '.instance.host' -r`\nsfcc-ci sandbox:ips\nsfcc-ci code:deploy \u003cpath/to/code.zip\u003e -i $SANDBOX_HOST\nsfcc-ci instance:upload \u003cpath/to/data.zip\u003e -i $SANDBOX_HOST -s\nsfcc-ci instance:import \u003cdata.zip\u003e -i your-instance.demandware.net\n```\n### Cartridges ###\nHandles the cartridge path of your Site. Very useful for plugin installation.\nYou can put the cartridge on top or at the bottom of the cartridge path. Or if given an anchor cartridge at the before or after a cartridge.\n\n```bash\nsfcc-ci cartridge:add \u003ccartridgename\u003e -p [first|last] -S \u003csiteid\u003e\nsfcc-ci cartridge:add \u003ccartridgename\u003e -p [before|after] -t [targetcartidge] -S \u003csiteid\u003e\n```\n\n# Using the JavaScript API #\n\nThere is a JavaScript API available, which you can use to program against and integrate the commands into your own project.\n\nMake sfcc-ci available to your project by specifying the dependeny in your `package.json` first and running and `npm install` in your package. After that you require the API into your implementation using:\n\n```javascript\n  const sfcc = require('sfcc-ci');\n```\n\nThe API is structured into sub modules. You may require sub modules directly, e.g.\n\n```javascript\n  const sfcc_auth = require('sfcc-ci').auth;\n  const sfcc_cartridge = require('sfcc-ci').cartridge;\n  const sfcc_code = require('sfcc-ci').code;\n  const sfcc_instance = require('sfcc-ci').instance;\n  const sfcc_job = require('sfcc-ci').job;\n  const sfcc_slas = require('sfcc-ci').slas;\n  const sfcc_user = require('sfcc-ci').user;\n  const sfcc_webdav = require('sfcc-ci').webdav;\n```\n\nThe following APIs are available (assuming `sfcc` refers to `require('sfcc-ci')`):\n\n```javascript\n  sfcc.auth.auth(client_id, client_secret, callback);\n  sfcc.cartridge.add(instance, cartridgename, position, target, siteid, verbose, token, callback);\n  sfcc.code.activate(instance, code_version, token, callback);\n  sfcc.code.deploy(instance, archive, token, options, callback);\n  sfcc.code.list(instance, token, callback);\n  sfcc.code.compare(instance, localDirectories, options);\n  sfcc.code.diffdeploy(instance, localDirectories, codeVersionName, options, activate);\n  sfcc.instance.upload(instance, file, token, options, callback);\n  sfcc.instance.import(instance, file_name, token, callback);\n  sfcc.job.run(instance, job_id, job_params, token, callback);\n  sfcc.job.status(instance, job_id, job_execution_id, token, callback);\n  sfcc.manifest.generate(directories, ignorePatterns, targetDirectory, fileName);\n  sfcc.slas.tenant.add(tenantId, shortcode, description, merchantName, contact, emailAddress, fileName, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.slas.tenant.get(tenantId, shortcode, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.slas.tenant.list(shortcode, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.slas.tenant.delete(tenantId, shortcode, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.slas.client.add(tenantId, shortcode, file, clientid, clientname, privateclient, ecomtenant, ecomsite, secret, channels, scopes, redirecturis, callbackuris, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.slas.client.get(tenantId, shortcode, clientId, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.slas.client.list(shortcode, tenantId, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.slas.client.delete(tenantId, shortcode, clientId, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.create(org, user, mail, firstName, lastName, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.list(org, role, login, count, sortBy, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.update(login, changes, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.grant(login, role, scope, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.revoke(login, role, scope, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.delete(login, purge, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.reset(login, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.createLocal(instance, login, user, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.searchLocal(instance, login, query, role, sortBy, count, start, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.updateLocal(instance, login, changes, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.grantLocal(instance, login, role, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.revokeLocal(instance, login, role, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.user.deleteLocal(instance, login, token).then(result =\u003e ...).catch(err =\u003e ...);\n  sfcc.webdav.upload(instance, path, file, token, options, callback);\n```\n\n### Authentication ###\n\nAPIs available in `require('sfcc-ci').auth`:\n\n`auth(client_id, client_secret, callback)`\n\nAuthenticates a clients and attempts to obtain a new Oauth2 token. Note, that tokens should be reused for subsequent operations. In case of a invalid token you may call this method again to obtain a new token.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\nclient_id     | (String)    | The client ID\nclient_secret | (String)    | The client secret\ncallback      | (Function)  | Callback function executed as a result. The error and the token will be passed as parameters to the callback function.\n\n**Returns:** (void) Function has no return value\n\nExample:\n\n```javascript\nconst sfcc = require('sfcc-ci');\n\nvar client_id = 'my_client_id';\nvar client_secret = 'my_client_id';\n\nsfcc.auth.auth(client_id, client_secret, function(err, token) {\n    if(token) {\n        console.log('Authentication succeeded. Token is %s', token);\n    }\n    if(err) {\n        console.error('Authentication error: %s', err);\n    }\n});\n\n```\n\n### Cartridge ###\n\nAPIs available in `require('sfcc-ci').cartridge`:\n\n`add(instance, cartridgename, position, target, siteid, verbose, token, callback)`\n\nAllows to add a cartridge to the cartridge path for a given site at a specific position.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to add the cartridge.\ncartridgename | (String)    | The given cartride name.\nposition      | (String)    | Either first, last, before or after.\ntarget        | (String)    | When position is 'before' or 'after', need to specify the target cartridge.\nsiteid        | (String)    | ID of the site, where the cartrdige should be added.\ntoken         | (String)    | The Oauth token to use for authentication.\nverbose       | (Boolean)   | Wether or not to use logging capabilities.\ncallback      | (Function)  | Callback function executed as a result. The error and the token will be passed as parameters to the callback function.\n\n**Returns:** (void) Function has no return value\n\nExample:\n\n```javascript\nconst sfcc = require('sfcc-ci');\n\nvar instance = '\"*.sandbox.us01.dx.commercecloud.salesforce.com';\nvar cartridgename = 'app_custom';\nvar position = 'before';\nvar target = 'app_storefront_base';\nvar siteid = 'RefArch';\nvar verbose = false;\nvar token = 1234;\n\nsfcc.cartridge.add(instance, cartridgename, position, target, siteid, verbose, token, function(err, token) {\n  // ...\n});\n\n```\n\n***\n\n### Code ###\n\nAPIs available in `require('sfcc-ci').code`:\n\n`deploy(instance, archive, token, options, callback)`\n\nDeploys a custom code archive onto a Commerce Cloud instance\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to activate the code on\narchive       | (String)    | The ZIP archive filename to deploy\ntoken         | (String)    | The Oauth token to use use for authentication\noptions       | (Object)    | The options parameter can contains two properties: pfx: the path to the client certificate to use for two factor authentication. passphrase: the optional passphrase to use with the client certificate\ncallback      | (Function)  | Callback function executed as a result. The error will be passed as parameter to the callback function.\n\n**Returns:** (void) Function has no return value\n\n***\n\n`list(instance, token, callback)`\n\nGet all custom code versions deployed on a Commerce Cloud instance.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to activate the code on\ntoken         | (String)    | The Oauth token to use for authentication\ncallback      | (Function)  | Callback function executed as a result. The error and the code versions will be passed as parameters to the callback function.\n\n**Returns:** (void) Function has no return value\n\n***\n\n`activate(instance, code_version, token, callback)`\n\nActivate the custom code version on a Commerce Cloud instance. If the code version is already active, no error is available.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to activate the code on\ncode_version  | (String)    | The code version to activate\ntoken         | (String)    | The Oauth token to use use for authentication\ncallback      | (Function)  | Callback function executed as a result. The error will be passed as parameter to the callback function.\n\n**Returns:** (void) Function has no return value\n\n***\n\n`compare(instance, localDirectories, options)`\n\nCompare the given local directories with the given code version (or the active one if none specified) of the Commerce Cloud instance and provide a diff between the two\n\nParam                     | Type        | Description\n------------------------- | ------------| --------------------------------\ninstance                  | (String)    | The instance to activate the code on\nlocalDirectories          | (Array)     | The list of local directories to compare with the remote instance\noptions                   | (Object)    | The object that contain all the possible options.\noptions.sourceCodeVersion | (String)    | This is the name of the code version from the instance to use as source of comparison. If not specified, the active code version is used.\noptions.manifestFileName  | (String)    | The name of the remote manifest file. If not provided, the `manifest.FILENAME` constant is used.\noptions.pfx               | (String)    | The path to the certificate to authenticate to the instance.\noptions.passphrase        | (String)    | The passphrase associated with the given certificate.\noptions.overrideLocalFile | (Boolean)   | If not provided, the process won't override any existing manifest previously downloaded, and will abort the process. If provided, then any existing downloaded manifest file will be overridden\noptions.ignorePatterns    | (Array)     | A list of [glob](https://www.npmjs.com/package/glob) patterns to use to ignore files while listing local files and generating the local manifest. If not provided, the default patterns are used: `['test/**/*', 'coverage/**/*', 'documentation/**/*', 'docs/**/*', '*.md']`\noptions.outputFile        | (Boolean)   | If provided, a file will be generated with the resuts in the comparison in the `process.cwd()` folder. Its path is then passed in the `resolve` method of the returned promise. If not provided, then the comparison results are passed in the `resolve` method of the returned promise.\noptions.removeFilesAfter  | (Boolean)   | If provided, the downloaded manifest and generated one (for local files) are removed. Only the output file will remain (if the option `outputFile` is provided). If not provided, any manifest used for the comparison will remain in the `process.cwd()` folder.\noptions.verbose           | (Object)    | Asks the process to log each stage of the comparison task.\n\n**Returns:** (Promise) Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\nThe `resolve` method is called with either:\n- The path of the output file which contain the comparison results, if the `outputFile` option is passed\n- The JSON representation of the comparison results, if the `outputFile` option is **not** passed\nThe `reject` method is called with any error message if an error occurs during the comparison process\n\nExample:\n\n```javascript\nconst sfcc = require('sfcc-ci');\n\nconst instance = '\"*.sandbox.us01.dx.commercecloud.salesforce.com';\nconst localDirectories = ['path/to/repo1', 'path/to/repo2'];\nconst options = {\n    ignorePatterns: ['test/**/*', 'docs/**/*'],\n    outputFile: true,\n    removeFilesAfter: true,\n    overrideLocalFile: true\n};\n\nsfcc.code.compare(instance, localDirectories, options)\n    .then(deltaResult =\u003e {\n        // do something with the delta result, which contains the difference between the local directories and the remote code version\n    })\n    .catch(err =\u003e console.log(err));\n\n```\n\n***\n\n`diffdeploy(instance, localDirectories, codeVersionName, options, activate)`\n\nGenerate a manifest for the given local directories. Compare this manifest with the one within the active code version of the instance. Deploy only the files which have been updated locally comparing to the remote, within a newly created code version. Activate this newly generated code version if required in the options\n\nParam                       | Type        | Description\n--------------------------- | ------------| --------------------------------\ninstance                    | (String)    | The instance to activate the code on\nlocalDirectories            | (Array)     | The list of local directories to compare with the remote instance\ncodeVersionName             | (String)    | The name of the new code version to use for the newly deployed code version\noptions                     | (Object)    | The object that contain all the possible options.\noptions.sourceCodeVersion   | (String)    | This is the name of the code version from the instance to use as source of comparison. If not specified, the active code version is used.\noptions.manifestFileName    | (String)    | The name of the remote manifest file. If not provided, the `manifest.FILENAME` constant is used.\noptions.pfx                 | (String)    | The path to the certificate to authenticate to the instance.\noptions.passphrase          | (String)    | The passphrase associated with the given certificate.\noptions.overrideLocalFile   | (Boolean)   | If not provided, the process won't override any existing manifest previously downloaded, and will abort the process. If provided, then any existing downloaded manifest file will be overridden\noptions.ignorePatterns      | (Array )    | A list of [glob](https://www.npmjs.com/package/glob) patterns to use to ignore files while listing local files and generating the local manifest. If not provided, the default patterns are used: `['test/**/*', 'coverage/**/*', 'documentation/**/*', 'docs/**/*', '*.md']`\noptions.forceDeployPatterns | (Array )    | A list of [glob](https://www.npmjs.com/package/glob) patterns to use to force the deployment for those files. The deploy will **ALWAYS** include these files within the deployment, regardless if these files were not changed or were ignored by the previous ignore patterns list.\noptions.removeFilesAfter    | (Boolean)   | If provided, the downloaded manifest and generated one (for local files) are removed. Only the output file will remain (if the option `outputFile` is provided). If not provided, any manifest used for the comparison will remain in the `process.cwd()` folder.\noptions.verbose             | (Object)    | Asks the process to log each stage of the comparison task.\nactivate                    | (Boolean)   | Asks the process to activate the newly deployed code version. If not provided, then the code version will remain on the instance deactivated.\n\n**Returns:** (Promise) Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\nThe `resolve` method is called with `undefined` as parameter, meaning that the process finished successfully\nThe `reject` method is called with any error message if an error occurs during the comparison process\n\nExample:\n\n```javascript\nconst sfcc = require('sfcc-ci');\n\nconst instance = '\"*.sandbox.us01.dx.commercecloud.salesforce.com';\nconst localDirectories = ['path/to/repo1', 'path/to/repo2'];\nconst codeVersionName = 'new_code_version';\nconst activate = true;\nconst options = {\n    sourceCodeVersion: 'code_version_to_use_as_source',\n    ignorePatterns: ['test/**/*', 'docs/**/*'],\n    forceDeployPatterns: ['**/config/**/*'],\n    outputFile: true,\n    removeFilesAfter: true,\n    overrideLocalFile: true\n};\n\nsfcc.code.diffdeploy(instance, localDirectories, codeVersionName, options, activate)\n    .then(() =\u003e {\n        // do something, now that the code has been deployed and activated successfully\n    })\n    .catch(err =\u003e console.log(err));\n\n```\n\n***\n\n### Instance ###\n\nAPIs available in `require('sfcc').instance`:\n\n`upload(instance, file, token, options, callback)`\n\nUploads an instance import file onto a Commerce Cloud instance.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to upload the import file to\nfile          | (String)    | The file to upload\ntoken         | (String)    | The Oauth token to use use for authentication\noptions       | (Object)    | The options parameter can contains two properties: pfx: the path to the client certificate to use for two factor authentication. passphrase: the optional passphrase to use with the client certificate\ncallback      | (Function)  | Callback function executed as a result. The error will be passed as parameter to the callback function.\n\n**Returns:** (void) Function has no return value\n\n***\n\n`import(instance, file_name, token, callback)`\n\nPerform an instance import (aka site import) on a Commerce Cloud instance. You may use the API job.status to get the execution status of the import.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | Instance to start the import on\nfile_name     | (String)    | The import file to run the import with\ntoken         | (String)    | The Oauth token to use use for authentication\ncallback      | (Function)  | Callback function executed as a result. The error and the job execution details will be passed as parameters to the callback function.\n\n**Returns:** (void) Function has no return value\n\n***\n\n### Jobs ###\n\nAPIs available in `require('sfcc').job`:\n\n`run(instance, job_id, job_params, token, callback)`\n\nStarts a job execution on a Commerce Cloud instance. The job is triggered and the result of the attempt to start the job is returned. You may use the API job.status to get the current job execution status.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | Instance to start the job on\njob_id        | (String)    | The job to start\ntoken         | (String)    | The Oauth token to use use for authentication\njob_params    | (Array)     | Array containing job parameters. A job parameter must be denoted by an object holding a key and a value property.\ncallback      | (Function)  | Callback function executed as a result. The error and the job execution details will be passed as parameters to the callback function.\n\n**Returns:** (void) Function has no return value\n\n***\n\n`status(instance, job_id, job_execution_id, token, callback)`\n\nGet the status of a job execution on a Commerce Cloud instance.\n\nParam            | Type        | Description\n---------------- | ------------| --------------------------------\ninstance         | (String)    | Instance the job was executed on.\njob_id           | (String)    | The job to get the execution status for\njob_execution_id | (String)    | The job execution id to get the status for\ntoken            | (String)    | The Oauth token to use use for authentication\ncallback         | (Function)  | Callback function executed as a result. The error and the job execution details will be passed as parameters to the callback function.\n\n**Returns:** (void) Function has no return value\n\n***\n\n### SLAS ###\n\nAPIs available in `require('sfcc').slas`:\n\n`tenant.add(tenantId, shortcode, description, merchantName, contact, emailAddress, fileName)`\n\nAdds the tenant details to the SLAS organization\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ntenantId      | (String)    | The tenant ID\nshortcode     | (String)    | The short code of the org\ndescription   | (String)    | Description of the tenant\nmerchantName  | (String)    | Name of the merchant\ncontact       | (String)    | Username of the user\nemailAddress  | (String)    | Email address of the user\nfileName      | (String)    | Path of the file containing all the params required for the tenant creation.\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the newly created tenant reponse.\n\n***\n\n`tenant.get(tenantId, shortcode)`\n\nGets the tenant matching the given `tenantId` for the given `shortCode`\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ntenantId      | (String)    | The tenant ID\nshortcode     | (String)    | The short code of the org\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the tenant reponse.\n\n***\n\n`tenant.list(shortcode)`\n\nLists all the tenants for the given `shortCode`\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\nshortcode     | (String)    | The short code of the org\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is list of tenants reponse.\n\n***\n\n`tenant.delete(tenantId, shortcode)`\n\nDeletes the tenant matching the given `tenantId` for the given `shortCode`\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ntenantId      | (String)    | The tenant ID\nshortcode     | (String)    | The short code of the org\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the deletion reponse.\n\n***\n\n`client.add(tenantId, shortcode, file, clientid, clientname, privateclient, ecomtenant, ecomsite, secret, channels, scopes, redirecturis)`\n\nRegisters a new client within a given tenant\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ntenantId      | (String)    | The tenant ID\nshortcode     | (String)    | The short code of the org\nfile          | (String)    | Path of the file containing all the params required for the client creation.\nclientid      | (String)    | SLAS client id\nclientname    | (String)    | The client name\nprivateclient | (Boolean)   | Is the client a private client or not\necomtenant    | (String)    | The ecom tenant\necomsite      | (String)    | The ecom site\nsecret        | (String)    | The secret tied to the client ID\nchannels      | (Array)     | The list of channels for the client\nscopes        | (Array)     | The list of scopes authorized for the client\nredirecturis  | (Array)     | The list of redirect URIs authorized for the client\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the newly created client reponse.\n\n***\n\n`client.get(tenantId, shortcode, clientId)`\n\nGets the tenant matching the given `clientid` for the given `tenantId` and `shortCode`\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ntenantId      | (String)    | The tenant ID\nshortcode     | (String)    | The short code of the org\nclientid      | (String)    | SLAS client id\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the client reponse.\n\n***\n\n`client.list(shortcode, tenantId)`\n\nLists all the clients for the given `tenantId` and `shortCode`\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\nshortcode     | (String)    | The short code of the org\ntenantId      | (String)    | The tenant ID\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is list of clients reponse.\n\n***\n\n`client.delete(tenantId, shortcode, clientId)`\n\nDeletes the client matching the given `clientId` for the given `tenantId` and `shortCode`\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ntenantId      | (String)    | The tenant ID\nshortcode     | (String)    | The short code of the org\nclientid      | (String)    | SLAS client id\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the deletion reponse.\n\n***\n\n### User ###\n\nAPIs available in `require('sfcc').user`:\n\n`create(org, user, mail, firstName, lastName, token)`\n\nCreates a new user into Account Manager\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\norg           | (String)    | The org ID where to create the user\nuser          | (Object)    | The user object with all the required data in it\nmail          | (String)    | The email of the user\nfirstName     | (String)    | The firstname of the user\nlastName      | (String)    | The lastname of the user\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the newly created user object.\n\n***\n\n`list(org, role, login, count, sortBy, token)`\n\nLists all users eligible to manage from the Account Manager, based on the given filters (if any provided)\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\norg           | (String)    | The org ID or null, if all users should be retrieved\nrole          | (String)    | The role or null, if all users should be retrieved\nlogin         | (String)    | The login or null, if all users should be retrieved\ncount         | (Number)    | The max count of list items\nsortBy        | (String)    | (Optional) field to sort the list of users by\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the results array.\n\n***\n\n`update(login, changes, token)`\n\nUpdate a user into Account Manager\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\nlogin         | (String)    | The login of the user to update\nchanges       | (Object)    | The changes to the user details\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the updated user.\n\n***\n\n`grant(login, role, scope, token)`\n\nGrant a role to a user into Account Manager\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\nlogin         | (String)    | The login (email) of the user\nrole          | (String)    | The role to grant\nscope         | (String)    | The scope of the role to revoke\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the changed user.\n\n***\n\n`revoke(login, role, scope, token)`\n\nRevoke a role to a user from Account Manager\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\nlogin         | (String)    | The login (email) of the user\nrole          | (String)    | The role to grant\nscope         | (String)    | The scope of the role to revoke\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the changed user.\n\n***\n\n`delete(login, purge, token)`\n\nDelete a user from Account Manager\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\nlogin         | (String)    | The user to delete\npurge         | (Boolean)   | Whether to purge the user completely\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is a boolean value that confirms if the user has been deleted or not.\n\n***\n\n`createLocal(instance, login, user, token)`\n\nCreates a new local user on an instance\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to create the user on\nlogin         | (String)    | The user to delete\nuser          | (Object)    | The user details\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the created user.\n\n***\n\n`searchLocal(instance, login, query, role, sortBy, count, start, token)`\n\nSearch for local users on an instance\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to create the user on\nlogin         | (String)    | The login or null, if all users should be retrieved\nquery         | (String)    | The query to search users for\nrole          | (String)    | The role to search users for\nsortBy        | (String)    | (Optional) field to sort users by\ncount         | (Number)    | (Optional) number of items per page\nstart         | (Number)    | (Optional) zero-based index of the first search hit to include\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the results of the search.\n\n***\n\n`updateLocal(instance, login, changes, token)`\n\nUpdate a local user on an instance\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to update the user on\nlogin         | (String)    | The login of the local user to update\nchanges       | (Object)    | The changes to the user details\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the updated user.\n\n***\n\n`grantLocal(instance, login, role, token)`\n\nGrant a role to a local user on an instance\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to apply the role on the user on\nlogin         | (String)    | The login of the local user to grant\nrole          | (String)    | The role to grant\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the changed user.\n\n***\n\n`revokeLocal(instance, login, role, token)`\n\nRevoke a role from a local user on an instance\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to apply the role on the user on\nlogin         | (String)    | The login of the local user to revoke\nrole          | (String)    | The role to revoke\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is the changed user.\n\n***\n\n`deleteLocal(instance, login, token)`\n\nDelete a local user from an instance\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to delete the user on\nlogin         | (String)    | The login of the local user to delete\ntoken         | (String)    | The Oauth token to use use for authentication\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is a boolean value that confirms if the user has been deleted or not.\n\n***\n\n### Roles ###\nAPIs available in `require('sfcc-ci').role`:\n\nList all the roles.\n\n`list(token, count)`\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ntoken         | (String)    | The Oauth token to use use for authentication\ncount         | (Number)    | count the max count of list items\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is a boolean value that confirms if the user has been deleted or not.\n\n***\n\n`listLocal(instance, role, query, token, sortBy, count)`\n\nList all the roles into an instance.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to list the role on\nrole          | (String)    | The role to revoke\nquery         | (String)    | The query to search role for\ntoken         | (String)    | The Oauth token to use use for authentication\nsortBy        | (String)    | (Optional) field to sort users by\ncount         | (Number)    | (Optional) number of items per page\n\n**Returns:** (Promise) The [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with its `resolve` or `reject` methods called respectively with the `result` or the `error`. The `result` variable here is a boolean value that confirms if the user has been deleted or not.\n\n***\n\n### Manifest ###\n\nAPIs available in `require('sfcc-ci').manifest`:\n\n`generate(directories, ignorePatterns, targetDirectory, fileName)`\n\nGenerates the manifest file based on the given local directories.\n\nParam                      | Type        | Description\n-------------------------- | ------------| --------------------------------\ndirectories                | (Array)     | The list of directories for which to generate a manifest. These directories has to contain a `cartridges` folder at their root level\nignorePatterns (Optional)  | (String)    | A list of [glob](https://www.npmjs.com/package/glob) patterns to use to ignore files while listing local files and generating the local manifest. If not provided, the default patterns are used: `['test/**/*', 'coverage/**/*', 'documentation/**/*', 'docs/**/*', '*.md']`\ntargetDirectory (Optional) | (Boolean)   | The directory where to store the generated manifest. If not provided, `process.cwd()` is used.\nfileName (Optional)        | (Boolean)   | The file name to use while generating the manifest file. If not provided, the `require('sfcc-ci').manifest.FILENAME` constant is used.\n\n**Returns:** (Promise) Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\nThe `resolve` method is called with newly generated manifest file path as parameter\nThe `reject` method is called with any error message if an error occurs during the comparison process\n\nExample:\n\n```javascript\nconst sfcc = require('sfcc-ci');\n\nconst directories = ['/path/to/repo1', '/path/to/repo2'];\nconst ignorePatterns = ['test/**/*', 'docs/**/*'];\nconst targetDirectory = 'path/to/target/directory';\nconst fileName = 'my_manifest.json';\n\nsfcc.manifest.generate(directories, ignorePatterns, targetDirectory, fileName)\n    .then(manifestPath =\u003e {\n        // do something with the manifest path\n    })\n    .catch(err =\u003e console.log(err));\n\n```\n\n***\n\n### WebDAV ###\n\nAPIs available in `require('sfcc').webdav`:\n\n`upload(instance, path, file, token, options, callback)`\n\nUploads an arbitrary file onto a Commerce Cloud instance.\n\nParam         | Type        | Description\n------------- | ------------| --------------------------------\ninstance      | (String)    | The instance to upload the import file to\npath          | (String)    | The path relative to .../webdav/Sites where the file to upload to\nfile          | (String)    | The file to upload\ntoken         | (String)    | The Oauth token to use use for authentication\noptions       | (Object)    | The options parameter can contains two properties: pfx: the path to the client certificate to use for two factor authentication. passphrase: the optional passphrase to use with the client certificate\ncallback      | (Function)  | Callback function executed as a result. The error will be passed as parameter to the callback function.\n\n**Returns:** (void) Function has no return value\n\n***\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforcecommercecloud%2Fsfcc-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalesforcecommercecloud%2Fsfcc-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforcecommercecloud%2Fsfcc-ci/lists"}