|
| 1 | +--- |
| 2 | +weight: 50 |
| 3 | +title: CLI Overview |
| 4 | +description: "Command-line tools for Crossplane development" |
| 5 | +cascade: |
| 6 | + version: "2.4" |
| 7 | +--- |
| 8 | + |
| 9 | +The Crossplane CLI helps simplify some development and administration aspects of |
| 10 | +Crossplane. |
| 11 | + |
| 12 | +The Crossplane CLI includes commands for: |
| 13 | + |
| 14 | +* building, installing, updating and pushing Crossplane Packages |
| 15 | +* building platforms using Crossplane Projects |
| 16 | +* testing and rendering standalone Composition Functions without the need to |
| 17 | + access a Kubernetes cluster running Crossplane |
| 18 | +* troubleshooting Crossplane Compositions, Composite Resources and Managed |
| 19 | + Resources |
| 20 | + |
| 21 | +## Installing the CLI |
| 22 | + |
| 23 | +The Crossplane CLI is a single standalone binary with no external |
| 24 | +dependencies. Some commands, such as `crossplane composition render` and |
| 25 | +`crossplane project build`, do require a Docker compatible container runtime. |
| 26 | + |
| 27 | +{{<hint "note" >}} |
| 28 | +Install the Crossplane CLI on a user's computer. |
| 29 | + |
| 30 | +Most Crossplane CLI commands are independent of Kubernetes and |
| 31 | +don't require access to a Crossplane pod. |
| 32 | +{{< /hint >}} |
| 33 | + |
| 34 | +You can download the latest version using the install script: |
| 35 | + |
| 36 | +```shell |
| 37 | +curl -sfL "https://cli.crossplane.io/install.sh" | sh |
| 38 | +``` |
| 39 | + |
| 40 | +[The script](https://raw.githubusercontent.com/crossplane/cli/main/install.sh) |
| 41 | +detects your operating system and CPU architecture and downloads the appropriate |
| 42 | +binary to the current directory. Note that it doesn't attempt to place the |
| 43 | +binary in your shell's `$PATH`, so you may want to move it. |
| 44 | + |
| 45 | +{{<expand "Manually install the Crossplane CLI" >}} |
| 46 | + |
| 47 | +If you don't want to run shell script you can manually download a binary from |
| 48 | +the Crossplane releases repository at |
| 49 | +https://cli.crossplane.io/stable/current/bin |
| 50 | + |
| 51 | +Move the binary to a location in your `$PATH`, for example `/usr/local/bin`. |
| 52 | +{{< /expand >}} |
| 53 | + |
| 54 | +### Download other CLI versions |
| 55 | + |
| 56 | +You can download different Crossplane CLI versions or different release branches |
| 57 | +with the `XP_CHANNEL` and `XP_VERSION` environmental variables. |
| 58 | + |
| 59 | +By default the CLI installs from the `XP_CHANNEL` named `stable` and the |
| 60 | +`XP_VERSION` of `current`, matching the most recent stable release. |
| 61 | + |
| 62 | +For example, to install CLI version `v2.3.0` add `XP_VERSION=v2.3.0` to the |
| 63 | +download script curl command: |
| 64 | + |
| 65 | +```shell |
| 66 | +curl -sfL "https://cli.crossplane.io/install.sh" | XP_VERSION=v2.3.0 sh |
| 67 | +``` |
| 68 | + |
| 69 | +To install the latest build from the `main` branch, use the `master` channel by |
| 70 | +adding `XP_CHANNEL=master`: |
| 71 | + |
| 72 | +```shell |
| 73 | +curl -sfL "https://cli.crossplane.io/install.sh" | XP_CHANNEL=master sh |
| 74 | +``` |
0 commit comments