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.
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:
export KODEXA_DEV_API_KEY="your-api-key-here"
Then run the discover pull:
kdx sync pull --target my-org --env dev --discover
This command does three things:
Queries the API for all resources in your organization
Generates manifest.yaml listing every discovered resource by slug
Pulls each resource to disk as a YAML file under kodexa-resources/
You should see output similar to:
Discovering resources for organization your-org-slug... Found 3 data-definitions Found 2 knowledge-sets Found 1 prompt-template Found 1 project (with 2 task-templates, 1 assistant)Writing manifest.yamlPulling 10 resources... ✓ data-definition/invoice-taxonomy ✓ data-definition/contract-taxonomy ✓ knowledge-set/extraction-rules ...Pull complete: 10 resources written
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:
# Pull latest from the serverkdx sync pull --target my-org --env dev# Review changesgit diff# Commit the latest stategit add .git commit -m "Sync from dev: $(date +%Y-%m-%d)"# Make local edits, then pushkdx sync push --target my-org --env devgit add .git commit -m "Update invoice taxonomy description"
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
manifest_version: "1.0"metadata_dir: kodexa-resourcesresources: data-definitions: - invoice-taxonomy - contract-taxonomy # - claim-schema # Excluded — managed by another team knowledge-sets: - extraction-rules # - validation-rules # Excluded — still in development
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.