Environment variables
You can set environment variables before starting cjv to override configuration settings for that process and its children without modifying settings.toml:
CJV_LOG=debug cjv show active
In Windows PowerShell:
$env:CJV_LOG = "debug"
cjv show active
Quick reference
| Variable | Default | Purpose |
|---|---|---|
CJV_HOME | ~/.cjv, or the home setting | Absolute data directory; does not move user settings.toml |
CJV_CONFIG_FILE | ~/.cjv/settings.toml | User settings file (--config takes precedence); system fallback and project selection still apply |
CJV_FALLBACK_SETTINGS | System settings path | Select an alternate system fallback settings file |
CJV_TOOLCHAIN | Unset | Toolchain name or absolute SDK path; overrides directory overrides, cangjie-sdk.toml, and the default toolchain |
CJV_AUTO_INSTALL | The auto_install setting | 0 disables or 1 enables automatic installation without saving settings |
CJV_OFFLINE | Unset | Disable cjv network requests when set to 1; cached files remain available |
CJV_DIST_SERVER | Unset | Override the toolchain distribution root |
CJV_ALLOW_INSECURE_MANIFEST | Unset | Allow plain http:// manifests from non-loopback hosts when set to 1 |
CJV_MAX_RETRIES | 3 | Maximum retries after a failed download (non-negative integer) |
CJV_DOWNLOAD_TIMEOUT | 180 | HTTP download timeout in seconds (positive integer) |
CJV_NO_PATH_SETUP | Unset | Skip automatic PATH setup when set to 1 |
CJV_LOG | warn | Log level on stderr: debug, info, warn, or error (unknown values fall back to warn) |
CJV_LANG | System locale | Override the CLI interface language, such as zh, en, or ja |
Detailed behavior
- Paths and configuration (
CJV_HOME,CJV_CONFIG_FILE,CJV_FALLBACK_SETTINGS) —CJV_HOMEselects an absolute data directory for toolchains, components, caches, and rollback history. It does not move the usersettings.tomlfile. To isolate CI settings, also setCJV_CONFIG_FILEor pass--config <path>. See Configuration for precedence rules. - Toolchain selection and auto-install (
CJV_TOOLCHAIN,CJV_AUTO_INSTALL) — IfCJV_TOOLCHAINis set, it overrides directory overrides,cangjie-sdk.toml, and the default toolchain (only an explicit CLI flag like+nameor--toolchainranks higher).CJV_AUTO_INSTALL=0or1temporarily overridesauto_installfor the current process tree. - Networking, retries, and HTTPS enforcement (
CJV_OFFLINE,CJV_DIST_SERVER,CJV_MAX_RETRIES,CJV_DOWNLOAD_TIMEOUT,CJV_ALLOW_INSECURE_MANIFEST) — IfCJV_MAX_RETRIESorCJV_DOWNLOAD_TIMEOUTis set to an unparseable or out-of-range value,cjvfalls back to its default (3retries and180seconds). Because version manifests supply both download URLs and SHA-256 checksums,cjvrequireshttps://for remote manifests by default; loopback test servers (localhost,127.0.0.1,::1) are exempt, and settingCJV_ALLOW_INSECURE_MANIFEST=1permits plainhttp://on non-loopback hosts when testing internal infrastructure. - Variables injected into SDK environments (
CANGJIE_HOME,CANGJIE_STDX_PATH_*) — Whenstdxis installed for the selected toolchain,cjvautomatically injectsCANGJIE_STDX_PATH_DYNAMICandCANGJIE_STDX_PATH_STATICinto the SDK’s runtime environment, pointing to the component’sdynamic/andstatic/directories. These variables are managed bycjvand normally need no manual configuration; see Running commands and setting the environment. - Proxy and installer script variables (
HTTPS_PROXY,CJV_VERSION,CJV_UPDATE_ROOT) — See Network proxies for HTTP(S) and SOCKS5 proxy variables. During initial script installation,install.shandinstall.ps1readCJV_VERSIONto select acjvrelease tag (command-line--version/-Versiontakes precedence).CJV_UPDATE_ROOT(along withCJV_GITHUB_ROOTandCJV_GITCODE_ROOT) selects the initial download base URL for the installer scripts and takes precedence over version selection, though it does not overridecjv self updateon an already-installed binary. See Install cjv for examples.