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

# CLI Reference

> Comprehensive guide to the Control Plane CLI for managing infrastructure, workloads, and resources.

The Control Plane CLI (`cpln`) provides a powerful command-line interface for managing organizations, GVCs, workloads, and all supporting resources.

> [!NOTE]
>
> Nearly everything you can do through the Console UI, API, or Terraform can also be done through the CLI. The CLI also provides powerful operations not available elsewhere, such as port forwarding, executing commands in containers, and converting Kubernetes manifests.

> [!TIP]
>
> Working with an AI assistant? The [Control Plane AI Plugin](https://docs.controlplane.com/ai/plugin.md) teaches Claude Code, Codex, and Antigravity CLI how to drive `cpln` correctly — including the resource command map, hallucination traps, and the multi-step workflows that the CLI doesn't bundle into single commands.

## Get started

> [card] [Installation](https://docs.controlplane.com/cli-reference/installation.md)
>
> Install via npm, Homebrew, or binary download

> [card] [Quickstart](https://docs.controlplane.com/cli-reference/get-started/quickstart.md)
>
> Get up and running in minutes

> [card] [Authentication](https://docs.controlplane.com/cli-reference/get-started/authentication.md)
>
> Log in with interactive or token-based flows

> [card] [Profiles](https://docs.controlplane.com/cli-reference/get-started/profiles.md)
>
> Manage multiple environments and contexts

## Quick reference

**1. Install the CLI**

> [tab] npm
>
> ```bash theme={null}
> npm install -g @controlplane/cli
> ```

> [tab] Homebrew
>
> ```bash theme={null}
> brew tap controlplane-com/cpln && brew install cpln
> ```

> [tab] Binary
>
> Download from the [Installation page](https://docs.controlplane.com/cli-reference/installation.md).

**2. Verify installation**

```bash theme={null}
cpln --version
```

**3. Authenticate**

```bash theme={null}
cpln login
```

The CLI prints a login URL and a confirmation code to complete sign-in from any browser. For unattended environments, see [Authentication](https://docs.controlplane.com/cli-reference/get-started/authentication.md).

**4. Explore commands**

```bash theme={null}
cpln --help
cpln <command> --help
```

Browse all commands in the **Commands** section.

## Using the CLI

> [card] [Getting Help](https://docs.controlplane.com/cli-reference/using-cli/help.md)
>
> Use built-in help to discover commands and flags

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

> [card] [Output Formats](https://docs.controlplane.com/cli-reference/using-cli/output.md)
>
> Control command output with JSON, YAML, and more

> [card] [Troubleshooting](https://docs.controlplane.com/cli-reference/using-cli/troubleshooting.md)
>
> Common issues and solutions

> [card] [Shell Completion](https://docs.controlplane.com/cli-reference/using-cli/shell-completion.md)
>
> Enable tab completion for commands and flags

> [card] [Common Workflows](#common-workflows)
>
> Deploy apps, manage secrets, debug workloads, and more

## CI/CD & automation

> [card] [CI/CD Usage](https://docs.controlplane.com/cli-reference/ci-cd-development/ci-cd.md)
>
> Automate deployments with service accounts

> [card] [Container Images](https://docs.controlplane.com/cli-reference/ci-cd-development/container-image.md)
>
> Run the CLI inside Docker containers

## CLI-only features

These operations are unique to the CLI and provide capabilities not available in the Console or API:

> [card] [cpln apply / delete](https://docs.controlplane.com/guides/cpln-apply.md)
>
> GitOps-style resource management from YAML/JSON files

> [card] [cpln convert](https://docs.controlplane.com/guides/cli/cpln-convert.md)
>
> Convert Kubernetes manifests to Control Plane format

> [card] [cpln helm](https://docs.controlplane.com/guides/cpln-helm.md)
>
> Deploy Helm charts directly to Control Plane

> [card] [cpln stack](https://docs.controlplane.com/guides/compose-deploy.md)
>
> Deploy Docker Compose applications to Control Plane

> [card] [cpln operator](https://docs.controlplane.com/guides/cli/cpln-operator.md)
>
> Manage the Kubernetes operator for Control Plane

> [card] [cpln port-forward](https://docs.controlplane.com/guides/cli/cpln-port-forward.md)
>
> Forward local ports to workloads for debugging

> [card] [cpln cp](https://docs.controlplane.com/guides/cli/cpln-cp.md)
>
> Copy files to and from workload containers

> [card] [cpln workload exec](https://docs.controlplane.com/guides/cli/workload/exec.md)
>
> Execute commands inside running containers

> [card] [cpln workload connect](https://docs.controlplane.com/guides/cli/workload/connect.md)
>
> Open an interactive shell in a workload container

> [card] [cpln image build --push](https://docs.controlplane.com/guides/push-image.md)
>
> Push images to Control Plane registry

> [card] [docker pull](https://docs.controlplane.com/guides/pull-image.md)
>
> Pull images from Control Plane registry

> [card] [cpln image copy](https://docs.controlplane.com/guides/copy-image.md)
>
> Copy images between registries or orgs

> [!TIP]
>
> Dive into all CLI-only features in the **Guides** section for detailed walkthroughs and examples.

## Common workflows

Learn by example with these common CLI workflows:

> [!NOTE]
>
> These examples assume you have a [profile configured](https://docs.controlplane.com/cli-reference/get-started/profiles.md) with a default org set.

> [accordion] Deploy an application
>
> > [tab] Local application
> >
> > Build and push your local application to Control Plane's image registry:
> >
> > ```bash bash theme={null}
> > # Create a GVC
> > cpln gvc create --name my-app-gvc --location aws-us-east-1
> >
> > # Build and push your image
> > cpln image build --name my-app:v1.0.0 --push
> >
> > # Create a workload using your image
> > cpln workload create \
> >   --name my-app \
> >   --gvc my-app-gvc \
> >   --image //image/my-app:v1.0.0 \
> >   --port 8080 \
> >   --public
> >
> > # View workload status
> > cpln workload get my-app --gvc my-app-gvc
> > ```
> >
> > > [!WARNING]
> > >
> > > The `--port 8080` must match the port your application exposes in its Dockerfile. Change this value to match your application's exposed port.
>
> > [tab] Public image
> >
> > Deploy using a public image from Docker Hub or another registry:
> >
> > ```bash bash theme={null}
> > # Create a GVC
> > cpln gvc create --name my-app-gvc --location aws-us-east-1
> >
> > # Create a workload with a public image
> > cpln workload create \
> >   --name my-app \
> >   --gvc my-app-gvc \
> >   --image nginx:latest \
> >   --port 80 \
> >   --public
> >
> > # View workload status
> > cpln workload get my-app --gvc my-app-gvc
> > ```
>
> See [Create Workload](https://docs.controlplane.com/cli-reference/commands/workload.md#workload-create) for detailed steps.

> [accordion] GitOps with cpln apply
>
> ```bash bash theme={null}
> # Export existing resources
> cpln gvc get my-gvc --output yaml-slim > gvc.yaml
> cpln workload get my-app --gvc my-gvc --output yaml-slim > workload.yaml
>
> # Edit files, then apply
> cpln apply --file gvc.yaml
> cpln apply --file workload.yaml --gvc my-gvc
> ```
>
> See [cpln apply](https://docs.controlplane.com/guides/cpln-apply.md) for GitOps workflows.

> [accordion] Manage secrets and identities
>
> Create a secret, grant a workload identity access to it via a policy, and inject it as an environment variable.
>
> ```bash bash theme={null}
> # Create a file containing the secret value
> echo "hello-world" > my-db-password.txt
>
> # Create an opaque secret from the file
> cpln secret create-opaque --name db-password \
>   --encoding plain \
>   --file my-db-password.txt
>
> # Create a GVC
> cpln gvc create --name my-gvc --location aws-us-east-1
>
> # Create an identity for your workload
> cpln identity create --name my-app-identity --gvc my-gvc
>
> # Create a policy targeting the secret
> cpln policy create --name my-app-secrets-policy \
>   --target-kind secret \
>   --resource db-password
>
> # Add a binding to grant the identity reveal permission
> cpln policy add-binding my-app-secrets-policy \
>   --identity //gvc/my-gvc/identity/my-app-identity \
>   --permission reveal
>
> # Create a workload with the identity attached and inject the secret as an env var
> cpln workload create \
>   --name my-app \
>   --gvc my-gvc \
>   --image nginx:latest \
>   --port 80 \
>   --identity my-app-identity \
>   --env DB_PASSWORD=cpln://secret/db-password.payload \
>   --public
>
> # Check workload status (and wait for the workload to become ready)
> cpln workload get my-app --gvc my-gvc
>
> # Verify the secret is available in the container
> cpln workload exec my-app --gvc my-gvc -- env | grep DB_PASSWORD
>
> # Expected output from the cpln workload exec command
> Defaulting to location 'aws-us-east-1' because no location was specified in the command.
> Defaulting to replica 'my-app-00001-deployment-6d67547b5d-586d9' because no replica was specified in the command.
> Defaulting to container 'nginx' because no container was specified in the command.
> DB_PASSWORD=hello-world
> ```
>
> See [Policy](https://docs.controlplane.com/reference/policy.md) for access control.

> [accordion] Build and push images
>
> ```bash bash theme={null}
> # Build and push
> cpln image build --name my-app:v1.0.0 --push
>
> # Or build remotely, without local Docker
> cpln image build --name my-app:v1.0.0 --remote
>
> # Update workload to use new image (replace <container-name>
> # with the acutal container name from your workload)
> cpln workload update my-app --gvc my-gvc \
>   --set spec.containers.<container-name>.image=//image/my-app:v1.0.0
> ```
>
> See [Push Image](https://docs.controlplane.com/guides/push-image.md) for details.

> [accordion] Debug a workload
>
> ```bash theme={null}
> # View logs
> cpln logs '{gvc="my-gvc", workload="my-app"}'
>
> # Execute commands in a container
> cpln workload exec my-app --gvc my-gvc -- ls -a
>
> # Forward a port for local testing
> cpln port-forward my-app 8080:8080 --gvc my-gvc
>
> # Copy files from a workload (assuming your workload is using nginx:latest image)
> cpln cp my-app:usr/share/nginx/html/index.html ./index.html --gvc my-gvc
> ```
>
> See [Workload Exec](https://docs.controlplane.com/guides/cli/workload/exec.md) and [Port Forward](https://docs.controlplane.com/guides/cli/cpln-port-forward.md).

## Command categories

The CLI organizes commands by resource type. Explore the **Commands** section for detailed reference on each command.

### Infrastructure

> [card] [gvc](https://docs.controlplane.com/cli-reference/commands/gvc.md)
>
> Global Virtual Clouds

> [card] [location](https://docs.controlplane.com/cli-reference/commands/location.md)
>
> Available locations

> [card] [org](https://docs.controlplane.com/cli-reference/commands/org.md)
>
> Organizations

### Workloads & compute

> [card] [workload](https://docs.controlplane.com/cli-reference/commands/workload.md)
>
> Manage workloads

> [card] [mk8s](https://docs.controlplane.com/cli-reference/commands/mk8s.md)
>
> Managed Kubernetes

> [card] [volumeset](https://docs.controlplane.com/cli-reference/commands/volumeset.md)
>
> Persistent volumes

### Images & containers

> [card] [image](https://docs.controlplane.com/cli-reference/commands/image.md)
>
> Container images

> [card] [stack](https://docs.controlplane.com/cli-reference/commands/stack.md)
>
> Docker Compose stacks

### Security & access

> [card] [secret](https://docs.controlplane.com/cli-reference/commands/secret.md)
>
> Secrets management

> [card] [policy](https://docs.controlplane.com/cli-reference/commands/policy.md)
>
> Access policies

> [card] [identity](https://docs.controlplane.com/cli-reference/commands/identity.md)
>
> Workload identities

### Users & accounts

> [card] [user](https://docs.controlplane.com/cli-reference/commands/user.md)
>
> User accounts

> [card] [group](https://docs.controlplane.com/cli-reference/commands/group.md)
>
> User groups

> [card] [serviceaccount](https://docs.controlplane.com/cli-reference/commands/serviceaccount.md)
>
> Service accounts

### Networking & domains

> [card] [domain](https://docs.controlplane.com/cli-reference/commands/domain.md)
>
> Custom domains

> [card] [ipset](https://docs.controlplane.com/cli-reference/commands/ipset.md)
>
> IP sets for firewall rules

### Infrastructure as code

> [card] [apply](https://docs.controlplane.com/cli-reference/commands/apply.md)
>
> Create/update from files

> [card] [delete](https://docs.controlplane.com/cli-reference/commands/delete.md)
>
> Delete from files

> [card] [convert](https://docs.controlplane.com/cli-reference/commands/convert.md)
>
> Convert K8s to Control Plane

### Operations & utilities

> [card] [logs](https://docs.controlplane.com/cli-reference/commands/logs.md)
>
> View logs

> [card] [port-forward](https://docs.controlplane.com/cli-reference/commands/port-forward.md)
>
> Forward ports to workloads

> [card] [cp](https://docs.controlplane.com/cli-reference/commands/cp.md)
>
> Copy files to/from workloads

> [card] [helm](https://docs.controlplane.com/cli-reference/commands/helm.md)
>
> Manage Helm releases

### Cloud & integrations

> [card] [cloudaccount](https://docs.controlplane.com/cli-reference/commands/cloudaccount.md)
>
> Cloud provider accounts

> [card] [agent](https://docs.controlplane.com/cli-reference/commands/agent.md)
>
> Control Plane agents

> [card] [auditctx](https://docs.controlplane.com/cli-reference/commands/auditctx.md)
>
> Audit contexts

### System & admin

> [card] [profile](https://docs.controlplane.com/cli-reference/commands/profile.md)
>
> CLI profiles

> [card] [login](https://docs.controlplane.com/cli-reference/commands/login.md)
>
> Authentication

> [card] [quota](https://docs.controlplane.com/cli-reference/commands/quota.md)
>
> Resource quotas

> [card] [task](https://docs.controlplane.com/cli-reference/commands/task.md)
>
> Pending tasks

> [card] [misc](https://docs.controlplane.com/cli-reference/commands/misc.md)
>
> Miscellaneous utilities

> [card] [rest](https://docs.controlplane.com/cli-reference/commands/rest.md)
>
> Direct REST API access

## Additional resources

> [card] [API Reference](https://docs.controlplane.com/api-reference/api.md)
>
> REST API documentation

> [card] [Concepts](https://docs.controlplane.com/concepts/org.md)
>
> Core platform concepts

> [card] [Terraform Provider](https://docs.controlplane.com/iac/terraform.md)
>
> Infrastructure as code with Terraform

## Get help

> [card] [Built-in Help](https://docs.controlplane.com/cli-reference/using-cli/help.md)
>
> Use `cpln --help` to explore commands

> [card] [Troubleshooting](https://docs.controlplane.com/cli-reference/using-cli/troubleshooting.md)
>
> Solutions to common issues
