Skip to main content

Overview

Resource operations are the everyday CLI commands for platform metadata: There is no general kdx create command. Use kdx apply -f <file> for create-or-update.

Discover Resources

Use --refresh after a platform upgrade or when a new resource type is missing from the local cache. Current resource names you should use in new metadata include: Compatibility aliases may still resolve for older names, but new examples and new files should use the current names above.

Read Resources

List resources:
Get one resource:
Render a schema-aware detailed view:
Use output formats for scripting:
kdx get also supports --filter-name when you have presentation filters configured.

Interactive Tables

When kdx get <resource> runs in a terminal, it opens an interactive table when possible. Common controls: Use -o json, -o yaml, or pipe output to disable table-oriented behavior for automation.

Filter And Sort Syntax

kdx get sends filters to the platform API. The current filter language is SpringFilter.
Common operators: Sort syntax uses field:direction:

Validate YAML

Validate a resource file without sending changes:
Validation checks:
  • The file parses as YAML.
  • The file declares a type.
  • The type exists in the connected platform’s OpenAPI resource discovery.
  • Required fields and known schema properties match the API schema where available.
Use validation before a PR or before a sync push:

Apply YAML

Apply creates or updates the resource described by a YAML file:
A minimal current-shape resource starts with a type:
For project-scoped or project-bound resources, include organization and project context when required by the server schema:

Supplying type and org with flags

If a file omits type (or, for slug-based resources, orgSlug), pass them on the command line instead of editing the file. This is the common case for files produced by kdx sync pull, which are intentionally untyped and organization-agnostic:
  • --type takes the same value you would put in a type: field (for example knowledge-set). It overrides the file’s type when both are present.
  • --org-slug supplies the organization used to resolve the resource (scheme://org-slug/slug) and, when creating a new resource, to set its owning organization. It overrides the file’s orgSlug.
When a flag is omitted, the value from the file is used, so existing self-describing files are unaffected.

Module Apply

For type: module, kdx apply can upload both metadata and implementation content. Current module metadata should use metadata.moduleRuntimeParameters:
If a module needs a build step before packaging, declare metadata.build:
If a module is an inline JavaScript helper, use metadata.script or metadata.scriptPath. Inline-script-only modules do not need implementation upload.

Delete Resources

Delete operations are server-defined. The CLI uses the discovered delete operation for the resource type and asks for production confirmation when the active profile is marked production.

Dynamic Operations

Use kdx run to list and call specialized API operations:
See Dynamic API Operations.

Production Safety

Profiles can be marked as production:
Mutating commands prompt before changing production resources. For CI/CD, use --skip-production-confirm only when the pipeline has its own approval gate:

When To Use Sync Instead

Use one-off resource operations for inspection, debugging, and small edits. Use kdx sync when:
  • A project has multiple related resources.
  • You need pull request review.
  • You promote from dev to staging to production.
  • Resources reference each other through project bindings.
  • You need conflict detection and deterministic push ordering.

Troubleshooting

Resource Type Not Found

Then use the current resource name, such as data-definition instead of older naming.

Apply Cannot Resolve A Resource

Check that the file includes type, slug, and any required orgSlug or projectSlug values:
If the file legitimately omits type or orgSlug — for example a file pulled via kdx sync — supply them with flags instead of editing the file:

Validation Fails On Unknown Fields

The connected server schema is authoritative. Refresh discovery and compare the YAML to the current API shape:

Changes Are Overwritten

For metadata repositories, run kdx sync pull before editing and commit .sync-state/ so conflict detection can protect against stale pushes.