> ## Documentation Index
> Fetch the complete documentation index at: https://developer.kodexa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# KDX CLI: Commands, Sync, and Resource Management

> KDX CLI is the command-line interface for managing Kodexa resources, GitOps metadata, documents, knowledge attachments, secrets, and operational workflows.

<div className="not-prose mb-8 overflow-hidden rounded-lg border border-slate-200 bg-slate-950 shadow-sm dark:border-slate-800">
  <img className="h-44 w-full object-cover sm:h-56" src="https://mintcdn.com/kodexa/ddGoVDGTQwmj-CZ-/images/kdx-cli-banner.png?fit=max&auto=format&n=ddGoVDGTQwmj-CZ-&q=85&s=05fd3944d2b4fe6f9353c7aef0bad859" alt="KDX CLI workflows connecting profiles, API discovery, validation, and GitOps sync" noZoom width="1536" height="512" data-path="images/kdx-cli-banner.png" />
</div>

## What KDX Does

`kdx` is the command-line interface for the Kodexa Platform. It is used for four jobs:

* **Operate platform resources** with `get`, `describe`, `apply`, `delete`, `validate`, and `run`.
* **Manage GitOps metadata** with `kdx sync pull`, `kdx sync push`, and `kdx sync deploy`.
* **Inspect documents locally** with `kdx document` against KDDB files.
* **Run focused operational commands** for projects, stores, document families, knowledge item attachments, and organization secrets.

The CLI is intentionally API-aware. It discovers resource types and operations from the Kodexa OpenAPI specification for the environment you are connected to, then layers stable commands on top for common workflows.

## Current Mental Model

Use `kdx` to manage the resources that make a Kodexa project work:

| Area                  | CLI surface                                          | Use it for                                                                     |
| --------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------ |
| Resource discovery    | `kdx api-resources`                                  | See which resource types and schemes your platform exposes                     |
| Resource operations   | `kdx get`, `kdx describe`, `kdx apply`, `kdx delete` | Read and change individual platform resources                                  |
| Dynamic operations    | `kdx run`                                            | Call resource-specific API operations discovered from OpenAPI                  |
| GitOps metadata       | `kdx sync`                                           | Pull, review, push, and deploy version-controlled metadata                     |
| Activity projects     | `kdx project`, `kdx store`, `kdx document-family`    | Create projects, upload documents, watch processing, export results            |
| Knowledge             | `kdx knowledge`                                      | Upload and download knowledge item attachments                                 |
| Secrets               | `kdx secret`                                         | Manage write-only organization secrets without echoing values                  |
| Local KDDB inspection | `kdx document`                                       | Inspect document text, nodes, tags, data objects, exceptions, and native files |

## Key Capabilities

<CardGroup cols={2}>
  <Card title="Activity-Ready Metadata" icon="diagram-project" href="/guides/kdx-cli/sync/overview">
    Version Activity Plans, task templates, task statuses, data definitions, data forms, modules, Service Bridges, project templates, and project bindings.
  </Card>

  <Card title="Schema-Aware Apply" icon="shield-check" href="/guides/kdx-cli/resource-operations">
    Validate YAML against the live API schema and use `kdx apply -f` as the standard create-or-update path.
  </Card>

  <Card title="OpenAPI Operation Access" icon="terminal" href="/guides/kdx-cli/dynamic-api">
    Discover specialized API operations with `kdx run <resource>` and execute them with typed path, query, and body parameters.
  </Card>

  <Card title="Document Inspection" icon="file-lines" href="/guides/kdx-cli/document/overview">
    Work with KDDB files locally: text, selectors, nodes, data objects, exceptions, metadata, native files, and delta binaries.
  </Card>

  <Card title="Operational Workflows" icon="gears" href="/guides/kdx-cli/use-cases">
    Upload documents, watch document-family progress, export extracted data, attach knowledge assets, and manage secrets.
  </Card>

  <Card title="Deep Command Reference" icon="list" href="/guides/kdx-cli/command-reference">
    See the current non-legacy command groups, arguments, flags, outputs, and recommended use cases.
  </Card>
</CardGroup>

## Who Uses It

* **Solution developers** use `kdx` to inspect resources, download KDDB files, test document output, and iterate on metadata.
* **Platform engineers** use `kdx sync` to move Activity-centered configuration through development, staging, and production.
* **Project administrators** use focused commands to create projects from templates, upload documents, watch processing, and export results.
* **Automation teams** use JSON/YAML output, `kdx run`, and CI/CD sync reports to integrate Kodexa into scripts and deployment pipelines.

## Important Conventions

* Use **current resource names** in new metadata: `data-definition`, `activity-plan`, `task-template`, `task-status`, `data-form`, `service-bridge`, `module`, and `project-template`.
* Use **`kdx apply -f`** for declarative create-or-update. There is no general `kdx create` command.
* Use **`kdx project create`** only for the project-template workflow.
* Use **profiles** for interactive CLI work and **sync environments** for GitOps deployments.
* Treat `kdx run` as an escape hatch for resource-specific API operations that are not covered by stable top-level commands.

## Start Here

<CardGroup cols={2}>
  <Card title="Install" icon="download" href="/guides/kdx-cli/installation">
    Install or update the CLI.
  </Card>

  <Card title="Quick Start" icon="rocket" href="/guides/kdx-cli/quickstart">
    Authenticate, discover resources, and run the first useful commands.
  </Card>

  <Card title="Profiles & Configuration" icon="gear" href="/guides/kdx-cli/profiles-configuration">
    Manage profiles, command overrides, and sync environment credentials.
  </Card>

  <Card title="Sync & GitOps" icon="code-branch" href="/guides/kdx-cli/sync/overview">
    Put Kodexa metadata under version control.
  </Card>
</CardGroup>
