> For the complete documentation index, see [llms.txt](https://docs.gridmate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gridmate.io/tools/sf-cli-plugin.md).

# SF Cli Plugin

Install the GridMate sf plugin to export and import User Grids and migrate Conga Views.

## Plugin Install

Clone the repository:

```bash
git clone https://github.com/GridMate/gridmate-sf-plugin
```

Go to the plugin directory and Install npm modules:

```bash
npm install
```

Finally link the plugin to your cli installation:

```bash
sf plugins link .
```

## Plugin Commands

### sf gmpkg usergrid export

```
Export GM - User Grid

USAGE
  $ sf gmpkg usergrid export -o <value> -d <value> --api-version <value> [--json] [-n <value>] [-q <value>]

FLAGS
  -d, --directory=<value>   (required) Export output directory.
  -n, --name=<value>        ',' List of API names of GM - User Grids.
  -o, --target-org=<value>  (required) Target org username/alias
  -q, --query=<value>       SOQL query to fetch list of GM - User Grids.
  --api-version=<value>     (required) Salesforce API Version

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Export GM - User Grid

  You can export either from a list of api names or an SOQL query.

EXAMPLES
  $ sf gmpkg usergrid export -o gmpkg-demo --api-version=58.0 -d "/data/Opportunity/export" -n "Opportunity_All_Grid,Opportunity_Pipeline_Grid"

  $ sf gmpkg usergrid export -o gmpkg-demo --api-version=58.0 -d "/data/Opportunity/export" -q "Select Id, Name From gmpkg__xUser_Grid__c Where gmpkg__Object_Name__c = 'Opportunity'"
  
FLAG DESCRIPTIONS
  --api-version=<value>  Salesforce API Version

    Override the api version used for api requests made by this command
```

### sf gmpkg usergrid import

```
Import GM - User Grid

USAGE
  $ sf gmpkg usergrid import -o <value> --api-version <value> [--json] [-f <value>] [-d <value>]

FLAGS
  -d, --directory=<value>   directory path to import.
  -f, --file=<value>        file path to import
  -o, --target-org=<value>  (required) Target org username/alias
  --api-version=<value>     (required) Salesforce API Version

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Import GM - User Grid

  You can import either a file or a directory.

EXAMPLES
  $ sf gmpkg usergrid import -o gmpkg-demo --api-version=58.0 -f "/data/Opportunity/import/Opportunity_All_Grid.json"

  $ sf gmpkg usergrid import -o gmpkg-demo --api-version=58.0 -d "/data/Opportunity/import"

FLAG DESCRIPTIONS
  --api-version=<value>  Salesforce API Version

    Override the api version used for api requests made by this command
```

### sf gmpkg congaview export

```
Export Conga View

USAGE
  $ sf gmpkg congaview export -o <value> -d <value> --api-version <value> [--json] [-n <value>] [-q <value>]

FLAGS
  -d, --directory=<value>   (required) Export output directory.
  -n, --name=<value>        ',' List of Conga Views.
  -o, --target-org=<value>  (required) Target org username/alias
  -q, --query=<value>       SOQL query to fetch list of Conga Views.
  --api-version=<value>     (required) Salesforce API Version

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Export Conga View

  You can export either from a list of api names or an SOQL query.

EXAMPLES
  $ sf gmpkg congaview export -o gmpkg-demo --api-version=58.0 -d "/data/conga/export" -n "Opportunity_All_View"

  $ sf gmpkg congaview export -o gmpkg-demo --api-version=58.0 -d "/data/conga/export" -q "SELECT Id, Name FROM CRMC_PP_GridView__c Where CRMC_PP_ObjectName__c='Opportunity'"

FLAG DESCRIPTIONS
  --api-version=<value>  Salesforce API Version

    Override the api version used for api requests made by this command
```

### sf gmpkg congaview migrate

```
Import Conga View

USAGE
  $ sf gmpkg congaview migrate -o <value> -f <value> -d <value> --api-version <value> [--json]

FLAGS
  -d, --directory=<value>   (required) target directory.
  -f, --file=<value>        (required) file path to migrate.
  -o, --target-org=<value>  (required) Target org username/alias
  --api-version=<value>     (required) Salesforce API Version

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Import Conga View

  Import a Conga View Json file

EXAMPLES
  $ sf gmpkg congaview migrate -o gmpkg-demo --api-version=58.0 -f "/data/conga/export/Opportunity_All_View.json" -d "/data/conga/migrated"

FLAG DESCRIPTIONS
  --api-version=<value>  Salesforce API Version

    Override the api version used for api requests made by this command
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gridmate.io/tools/sf-cli-plugin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
