From 54d3a6fe24df1c019d6b367aa5d140c8b277b4aa Mon Sep 17 00:00:00 2001 From: adamwg <414574+adamwg@users.noreply.github.com> Date: Mon, 15 Jun 2026 19:22:53 +0000 Subject: [PATCH] Update master CLI reference docs for v2.4.0-rc.0.83.g3cbfbf6 --- content/cli/master/command-reference.md | 188 +++++++++++++++++++++++- 1 file changed, 186 insertions(+), 2 deletions(-) diff --git a/content/cli/master/command-reference.md b/content/cli/master/command-reference.md index 5639a710c..50f6c5f7a 100644 --- a/content/cli/master/command-reference.md +++ b/content/cli/master/command-reference.md @@ -11,7 +11,7 @@ description: "Command reference for the Crossplane CLI" -This documentation is for the `crossplane` CLI v2.3.0. +This documentation is for the `crossplane` CLI `v2.4.0-rc.0.83.g3cbfbf6`. @@ -1770,6 +1770,14 @@ Skip success log lines (only print problems): crossplane resource validate extensionsDir/ resourceDir/ --skip-success-results ``` +Emit machine-readable results (JSON or YAML) for piping to `jq`, scripts, or +CI systems. The structured payload includes per-resource status and +field-level error details: + +```shell +crossplane resource validate extensionsDir/ resourceDir/ --output json | jq . +``` + Validate the output of render against extensions in a directory: ```shell @@ -1806,6 +1814,7 @@ crossplane resource validate [flags] | | `--clean-cache` | Clean the cache directory before downloading package schemas. | | | `--crossplane-image=STRING` | Specify the Crossplane image for validating built-in schemas. | | | `--error-on-missing-schemas` | Return non zero exit code if missing schemas. | +| `-o` | `--output=text` | Output format for validation results (text, json, or yaml). | | | `--skip-success-results` | Skip printing success results. | | | `--update-cache` | Update cached schemas by downloading the latest version that satisfies a constraint. May be useful if you are using semantic version constraints and want to get the latest version, but this slows down the cache lookup due to the required network calls. | {{< /table >}} @@ -2047,9 +2056,9 @@ repository as a template. Specify either a full Git URL or one of the following names as the template: +- `configuration-template` ([https://github.com/crossplane/configuration-template](https://github.com/crossplane/configuration-template)) - `function-template-go` ([https://github.com/crossplane/function-template-go](https://github.com/crossplane/function-template-go)) - `function-template-python` ([https://github.com/crossplane/function-template-python](https://github.com/crossplane/function-template-python)) -- `configuration-template` ([https://github.com/crossplane/configuration-template](https://github.com/crossplane/configuration-template)) - `provider-template` ([https://github.com/crossplane/provider-template](https://github.com/crossplane/provider-template)) - `provider-template-upjet` ([https://github.com/crossplane/upjet-provider-template](https://github.com/crossplane/upjet-provider-template)) @@ -2336,6 +2345,181 @@ crossplane xpkg update [] {{< /table >}} + + +## crossplane xr + + + +[ALPHA] Work with Crossplane Composite Resources (XRs). + +{{}} +Alpha features are experimental and may change or disappear in a future release. +{{< /hint >}} + +### Usage + +``` +crossplane xr [flags] +``` + + + +### crossplane xr generate + + + +[ALPHA] Generate a Composite Resource (XR) from a Claim. + +{{}} +Alpha features are experimental and may change or disappear in a future release. +{{< /hint >}} + +The `xr generate` command creates a Composite Resource (XR) from a Claim YAML. + +It reads the Claim from a file (or stdin), produces an XR (same spec, derived +kind, optional Claim reference), and writes the result to stdout or to a file. + +#### Examples + +Generate an XR from `claim.yaml` and print it to stdout (kind is `X` + Claim's +kind): + +```shell +crossplane xr generate claim.yaml +``` + +Generate an XR from `claim.yaml` and write it to `xr.yaml`: + +```shell +crossplane xr generate claim.yaml -o xr.yaml +``` + +Generate an XR with an explicit name (overrides the default suffix or Claim +name): + +```shell +crossplane xr generate claim.yaml --name my-xr +``` + +Generate an XR with a specific kind: + +```shell +crossplane xr generate claim.yaml --kind MyCompositeResource +``` + +Generate a directly linked XR (no Claim reference, no name suffix): + +```shell +crossplane xr generate claim.yaml --direct +``` + +Generate an XR with a fresh random `metadata.uid`: + +```shell +crossplane xr generate claim.yaml --gen-uid +``` + +Use in `crossplane render`: + +```shell +crossplane render <(crossplane xr generate claim.yaml) composition.yaml functions.yaml +``` + +Read the Claim from stdin: + +```shell +cat claim.yaml | crossplane xr generate - +``` + +#### Usage + +``` +crossplane xr generate [] [flags] +``` +#### Arguments + +{{< table "table table-sm table-striped" >}} +| Argument | Description | +|----------|-------------| +| `[]` | *(optional)* The Claim YAML file to convert, or '-' for stdin. | +{{< /table >}} + +#### Flags + +{{< table "table table-sm table-striped" >}} +| Short flag | Long flag | Description | +|------------|-----------|-------------| +| `-o` | `--output-file=PATH` | The file to write the generated XR YAML to. Defaults to stdout. | +| | `--name=NAME` | The name to use for the XR. If empty, defaults to the Claim's name (direct mode) or the Claim's name with a random suffix (non-direct). | +| | `--kind=KIND` | The kind to use for the XR. Defaults to 'X' prepended to the Claim's kind (for example, Infra -> XInfra). | +| | `--direct` | Create a direct XR without Claim references and suffix. | +| | `--gen-uid` | Set a fresh random metadata.uid on the generated XR. | +{{< /table >}} + + + + +### crossplane xr patch + + + +[ALPHA] Patch a Composite Resource (XR). + +{{}} +Alpha features are experimental and may change or disappear in a future release. +{{< /hint >}} + +The `xr patch` command applies XR-level patches to a Composite Resource (XR). + +It reads the XR from a file (or stdin), applies the requested patches, and +writes the result to stdout or to a file. Pass at least one patching flag; +today the only one is `--xrd`, which applies default values from an XRD's +`openAPIV3Schema` to the XR. Future releases add more patching flags. + +#### Examples + +Apply default values from an XRD to an XR: + +```shell +crossplane xr patch xr.yaml --xrd xrd.yaml +``` + +Patch an XR from stdin: + +```shell +cat xr.yaml | crossplane xr patch - --xrd xrd.yaml +``` + +Write the patched XR to a file: + +```shell +crossplane xr patch xr.yaml --xrd xrd.yaml -o patched.yaml +``` + +#### Usage + +``` +crossplane xr patch [] [flags] +``` +#### Arguments + +{{< table "table table-sm table-striped" >}} +| Argument | Description | +|----------|-------------| +| `[]` | *(optional)* The XR YAML file to patch, or '-' for stdin. | +{{< /table >}} + +#### Flags + +{{< table "table table-sm table-striped" >}} +| Short flag | Long flag | Description | +|------------|-----------|-------------| +| `-o` | `--output-file=PATH` | The file to write the patched XR YAML to. Defaults to stdout. | +| | `--xrd=PATH` | A YAML file specifying the CompositeResourceDefinition (XRD) that provides schema defaults for the XR. | +{{< /table >}} + + ## crossplane xrd