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 prereleases, 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):

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 released versions.

For example, to fetch the latest version:

TERMINAL
$ go install cuelang.org/go/cmd/cue@latest
...

This method requires that you already have Go installed.

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
...