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

<Tabs>
  <Tab title="text">
    **Human-readable table format** (default)

    ```bash theme={null}
    cpln gvc get
    ```

    Best for:

    * Interactive terminal use
    * Quick visual scanning
    * Development and debugging

    <Info>
      Text output may truncate long values. Use `json` or `yaml` for complete data.
    </Info>
  </Tab>

  <Tab title="json">
    **Complete JSON output**

    ```bash theme={null}
    cpln gvc get --output json
    ```

    Best for:

    * Programmatic parsing with `jq`
    * Automation scripts
    * Inspecting all resource properties

    <CodeGroup>
      ```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'
      ```
    </CodeGroup>
  </Tab>

  <Tab title="yaml">
    **Complete YAML output**

    ```bash theme={null}
    cpln gvc get --output yaml
    ```

    Best for:

    * Human-readable structured data
    * Inspecting nested configurations
    * Exporting for documentation

    <CodeGroup>
      ```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'
      ```
    </CodeGroup>
  </Tab>

  <Tab title="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>

  <Tab title="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](/iac/terraform) for details.
  </Tab>

  <Tab title="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](/core/kubernetes-operator) for details.
  </Tab>

  <Tab title="names">
    **Resource names only**

    ```bash theme={null}
    cpln gvc get --output names
    ```

    Best for:

    * Scripts and automation
    * Piping to other commands
    * Quick listing
  </Tab>
</Tabs>

## 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:

<CodeGroup>
  ```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"
  ```
</CodeGroup>

<Note>
  The `--ts` flag only applies when `--output=text`.
</Note>

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

<Info>
  Color is automatically disabled when stdout is not a terminal.
</Info>

## 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:

<CodeGroup>
  ```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'
  ```
</CodeGroup>

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

<AccordionGroup>
  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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
    ```
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Common Options" href="/cli-reference/using-cli/common-options" icon="sliders">
    Learn about all shared CLI flags
  </Card>

  <Card title="cpln apply" href="/guides/cpln-apply" icon="code">
    Use slim output for GitOps workflows
  </Card>
</CardGroup>
