# SharinPix Salesforce CLI Plugin

{% embed url="<https://github.com/SharinPix/sharinpix-sf-plugin>" %}

The SharinPix Salesforce CLI plugin allows you to synchronize SharinPix forms, permissions, and settings between a Salesforce org and local configuration files.

This makes it easier to version, review, and deploy the SharinPix configuration across environments.

### In this article, we will demonstrate how to:

* [Install the SharinPix Salesforce CLI plugin](#install-the-plugin)
* [Authenticate to a Salesforce org](#authenticate-to-salesforce)
* [Pull all SharinPix configuration locally](#pull-all-configuration-from-salesforce)
* [Push all local changes back to Salesforce](#push-all-local-configuration-to-salesforce)

{% hint style="warning" %}

### Prerequisites

Before you begin, ensure that:

* Salesforce CLI (sf) is installed

  If it is not installed, follow the official [installation guide](https://developer.salesforce.com/tools/salesforcecli) and ensure the [sf command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm) is available in your terminal before continuing.
* You have access to a Salesforce org (Sandbox, UAT, or Production)
* Your Salesforce user has access to SharinPix features (Forms and Permissions)
  {% endhint %}

### Install the Plugin

Install the plugin using the Salesforce CLI:

```bash
sf plugins install @sharinpix/sharinpix-sf-plugin
```

Verify the installation:

```bash
sf plugins
```

### Authenticate to Salesforce

Log in to your Salesforce org using the web-based authentication flow:

```bash
sf org login web
```

It is recommended to define an alias for the org:

```bash
sf org alias set spx-dev=username@example.com
```

You can list authenticated orgs with:

```bash
sf org list
```

### Configuration

#### Target Org

All plugin commands require a target Salesforce org.

This can be provided using the login username.

```bash
-o username@example.com
```

#### Local Configuration Files

The plugin works with local configuration files:

* Pull commands generate or update local files
* Push commands read from those files and apply changes to Salesforce

It is recommended to commit these files to version control so configuration changes can be reviewed and deployed consistently.

#### Push Cleanup Behavior

{% hint style="danger" %}

#### **Warning**

Some push commands support removing Salesforce records that no longer exist locally.

This should only be used when local files are considered the source of truth, and with caution—especially in shared or production environments.
{% endhint %}

### Synchronizing SharinPix Configuration

#### Pull all the configuration from Salesforce

```bash
sf sharinpix pull -o username@example.com
```

This retrieves all supported SharinPix configurations (forms and permissions) from the target org and stores them locally.

#### Push all local configuration to Salesforce

```bash
sf sharinpix push -o username@example.com
```

This applies the local configuration back to the Salesforce org.

### Verification

After running a pull or push command, verify that:

* The correct Salesforce org was targeted
* Local configuration files were created or updated
* No errors were reported by the CLI

{% hint style="success" %}

### Additional Information

For a complete list of supported commands, options, and flags, refer to the official GitHub README:

{% embed url="<https://github.com/SharinPix/sharinpix-sf-plugin/blob/main/README.md>" %}
{% endhint %}
