Use when the user wants to bind a Unit (or many Units) to a destination — a specific Kubernetes cluster+namespace, an ArgoCD Application, a Flux Kustomization, an OCI registry, a Tofu workspace. Phrases like "set up a target", "point this unit at my cluster", "bind these units to prod", "hook up Argo/Flux", "change the namespace this deploys to", "promote these to a different target". Creates or updates a Target with the right provider/toolchain and parameter JSON, attaches Units via cub unit set-target (or --where for bulk), and stops without applying — apply is cub-apply's job. Do not load for installing a worker (use worker-bootstrap first — Targets reference Workers), for running apply (use cub-apply), or for authoring the Unit's YAML (use config-as-data).
89
88%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Creates the binding between Units and destinations. Once bound, a Unit can be applied through cub-apply.
A Target is a named, parameterized binding that tells ConfigHub where a Unit's configuration should land. It references a Worker to do the execution and carries provider-specific parameters (e.g., for Kubernetes: KubeContext, KubeNamespace, WaitTimeout).
Best practice: one Target per Kubernetes cluster per Space, since a Target corresponds to a cluster. A Target can live in a different Space than the Units that use it (e.g., a shared targets Space).
--from-target / --from-target-space).worker-bootstrap).cub-apply).config-as-data / cub-mutate).cub organization list succeeds (proves a valid token; cub context get / cub info / cub version don't require one).cub worker list --space <worker-space>. If not, stop and route to worker-bootstrap.KubeContext value matches a context name the worker's kubeconfig knows about. If unsure, cub target access can verify.Kubernetes direct apply AND ArgoCDRenderer output)?Pick based on delivery model:
| Delivery model | Provider | Toolchain |
|---|---|---|
| Apply K8s YAML directly to a cluster | Kubernetes | Kubernetes/YAML |
| Emit ArgoCD Applications for Argo to deploy | ArgoCDRenderer | Kubernetes/YAML |
| Emit Flux resources for Flux to deploy | FluxRenderer | Kubernetes/YAML |
| Publish OCI artifacts for Argo to pull | ArgoCDOCI | Kubernetes/YAML |
| Render ConfigMap bundles | ConfigMapRenderer | various AppConfig/* |
Multi-provider targets: repeat --provider and --toolchain in matching positional order.
Parameters are a single JSON string passed positionally after the target slug. Known keys (Kubernetes provider):
KubeContext — kubeconfig context name the worker should use.KubeNamespace — default namespace for namespaced resources.WaitTimeout — how long apply waits for the resource to settle (2m0s, 30s).Other providers define their own keys. Check references/triggers-recipes.md and the ConfigHub docs for per-provider parameter sets.
cub target create <target-slug> \
'{"KubeContext":"kind-myapp-prod","KubeNamespace":"default","WaitTimeout":"2m0s"}' \
<worker-slug> \
--space <target-space> \
--provider kubernetes \
--toolchain Kubernetes/YAMLOr multi-provider:
cub target create <target-slug> \
'{"KubeContext":"kind-myapp-prod","KubeNamespace":"default"}' \
<worker-slug> \
--space <target-space> \
--provider kubernetes --toolchain Kubernetes/YAML \
--provider argocdrenderer --toolchain Kubernetes/YAML \
--option 'argoApplicationNamespace=argocd'Targets are not versioned configuration data — no --change-desc on create/update.
If you want specific Triggers to run when Units are applied through this Target (in addition to or instead of the Space's TriggerFilterID), attach a Trigger-filter to the Target:
cub target update <target-slug> --space <target-space> \
--trigger-filter platform/standard-vetsSingle Unit:
cub unit set-target <unit-slug> <target-slug> --space <app-space>Bulk:
cub unit set-target --space <app-space> --where "Labels.App = 'myapp'" <target-slug>Cross-Space target reference uses <target-space>/<target-slug> when the Target lives in a different Space.
Changing a Unit's target is not a configuration-data mutation — cub unit set-target doesn't take --change-desc. To record why the target changed, mutate the Unit's data in a deliberate step (e.g., update an annotation) with a proper --change-desc, or rely on the audit log.
Target is created and Units are attached. Next step is almost always cub-apply.
cub target create/update, cub unit set-target, cub unit update (only when recording target-change rationale in data).cub target get/list, cub target access (for kubecontext verification), cub worker list/get/list-function (to confirm the Worker supports the provider types this Target needs), cub unit livestate/livedata (to confirm a prior Target wasn't surprisingly live).kubectl apply or argocd app create directly.worker-bootstrap.KubeContext names a context the Worker's kubeconfig doesn't recognize. Fix before proceeding.cub unit set-target across --space "*" without a narrow --where. Ask the user to confirm blast radius.cub target get <target-slug> --space <target-space> — provider/toolchain/parameters match intent; worker slug is set.cub target access <target-slug> --space <target-space> — (for Kubernetes) temporary kubectl access confirms the Worker can reach the cluster.cub unit get <unit-slug> --space <app-space> — TargetID points at the expected Target.cub unit list --space <app-space> --where "TargetID IS NOT NULL" count matches the --where selection count.cub target get <target-slug> --space <target-space> --web — Target page in the GUI.cub unit get <unit-slug> --space <app-space> --web — Unit page shows Target binding and apply state.https://docs.confighub.com/markdown/background/entities/target.mdhttps://docs.confighub.com/markdown/guide/workers.mdreferences/cub-cli.md — CLI conventions.references/filters-and-queries.md — the TargetID IS NOT NULL field pattern for verifying bulk bindings.59ea831
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.