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

# Output Formats

> Control how the CLI renders command results with different output formats.

Use the `--output` (or `-o`) flag to choose how command results are displayed. Different formats serve different purposes, from human-readable tables to machine-parseable JSON.

## Available formats

> [tab] text
>
> **Human-readable table format** (default)
>
> ```bash theme={null}
> cpln gvc get
> ```
>
> Best for:
>
> * Interactive terminal use
>
> * Quick visual scanning
>
> * Development and debugging
>
> > [!NOTE]
> >
> > Text output may truncate long values. Use `json` or `yaml` for complete data.

> [tab] json
>
> **Complete JSON output**
>
> ```bash theme={null}
> cpln gvc get --output json
> ```
>
> Best for:
>
> * Programmatic parsing with `jq`
> * Automation scripts
> * Inspecting all resource properties
>
> ```bash View specific field theme={null}
> cpln gvc get my-gvc -o json | jq '.spec.staticPlacement.locationLinks'
> ```
>
> ```bash Format with jq theme={null}
> cpln workload get -o json | jq -r '.items[].name'
> ```

> [tab] yaml
>
> **Complete YAML output**
>
> ```bash theme={null}
> cpln gvc get --output yaml
> ```
>
> Best for:
>
> * Human-readable structured data
> * Inspecting nested configurations
> * Exporting for documentation
>
> ```bash Save to file theme={null}
> cpln gvc get my-gvc -o yaml > my-gvc.yaml
> ```
>
> ```bash Parse with yq theme={null}
> cpln gvc get -o yaml | yq '.items[].name'
> ```

> [tab] json-slim / yaml-slim
>
> **Simplified output without metadata**
>
> ```bash theme={null}
> cpln gvc get my-gvc --output json-slim
> cpln gvc get my-gvc --output yaml-slim
> ```
>
> Removes non-essential properties:
>
> * IDs
> * Versions
> * Timestamps
> * System-generated metadata
>
> Best for:
>
> * Creating templates for `cpln apply`
> * GitOps configurations
> * Copying resources between environments
>
> ```bash theme={null}
> cpln gvc get my-gvc -o yaml-slim > gvc-template.yaml
> ```

> [tab] tf
>
> **Terraform HCL format**
>
> ```bash theme={null}
> cpln gvc get my-gvc --output tf
> ```
>
> Best for:
>
> * Generating Terraform configurations
> * Migrating from CLI to Terraform
> * Infrastructure as Code workflows
>
> See [Terraform Provider](https://docs.controlplane.com/iac/terraform.md) for details.

> [tab] crd
>
> **Kubernetes Custom Resource Definition (K8s CRD) format**
>
> ```bash theme={null}
> cpln workload get my-workload --output crd
> ```
>
> Best for:
>
> * Kubernetes operator workflows
> * K8s-native GitOps (e.g. ArgoCD)
> * Hybrid Kubernetes/Control Plane setups
>
> See [Kubernetes Operator](https://docs.controlplane.com/core/kubernetes-operator.md) for details.

> [tab] names
>
> **Resource names only**
>
> ```bash theme={null}
> cpln gvc get --output names
> ```
>
> Best for:
>
> * Scripts and automation
> * Piping to other commands
> * Quick listing

## Output modifiers

### Limit results with `--max`

Control the number of records displayed:

```bash theme={null}
cpln workload get --max 10
```

* Default: `50`
* Values less than 1 return all records

### Format timestamps with `--ts`

Control timestamp formatting in text output:

```bash ISO 8601 format theme={null}
cpln workload get --ts iso
```

```bash Local timezone theme={null}
cpln workload get --ts local
```

```bash Relative time theme={null}
cpln workload get --ts age
# Output: "2 hours ago"
```

> [!NOTE]
>
> The `--ts` flag only applies when `--output=text`.

### Disable color with `--color`

Remove ANSI color codes from output:

```bash theme={null}
cpln gvc get --color=false
```

Useful for:

* Logging to files
* CI/CD environments
* Systems that don't support colored output

> [!NOTE]
>
> Color is automatically disabled when stdout is not a terminal.

## Common use cases

### Export a resource for GitOps

```bash theme={null}
cpln gvc get production-gvc --output yaml-slim > production-gvc.yaml
```

Edit the file, then apply:

```bash theme={null}
cpln apply --file production-gvc.yaml
```

### Parse JSON with jq

Extract specific fields:

```bash Get location links theme={null}
cpln gvc get my-gvc -o json | jq -r '.spec.staticPlacement.locationLinks[]'
```

```bash List workload images theme={null}
cpln workload get -o json --gvc my-gvc | \
  jq -r '.items[].spec.containers[].image'
```

### Convert to Terraform

Export existing resources to Terraform format:

```bash theme={null}
cpln gvc get my-gvc -o tf > main.tf
cpln workload get my-app --gvc my-gvc -o tf > main.tf
```

## Troubleshooting output

> [accordion] Output is truncated
>
> Text output truncates long values for readability. Use `json` or `yaml` to see complete data:
>
> ```bash theme={null}
> cpln gvc get my-gvc --output json
> ```

> [accordion] Color codes in logs
>
> Disable color for cleaner logs:
>
> ```bash theme={null}
> cpln <command> --color=false
> ```
>
> Or redirect stderr to remove color automatically:
>
> ```bash theme={null}
> cpln <command> 2>&1 | tee output.log
> ```

> [accordion] Too many results
>
> Limit output with `--max`:
>
> ```bash theme={null}
> cpln workload get --max 20
> ```
>
> Or use query filters to narrow results:
>
> ```bash theme={null}
> cpln workload query --tag environment=production
> ```

## Next steps

> [card] [Common Options](https://docs.controlplane.com/cli-reference/using-cli/common-options.md)
>
> Learn about all shared CLI flags

> [card] [cpln apply](https://docs.controlplane.com/guides/cpln-apply.md)
>
> Use slim output for GitOps workflows
