Try out CUE in your browser!
You can use CUE without installing anything – just visit cuelang.org/play with your browser.
Installing the cue
command
The cue
command is available from various sources, listed on this page.
If you don’t know which source to choose, download and unpack the
latest version
that’s appropriate for your operating system.
Download an official CUE binary
On Linux, Microsoft Windows, and macOS, the cue
command can be downloaded from the
official CUE releases.
These releases include pre-releases, which are cutting-edge versions of cue
made available to help expose bugs and flush out unintended behaviours.
Install using Homebrew
On macOS and Linux, cue
can be installed using Homebrew
(brew.sh):
$ brew install cue-lang/tap/cue
Install from Docker Hub
The CUE project publishes official container images containing cue
on Docker Hub
(hub.docker.com/r/cuelang/cue).
They can be used on
platforms supported by Docker.
Various tags are available that let you select container images for different
machine architectures and CUE versions. To use the latest version that’s
appropriate for your machine, use the latest
tag:
$ docker pull cuelang/cue:latest
Install from source
On
platforms supported by Go,
cue
can be installed from source using any of its
release, pre-release, or as-yet-unreleased versions.
Installing from source requires that you already have
Go
installed and available.
For example, to fetch the latest
version:
$ go install cuelang.org/go/cmd/cue@latest
...
This page
lists the installable releases and pre-releases that you can specify instead of
latest
.
You can also install the tip version of cue
by specifying master
:
$ go install cuelang.org/go/cmd/cue@master
...
The capabilities of the tip version change frequently because it contains the most recent, unreleased code.
Install on Arch Linux
On Arch Linux
(archlinux.org),
cue
can be installed from a package in the official Arch extra
repository:
$ pacman -S extra/cue
This package is not published by the CUE project.
Using the Go API
CUE’s Go APIs are defined in the
cuelang.org/go
module, which can be added
as a versioned dependency using Go’s
dependency management
workflows. All available versions are listed at
pkg.go.dev/cuelang.org/go.
For example, to add a dependency on the latest version:
$ go get cuelang.org/go@latest
...
Related content
- Concept Guide: How CUE works with Go