Cpln

From controlplane-com/ai-plugin · View interactive version

Cpln is an AI agent skill from the GitHub repository controlplane-com/ai-plugin. Writes cpln CLI commands and workflows for Control Plane. Use when the user asks about cpln login, cpln apply, cpln workload, CLI or CI/CD deploys, container debugging with cpln exec/logs, or any cpln resource command.

How to use this skill

Skill file

cpln CLI

MCP first; the CLI covers what the MCP cannot. With the MCP connected, its tools do every operation they cover, reads included; the CLI is for the CLI-only operations below (building a folder on disk among them), interactive debugging, scripted GitOps, and sessions without the MCP. A connected MCP that is signed out means the user signs in again, not a switch to the CLI. In CI/CD the CLI is the primary interface: pipelines authenticate with a service-account key in CPLN_TOKEN, build and push images (cpln image build --push, or --remote on a runner with no Docker daemon), and apply resources (cpln apply --ready). Platform rules (resource model, secrets, destructive ops, production defaults, scale-to-zero, firewall) live in the operating-guide skill (through the MCP: get_cpln_skill with skill: "operating-guide"); this skill is the CLI mechanics.

Never write a cpln command from memory. In a shell on the user's machine, verify every verb and flag with cpln <command> --help before quoting it. A chat app (ChatGPT, Claude web and desktop) has no cpln to run, its code sandbox included: never look for or install it there; quote commands from this skill for the user to run on their machine. If a command isn't in the resource command map below, assume it isn't real.

CLI-only operations

No MCP equivalent — the CLI's primary job:

| Command | Purpose |

|---|---|

| cpln image build | Build a container image — locally with Docker, or on Control Plane with --remote (no daemon) — and push to the org registry |

| cpln image copy | Copy an image between orgs |

| cpln port-forward | Forward local ports to a running workload |

| cpln convert | Convert Kubernetes manifests to Control Plane specs (Compose is cpln stack) |

| cpln cp | Copy files in or out of a running container |

| cpln apply | Scripted GitOps — declarative create-or-update from files |

One-shot and interactive container commands, TTY sessions (workload connect, exec -it), and streamed logs (cpln logs --tail) are also CLI-only; MCP's get_workload_logs covers bounded log fetches. Everything else — discovery and CRUD — prefer the MCP tools (generic mcp__cpln__list_resources / get_resource / delete_resource with a kind, typed create_*/update_* for mutations).

When no MCP tool covers a resource, field, or sub-endpoint, use the cpln CLI for that piece (ground the command in this skill, and in --help where you can run it) or tell the user what is missing.

Setup & auth

cpln login                                       # interactive (opens a browser); creates the "default" profile
cpln profile update default --org ORG --gvc GVC  # set defaults ("update" creates the profile if missing)

CI/CD needs no profile. With CPLN_TOKEN set (service-account key, from cpln serviceaccount add-key), the CLI runs a profile-less session against api.cpln.io. Add CPLN_ORG / CPLN_GVC for defaults and CPLN_SKIP_UPDATE_CHECK=1 to silence update checks. Resolution everywhere is flag, then env var, then profile: --org beats CPLN_ORG beats the profile default — same for --gvc/CPLN_GVC, --profile/CPLN_PROFILE, --endpoint/CPLN_ENDPOINT, --token/CPLN_TOKEN. Profiles live in ~/.config/cpln (override with CPLN_HOME).

Never pass --token — it leaks into logs and shell history; use CPLN_TOKEN or a profile. Inspect context with cpln profile get — there is no cpln whoami. cpln profile token prints the profile's live access JWT, a live credential: never run it or suggest it, since its output would land in the conversation; a user who asks for the token runs it in their own terminal. Secret data commands belong to the user: never run cpln secret reveal, cpln secret create-*, or cpln secret edit yourself; a user may run cpln secret create-* --file with a value they hold. Explain any profile state changes so operators can revert them.

Command structure & shared flags

cpln <resource> <action> [REF] [--flags]

Standalone (break the pattern): cpln apply, delete, logs, port-forward, cp, convert, login. Aliases: workload=w, identity=id, serviceaccount=sa, location=loc, stack=compose. Shell completion: cpln misc install-completion (bash/zsh/fish).

Flags on nearly every command — never list per-command:

Standard CRUD

| Action | Syntax | Notes |

|---|---|---|

| List | cpln <resource> get | No args = list all. There is NO list subcommand. |

| Get | cpln <resource> get REF... | |

| Create | cpln <resource> create --name NAME | Also --description, --tag K=V |

