> For the complete documentation index, see [llms.txt](https://docs.zingg.ai/zingg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zingg.ai/zingg/reference/zingg-command-line.md).

# Zingg Command Line

The two CLI invocation patterns and copy-paste commands for every Zingg phase for Docker, local Spark, EMR, and CI/CD environments.

The CLI lets you invoke Zingg phases from any environment that has a terminal - Docker containers, local Spark installations, AWS EMR clusters, or CI/CD pipelines. No notebook required.

You can pass a JSON configuration file directly or point the CLI at a Python program to run. This means you can run Zingg Python programs through `zingg.sh` just as easily as JSON-configured jobs - the CLI is not a replacement for the Python API; it is the runtime that executes both.

### The Two Invocation Patterns

**Pass a JSON config file**

```bash
./scripts/zingg.sh <optional --properties-file path to zingg.conf> --phase <phase> --conf <path to json>
```

**Run a Python program**

```bash
./scripts/zingg.sh <optional --properties-file path to zingg.conf> --run <path to python program>
```

{% hint style="success" icon="right-long" %}
Full command reference with all flags and options - [CLI command reference](/zingg/reference/cli-command-reference.md)
{% endhint %}

{% tabs %}
{% tab title="Community" %}
{% hint style="danger" icon="right-long" %}
Replace `config.json` with your actual config file path.
{% endhint %}

### **Find training pairs**

```bash
./scripts/zingg.sh --phase findTrainingData --conf config.json
```

### **Label pairs**

The `--showConcise=true` flag shows only fields used for matching and hides `DONT_USE` fields.

```bash
./scripts/zingg.sh --phase label --conf config.json --showConcise=true
```

### Train the model

```bash
./scripts/zingg.sh --phase train --conf config.json
```

### **Run match**

`match` finds duplicates within a single dataset.

```bash
./scripts/zingg.sh --phase match --conf config.json
```

### **Run link**

`link` matches records across two separate datasets.

```bash
./scripts/zingg.sh --phase link --conf config.json
```

{% endtab %}

{% tab title="Enterprise" %}
{% hint style="info" icon="right-long" %}
Enterprise adds two phases not available in Community: `generateDoc`s and\
`runIncremental`. Replace `config.json` with your actual config file path.
{% endhint %}

### Find training pairs

```bash
./scripts/zingg.sh --phase findTrainingData --conf config.json
```

### Label pairs

```bash
./scripts/zingg.sh --phase label --conf config.json --showConcise=true
```

### **Generate model documentation**

Optional but recommended before `train` — lets you inspect training data quality before committing to the train phase.

```bash
./scripts/zingg.sh --phase generateDocs --conf config.json
```

### Train the model

```bash
./scripts/zingg.sh --phase train --conf config.json
```

### Run match

```bash
./scripts/zingg.sh --phase match --conf config.json
```

### Run link

```bash
./scripts/zingg.sh --phase link --conf config.json
```

### **Run incremental**

Updates the identity graph with new and changed records without re-running the full match.

```bash
./scripts/zingg.sh --phase runIncremental --conf config.json
```

{% hint style="info" icon="right-long" %}
`generateDocs`, `runIncremental`, and `diff` are Enterprise only phases.
{% endhint %}
{% endtab %}
{% endtabs %}

<details>

<summary><strong>When should I use link instead of match?</strong></summary>

Use `match` when your goal is to find duplicates within a single dataset. For example, identifying that two customer records in the same system represent the same person.

Use `link` when you have two separate datasets that are individually duplicate-free but need to be matched against each other. For example, this involves matching a supplier list from one system against a vendor master from another. Each record from the first source is matched with all records from the remaining sources. The output includes a `z_sourc`e column that identifies which source dataset each record came from.

Both `match` and `link` use the same trained model. They are equal operations, not a hierarchy.

</details>

<details>

<summary><strong>What does a basic config.json look like?</strong></summary>

The JSON config file tells Zingg which fields to use, where your data lives, and where to write output. Here is the minimum structure to run any phase:

```json
{
  "fieldDefinition": [
    {
      "fieldName": "fname",
      "matchType": "FUZZY",
      "fields": "fname",
      "dataType": "string"
    },
    {
      "fieldName": "lname",
      "matchType": "FUZZY",
      "fields": "lname",
      "dataType": "string"
    },
    {
      "fieldName": "dob",
      "matchType": "EXACT",
      "fields": "dob",
      "dataType": "string"
    }
  ],
  "data": [
    {
      "name": "inputData",
      "format": "csv",
      "props": {
        "location": "/path/to/input.csv",
        "delimiter": ",",
        "header": "true"
      }
    }
  ],
  "output": [
    {
      "name": "matchOutput",
      "format": "csv",
      "props": {
        "location": "/path/to/output",
        "delimiter": ",",
        "header": "true"
      }
    }
  ],
  "modelId": "1",
  "zinggDir": "/tmp/zingg",
  "labelDataSampleSize": 0.5,
  "numPartitions": 4
}
```

{% hint style="success" icon="right-long" %}
**Read more**:

* Full configuration schema with all parameters and options - [Configuration schema](/zingg/reference/configuration-schema.md)
* Full flag and options reference - [CLI command reference](/zingg/reference/cli-command-reference.md)
* Python API alternative - [Python API](/zingg/zingg-python-api/working-with-python.md)
  {% endhint %}

</details>


---

# 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.zingg.ai/zingg/reference/zingg-command-line.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.
