Skip to main content

Prerequisites

Before you begin, ensure you have:
  • KDX CLI installed (installation guide)
  • An API key for your Kodexa environment (authentication guide)
  • Access to a Kodexa organization with existing resources (data definitions, knowledge sets, etc.)
You can generate an API key from your Kodexa platform account settings. You will need the organization slug for your target organization — you can find this in the URL when viewing your organization in the Kodexa UI.

Step 1: Create Your Sync Directory

Create a new directory for your sync configuration. This will become the root of your GitOps repository.
Create a sync-config.yaml file that defines your environment and target:
sync-config.yaml
Replace your-instance.kodexa-enterprise.com with your actual Kodexa platform URL, and your-org-slug with your organization’s slug.
If you already have a kdx CLI profile configured, you can use profile: my-profile instead of api_key_env in the environment definition.

Step 2: Discover Resources

The --discover flag queries your Kodexa environment, auto-generates a manifest.yaml, and pulls all resources to disk as YAML files. First, set your API key as an environment variable:
Then run the discover pull:
The --discover-dir resources flag tells the CLI to store resource files under a resources/ subdirectory and sets metadata_dir: resources in the generated manifest. You can omit it to store files next to the manifest. This command does three things:
  1. Queries the API for all resources in your organization
  2. Generates manifest.yaml listing every discovered resource by slug (with metadata_dir: resources)
  3. Pulls each resource to disk as a YAML file under resources/
You should see output similar to:

Step 3: Review What Was Pulled

Take a look at the files that were generated:
You should see:
Inspect the generated manifest to see which resources were discovered:
Browse the pulled resource files:
Each file is a complete YAML representation of the resource as it exists on the server.

Step 4: Make a Local Change

Open any resource YAML file and make a change. For example, update the description of a data definition:
Find the description field and update it:
Save the file. The change exists only on disk — it has not been pushed to the server yet.

Step 5: Push Changes

Always preview your changes with --dry-run before pushing:
The dry run shows what would be updated without making any changes:
When you are satisfied with the preview, push for real:

Step 6: Set Up Version Control

Initialize a git repository to track your sync configuration. This enables team collaboration and provides a full audit trail of every change.
Always commit the .sync-state/ directory. It contains changeSequence values that power conflict detection — without these, the CLI cannot detect when someone else has modified a resource on the server since your last pull.
From here, your typical workflow becomes:

Step 7: Customize Your Manifest

The auto-generated manifest includes every resource that was discovered. You can edit manifest.yaml to include only the resources you want to manage:
manifest.yaml
Commented-out resources will not be pulled or pushed. If you run --discover again later, it will add newly created resources but will not re-add resources you have removed from the manifest.
Split resources across multiple manifest files for larger organizations. A target can reference several manifests, and the same manifest can be shared across targets. See Manifests & Resource Types for details.

What’s Next

Configuration

Set up multiple environments, targets, and branch-based automation

Manifests & Resource Types

Define exactly which resources to sync and how they are organized

Conflict Detection

Understand how changeSequence prevents accidental overwrites

CI/CD Integration

Automate sync with GitHub Actions for continuous deployment