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 – it contains the most recent features and bug fixes. The latest version of the cue command is:

TERMINAL
$ cue version
cue version v0.10.0
...

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 the cue command made available to help expose bugs and flush out unintended behaviours. You should choose to install the latest release if you don’t have a specific reason to select a pre-release.

Install using Homebrew

On macOS and Linux, cue can be installed using Homebrew (brew.sh):

TERMINAL
$ 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:

TERMINAL
$ 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:

TERMINAL
$ 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:

TERMINAL
$ 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:

TERMINAL
$ 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:

TERMINAL
$ go get cuelang.org/go@latest
...