| Delete | cpln <resource> delete REF... | Multiple refs |

| Edit | cpln <resource> edit REF | Opens YAML in $EDITOR. --replace replaces instead of merging |

| Patch | cpln <resource> patch REF --file FILE | |

| Tag | cpln <resource> tag REF... --tag K=V | Remove: --remove-tag KEY |

| Update | cpln <resource> update REF --set PROP=VAL | Also --unset PROP; array props take += / = / -= |

| Clone | cpln <resource> clone REF --name NEW | Spec only. Not on every kind (map below) |

| Audit | cpln <resource> audit [REF] | --since (default 7d), --from/--to, --subject, --context |

| Query | cpln <resource> query | See below |

Also on most kinds: access-report REF, eventlog REF, permissions (no args). eventlog has the alias log — cpln workload log shows platform events, NOT container logs (those come from cpln logs).

Query

cpln workload query --match all --tag environment=production --tag region=europe
cpln workload query --match any --rel gvc=gvc-a --rel gvc=gvc-b
cpln workload query --property name=my-workload

--match (all default / any / none); --tag KEY=VALUE, --property/--prop NAME=VALUE (e.g. status.phase=running), --rel KIND=VALUE — all repeatable. The gvc, policy, and group create commands accept --query-match/--query-tag/--query-property/--query-rel (group also --query-kind user) for dynamic targeting. Full language: query-spec skill.

Resource command map

Core anti-hallucination reference. Scope: org = needs --org; gvc = needs --org + --gvc; local = no API call. "Full" = create, get, delete, edit, patch, tag, update (audit, eventlog, query, access-report, permissions exist nearly everywhere).

| Resource | Scope | CRUD | Non-standard subcommands |

|---|---|---|---|

| workload (w) | gvc | Full + clone | connect, exec, run, cron (get/run/start/stop), replica (get/stop), force-redeployment, get-deployments, open, start, stop |

| gvc | org | Full + clone | add-location, remove-location (both --location, repeatable), delete-all-workloads |

| secret | org | get only — secret data and lifecycle are managed by the user | — |

| policy | org | Full + clone | add-binding, remove-binding |

| identity (id) | gvc | Full, no clone | — |

| volumeset | gvc | Full, no clone | expand, shrink, snapshot (create/delete/get/restore), volume (delete/get) |

| domain | org | create, delete, edit, patch, tag — no update, no clone | — |

| cloudaccount | org | No generic create, no update | create-aws, create-azure, create-gcp, create-ngs |

| image | org | get, delete, edit, patch, tag only | build, copy, docker-login |

| agent | org | Full, no clone | info, manifest, up |

| group | org | Full + clone | add-member, remove-member (--email, --serviceaccount) |

| ipset | org | Full + clone | add-location, remove-location, update-location |

| serviceaccount (sa) | org | No update; clone | add-key (--description required), remove-key |

| mk8s | org | No create; clone | dashboard, health, join, kubeconfig |

| user | org | No create | invite (--email, optional --group) |

| org | — | create (needs --accountId, --invitee); no delete | — |

| profile | local | get, delete, update (creates if missing; alias create) | login, set-default, token |

| helm | gvc | — | install (alias apply), upgrade, uninstall, get, list, history, rollback, template |

| stack (compose) | gvc | — | deploy (alias up), manifest, rm (alias down) |

| location (loc) | org | create, delete (BYOK locations only), edit, patch — no update | install, uninstall |

| auditctx | org | Full + clone, no delete | — |

| quota | org | get, edit, patch | — |

| task | org | get, delete | complete, get-mine |

| account | — | get only | — |

| rest | — | — | get, post, put, patch, delete, create, edit against raw API paths |

| operator | local | — | install, uninstall |

Non-standard commands

cpln apply / cpln delete

cpln apply --file ./manifests/ --gvc GVC --ready   # DIRECTORY — recursive over .yaml/.yml/.json
cpln apply --file all.yaml --ready                 # MULTI-DOC file (resources split by ---)
cpln apply --file - < manifest.yaml                # stdin
cpln delete --file manifest.yaml                   # delete the resources listed in a file

Apply multi-resource deploys in one call (directory or multi-doc file) — the CLI sorts resources into dependency order before applying: agent, secret, cloudaccount, gvc, identity, volumeset, policy, workload (other kinds after); cpln delete --file runs the same order reversed. Splitting into multiple calls reintroduces the ordering problem. Apply is a PUT upsert — it prints Created/Updated per resource. It does not stop at the first failure: it applies every resource, then aborts with all failures at once, so a later references non-existent X error is normally a cascade of an earlier resource being rejected, not an ordering bug. Fix the first failure and re-apply the whole bundle. --ready polls workloads (5s interval, up to 5 min) until ready. --k8s converts Kubernetes manifests inline (Deployment/Secret/ConfigMap/PVC; pull secrets get linked onto the GVC).

