The cx Book 1.0.0
cx: a package manager and build tool for C and C++
Loading...
Searching...
No Matches
Environment variables

Variable Meaning
CX_REGISTRY URL of the default registry (wins over registries.default)
CX_REGISTRY_<NAME> URL of the registry named <name> (upper-cased, - becomes _)
CX_TOKEN token for the default registry (wins over credentials.toml)
CX_TOKEN_<NAME> token for the registry named <name>
CC, CXX the C and C++ compilers (win over [toolchain])
CX_COMPILER_CACHE the compiler launcher (wins over build.compiler-cache)
CX_ARTIFACT_CACHE 1 turns the artifact cache on, 0 off (wins over build.artifact-cache)
CX_ARTIFACT_STORE the shared artifact store (wins over build.artifact-store; see Build caches)
CX_ARTIFACT_STORE_WRITE 1 uploads new artifacts to the store (wins over build.artifact-store-write)
CX_TOKEN_ARTIFACT_STORE token for uploading to the artifact store
CX_CACHE_AUTO_GC an age like 90d: clean up the cache automatically (wins over cache.auto-gc)
CX_INSTALL_ROOT where cx install installs (default: ~/.local)
CX_CMAKE_IMPORT_STD_GATE passed on as CMake's CMAKE_EXPERIMENTAL_CXX_IMPORT_STD (see C++20 modules)
CX_CMAKE, CX_NINJA, CX_CLANG_FORMAT, CX_CLANG_TIDY, CX_DOXYGEN, CX_PYTHON, CX_SCONS, CX_VCPKG, CX_MAKE, CX_AUTORECONF auto, system, managed, or a program (win over tools.<name>; see External tools)
VCPKG_ROOT the vcpkg checkout whose vcpkg cx runs for vcpkg dependencies, before vcpkg in PATH
VCPKG_DEFAULT_TRIPLET, VCPKG_DEFAULT_HOST_TRIPLET the vcpkg triplet to install ports for (the host one for build-dependencies of a cross build); default: from the platform
CX_TOOLS_MIRROR where to download pinned tools from (wins over tools.mirror)
CX_HOME cx's cache directory (default: $XDG_CACHE_HOME/cx, else ~/.cache/cx; on Windows LOCALAPPDATA%\cx)
CX_VENDOR build from this vendor directory (wins over source.vendor)
CX_AUDIT_DB advisory database for cx audit (wins over audit.database)
CX_OFFLINE any value except 0 works like --offline; 0 overrides net.offline = true
CX_SELF_UPDATE_URL where cx self update and the install scripts find releases (default: https://github.com/AKJ7/cortex/releases); a mirror, or a local directory, with GitHub's layout: latest/download/<file> and download/v<version>/<file>
CX_SELF_UPDATE_KEYS the public keys (ed25519:..., comma-separated) that must sign a release's cx-release.toml, instead of cx's built-in release keys (for releases you re-sign yourself)
CX_INSTALL_DIR install scripts only: where to put cx and cx-registry (default: ~/.local/bin)
CX_INSTALL_VERSION install scripts only: the version to install (default: the latest)
XDG_CONFIG_HOME where cx/config.toml and cx/credentials.toml live (default: ~/.config; on Windows APPDATA%)
SSL_CERT_FILE CA bundle for HTTPS, instead of the one detected when cx was built
NO_COLOR disables colors (unless --color=always)
CLICOLOR_FORCE, FORCE_COLOR any value except 0 enables colors even when output isn't a terminal
TERM=dumb disables colors

What's in the cache

Path under CX_HOME Contents
git/db/ bare repositories of git dependencies, holding only the fetched commits (--depth 1)
git/checkouts/ one checkout per locked commit
registry/<hash>/index/ cached index files, with their HTTP validators
registry/<hash>/archives/ downloaded package archives
registry/<hash>/src/ unpacked package sources
artifacts/ compiled dependencies (Build caches)
install/ build trees of cx install
last-use.toml when cx last used each entry, for cx cache gc
tools/<tool>-<version>-<platform>/ downloaded CMake, Ninja, clang-format, clang-tidy, Doxygen, Python and SCons (External tools)

Deleting the cache is always safe. cx downloads again what it needs, or reports an error in --offline mode. cx cache gc removes only what wasn't used for a while (Build caches).