> ## 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 Quick Start

> Quick start guide for the KDX CLI, the kubectl-style command-line interface for managing the Kodexa AI Platform from your terminal.

The KDX CLI (`kdx`) is a modern, kubectl-style command-line interface for the Kodexa AI Platform. It provides a powerful and familiar interface for managing Kodexa resources directly from the terminal.

## Why KDX CLI?

* **Kubectl-Style Interface**: Familiar commands like `get`, `describe`, `create`, `apply`, and `delete`
* **Dynamic Resource Discovery**: Automatically discovers resources from your platform's OpenAPI specification
* **Profile-Based Authentication**: Manage multiple environments with ease
* **Production Safety**: Confirmation prompts prevent accidental changes to production
* **GitOps Ready**: Built-in metadata sync for version-controlled infrastructure
* **Multiple Output Formats**: Interactive tables, JSON, and YAML for any workflow

## Installation

### Homebrew (macOS/Linux) - Recommended

```bash theme={null}
# Add the Kodexa tap
brew tap kodexa-ai/tap

# Install kdx
brew install kdx

# Verify installation
kdx --version
```

### Pre-release Builds

To try the latest development build before it's officially released, install `kdx-dev`. It installs as a separate binary so it can coexist with the stable `kdx`:

```bash theme={null}
# Install the pre-release CLI
brew install kodexa-ai/tap/kdx-dev

# Verify installation
kdx-dev --version
```

Pre-release builds are updated automatically from the `develop` branch and may contain features or fixes not yet in the stable release. Use `brew upgrade kdx-dev` to get the latest dev build.

### Scoop (Windows)

```powershell theme={null}
# Add the Kodexa bucket
scoop bucket add kodexa https://github.com/kodexa-ai/scoop-bucket

# Install kdx
scoop install kdx

# Verify installation
kdx --version
```

### Pre-release Builds (Windows)

To try the latest development build on Windows, install `kdx-dev` via Scoop. It installs as a separate binary so it can coexist with the stable `kdx`:

```powershell theme={null}
# Install the pre-release CLI
scoop install kdx-dev

# Verify installation
kdx-dev --version
```

Pre-release builds are updated automatically from the `develop` branch and may contain features or fixes not yet in the stable release. Use `scoop update kdx-dev` to get the latest dev build.

### Other Installation Methods

See the [full installation guide](/guides/kdx-cli/installation) for Docker, direct binary downloads, and building from source.

## Quick Start

### 1. Configure Authentication

**Recommended: Environment Variables**

Set environment variables for your Kodexa environments:

```bash theme={null}
export KODEXA_URL="https://platform.kodexa-enterprise.com"
export KODEXA_ACCESS_TOKEN="your-api-key-here"
```

Add these to your shell profile (`~/.bashrc`, `~/.zshrc`) to make them permanent.

**Alternative: Profiles**

You can also use profiles for managing multiple environments:

```bash theme={null}
kdx config set-profile local \
  --url http://localhost:8080 \
  --api-key your-api-key-here
```

For production (with safety prompts):

```bash theme={null}
kdx config set-profile prod \
  --url https://platform.kodexa-enterprise.com \
  --api-key your-production-api-key \
  --production
```

The `--production` flag enables confirmation prompts before destructive operations to prevent accidental changes.

### 2. Discover Resources

See what resources are available in your environment:

```bash theme={null}
kdx api-resources
```

### 3. List Resources

Use the `get` command to list resources:

```bash theme={null}
# List all workspaces
kdx get workspaces

# List all projects
kdx get projects

# List all stores
kdx get stores
```

### 4. Get Specific Resources

Retrieve details about a specific resource:

```bash theme={null}
kdx get workspace my-workspace
kdx describe workspace my-workspace
```

### 5. Create Resources

Create resources declaratively using YAML files:

```yaml workspace.yaml theme={null}
kind: workspace
name: engineering-workspace
description: Engineering team workspace
```

Apply the configuration:

```bash theme={null}
kdx create workspace -f workspace.yaml
```

## Working with Multiple Environments

Switch between profiles easily:

```bash theme={null}
# Switch to staging
kdx config use-profile staging

# Use production profile for a single command
kdx get workspaces --profile prod
```

## Output Formats

KDX CLI supports multiple output formats:

```bash theme={null}
# Interactive table (default for terminals)
kdx get workspaces

# JSON output (great for scripting)
kdx get workspaces -o json

# YAML output
kdx get workspaces -o yaml
```

## Getting Help

KDX CLI has built-in help for every command:

```bash theme={null}
# General help
kdx --help

# Command-specific help
kdx get --help
kdx config --help
```

## Configuration

All KDX CLI configuration is stored in `~/.kodexa/config.yaml`. The CLI now enforces secure defaults (config directory `0700`, file `0600`) so API keys are readable only by your user. Keep keys out of shell history and prefer profiles or environment variables over inlining secrets in commands.

## Validation & Safety

* Requests sent via `apply` and `run` are validated against the live OpenAPI schema before they reach the API, catching missing/invalid fields early.
* Production-marked profiles prompt before destructive actions; use `--skip-production-confirm` only for trusted automation.
* Module applies package implementation files into a temporary ZIP (unique per run) to avoid overwriting local files; the archive is cleaned up automatically.

## Plugins

Resource-specific plugins are registered automatically—no separate `kdx plugins` command is required. Current built-ins:

* `kdx project create --template <tpl> --org <org> --name <name>` to spin up projects from templates.

## Next Steps

<CardGroup cols={2}>
  <Card title="Full KDX CLI Guide" icon="book" href="/guides/kdx-cli/overview">
    Learn about all KDX CLI capabilities and features
  </Card>

  <Card title="Installation Guide" icon="download" href="/guides/kdx-cli/installation">
    Comprehensive installation options for all platforms
  </Card>

  <Card title="Profile Configuration" icon="gear" href="/guides/kdx-cli/profiles-configuration">
    Deep dive into profile management
  </Card>

  <Card title="Resource Operations" icon="terminal" href="/guides/kdx-cli/resource-operations">
    Learn advanced CRUD operations
  </Card>
</CardGroup>