GVC targeting for GVC-scoped resources:

kind: workload
name: my-app
gvc: prod          # target GVC declared inline
spec: { ... }

cpln logs

cpln logs '{gvc="GVC", workload="WORKLOAD"}' --org ORG --tail

cpln workload create

cpln workload create --name WORKLOAD --image IMAGE --gvc GVC [flags]

--type (serverless|standard, default standard) — stateful and cron CANNOT be created via CLI flags; use cpln apply --file. Other flags: --port (default 8080 — must match the container's listening port), --public, --identity, --env KEY=VALUE, --cpu (default 50m), --memory/--mem (default 128Mi), --volume, --container-name, --inherit-env. Internal images: //image/NAME:TAG.

Debugging — exec / connect / run / cron / replica

When --location / --replica / --container are omitted, the CLI defaults to the GVC's first location, the first replica, and the only container (multi-container: the first one with ports, else the first) — it prints a "defaulting to" notice. Pass all three explicitly on multi-location or multi-container workloads.

cpln policy add-binding

cpln policy add-binding POLICY --permission reveal --identity //gvc/GVC/identity/ID

--permission required; at least one principal flag required; all repeatable (--email, --serviceaccount, --group, --identity — name or full link).

cpln port-forward / cp

cpln port-forward WORKLOAD [LOCAL:]REMOTE... --gvc GVC   # --address (default localhost), --location, --replica
cpln cp LOCAL WORKLOAD:PATH --gvc GVC                    # reverse the args (WORKLOAD:PATH LOCAL) to copy out; --container, --location, --replica

Migration tools

Volumeset command verbs

Dedicated verb per operation; the flags are singular — --location, --volume-index (plural forms don't exist):

| Operation | Command | Risk |

|---|---|---|

| Expand volume | cpln volumeset expand REF --new-size GIB [--location LOC] [--volume-index N] | Safe |

| Create snapshot | cpln volumeset snapshot create REF --snapshot-name NAME [--location LOC] [--volume-index N] | Safe |

| Restore snapshot | cpln volumeset snapshot restore REF --snapshot-name NAME --location LOC --volume-index N (all required) | Overwrites volume state |

| Delete snapshot | cpln volumeset snapshot delete REF --snapshot-name NAME | Destructive |

| Delete volume | cpln volumeset volume delete REF [--location LOC] [--volume-index N] | Destructive (data loss) |

| Shrink volume | cpln volumeset shrink REF --new-size GIB [--location LOC] | DESTRUCTIVE (replaces the volume and restarts the replica) |

| Copy volume | no CLI verb: run_volumeset_command with copyVolume, or POST .../volumeset/NAME/-command with type: copyVolume | DESTRUCTIVE (deletes the volume at the destination index) |

shrink copies the data with rsync onto a new, smaller volume (the replica restarts for the final sync), then deletes the old one. It runs on ext4/xfs (not shared). The platform refuses a size below the volume set's initialCapacity or below used bytes plus 5% (HTTP 400), and a shrink that fails keeps the old volume. Apply the destructive-op confirmation from the operating guide first, and snapshot as a recovery point. Detail: stateful-storage skill.

Commands that don't exist

| Wrong | Correct |

|---|---|

| cpln <resource> list | cpln <resource> get (no args = list all) |

| cpln logs --follow | cpln logs --tail (or -t / -f) |

| cpln workload log for container logs | that's the eventlog alias (platform events); container logs = cpln logs '{gvc="GVC", workload="W"}' |

| cpln cloudaccount create | cpln cloudaccount create-aws / create-azure / create-gcp / create-ngs |

| cpln mk8s create | cpln apply --file mk8s-manifest.yaml |

| cpln workload update REF --identity X | cpln workload update REF --set spec.identityLink=//identity/X |

| cpln gvc update REF --location LOC | cpln gvc add-location REF --location LOC |

| cpln identity clone | identity has no clone — get -o yaml-slim, edit the name, cpln apply |

| cpln volumeset ... --locations / --volume-indexes | singular: --location, --volume-index |

| cpln whoami | cpln profile get (context) / cpln account get |

Building & referencing images

cpln image build puts an image in the org's private registry — the registry referenced in workload specs as //image/NAME:TAG. Two ways to run it:

cpln image build --name my-app:v1.0 --remote   # builds on Control Plane, pushes for you — no Docker
cpln image build --name my-app:v1.0 --push     # builds through the local Docker daemon

Image reference rules in workload specs:

| Source | Reference in spec | Pull secret? |

|---|---|---|

| Your org's registry (internal) | //image/NAME:TAG — never the ORG.registry.cpln.io hostname | No |

| Public Docker Hub | bare name (nginx:latest) — never add docker.io/ | No |

| Other public registry | exact host path (gcr.io/..., ghcr.io/...) | No |

| External private registry (ECR, GCR, ACR, private Docker Hub, another CPLN org) | exact host path | Yes — docker/ecr/gcp secret on GVC spec.pullSecretLinks |

Full image workflow (remote vs local build detail, buildx fallback, cross-org copy, pull-secret setup): image skill.

Workflow: Deploy a workload

The CLI runbook (also the CI/CD path):

cpln gvc create --name my-gvc --location aws-us-west-2 --org my-org
cpln image build --name my-app:v1.0 --push          # or --remote, with no Docker daemon
cpln workload create --name my-app --gvc my-gvc --image //image/my-app:v1.0 --port 8080 --public
cpln workload get-deployments my-app --gvc my-gvc   # verify readiness

Workflow: Grant secret access (3 steps)

The 3-step rule (identity + policy + reference) is owned by the operating guide. The secret must already exist (create_secret, or the manifest path in setup-secret). CLI fallback:

cpln identity create --name my-app-identity --gvc my-gvc --org my-org
cpln workload update my-app --gvc my-gvc --set spec.identityLink=//identity/my-app-identity
cpln policy create --name secret-access --target-kind secret --resource db-password --org my-org
cpln policy add-binding secret-access --permission reveal \
  --identity //gvc/my-gvc/identity/my-app-identity --org my-org
cpln workload update my-app --gvc my-gvc \
  --set spec.containers.main.env.DB_PASSWORD.value=cpln://secret/db-password.payload

Workflow: GitOps with cpln apply

cpln gvc get my-gvc -o yaml-slim > manifests/gvc.yaml              # export (slim strips server fields)
cpln workload get my-app --gvc my-gvc -o yaml-slim > manifests/workload.yaml
cpln apply --file ./manifests/ --gvc my-gvc --ready                # idempotent; run on every push

Workflow: Rename or clone (names are immutable)

No rename exists. Preferred — clone (on workload, gvc, policy, group, ipset, serviceaccount, mk8s, auditctx; duplicates spec only; secrets are off-limits — the user clones them):

cpln workload clone old-name --name new-name --gvc my-gvc
cpln workload get-deployments new-name --gvc my-gvc      # verify healthy
cpln workload delete old-name --gvc my-gvc               # only after verification

Kinds without clone (identity, volumeset, domain, agent): get -o yaml-slim, edit the name, cpln apply. Renaming a workload changes its internal hostname (WORKLOAD.GVC.cpln.local) and public URL — update domain routes (spec.ports[].routes[].workloadLink), policy targetLinks/targetQuery, internal-DNS callers, and external clients. Never delete the old workload before the new one is verified healthy.

Workflow: Debug a failing workload

cpln logs '{gvc="my-gvc", workload="my-app"}' --org my-org --tail        # stream logs
cpln logs '{gvc="my-gvc", workload="my-app"} |= "error"' --org my-org    # filter (LogQL, not a shell pipe)
cpln workload exec my-app --gvc my-gvc -- ls /app                        # inspect the container filesystem
cpln workload connect my-app --gvc my-gvc                                # interactive shell
cpln port-forward my-app 8080:8080 --gvc my-gvc                          # probe locally

Cron workloads — query logs per execution, not per workload. A plain {gvc=, workload=} query mixes every past run. Enumerate executions with cpln workload cron get NAME --gvc GVC, then scope the LogQL with the replica label plus a time window. Full pattern: logql-observability skill.

Platform rules & integration

Scale-to-zero/autoscaling, production defaults/probes, Template Catalog first, destructive ops, secrets, and firewall rules live in the operating guide and their dedicated skills, not duplicated here. Before authoring any apply YAML / CI manifest / API body, call get_resource with schema: true. IaC: Terraform (controlplane-com/cpln provider), Pulumi (@pulumiverse/cpln), K8s Operator (cpln operator install). Docs index for agents: https://docs.controlplane.com/llms.txt

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.