Environment Variables
vx respects various environment variables for configuration and behavior.
vx Configuration
| Variable | Description | Default |
|---|---|---|
VX_HOME | Override vx data directory | Platform-specific |
VX_CONFIG_DIR | Override config directory | Platform-specific |
VX_CACHE_DIR | Override cache directory | Platform-specific |
VX_AUTO_INSTALL | Enable/disable auto-install | true |
VX_VERBOSE | Enable verbose output | false |
VX_DEBUG | Enable debug output | false |
VX_ENV | Current environment name | default |
CDN Acceleration
vx supports CDN acceleration for downloads via turbo-cdn, which can significantly improve download speeds especially in regions with slow access to GitHub (e.g., China).
How It Works
When CDN acceleration is enabled:
- Download URLs are automatically optimized to use the best available CDN mirror
- Progress display shows
[CDN]indicator when CDN is active - Falls back to original URL if CDN optimization fails
Enabling CDN Acceleration
CDN acceleration is enabled by default when vx is compiled with the cdn-acceleration feature. The official release binaries include this feature.
Supported Sources
CDN acceleration works with:
- GitHub Releases (e.g., Node.js, Go, Zig, Rust tools)
- GitHub raw content
- npm registry
- PyPI packages
- And more (via turbo-cdn's mirror network)
Data Directories
Default Locations
| Platform | Data | Config | Cache |
|---|---|---|---|
| Linux | ~/.local/share/vx | ~/.config/vx | ~/.cache/vx |
| macOS | ~/Library/Application Support/vx | ~/.config/vx | ~/Library/Caches/vx |
| Windows | %LOCALAPPDATA%\vx | %APPDATA%\vx | %LOCALAPPDATA%\vx\cache |
Override Directories
bash
# Override all vx directories
export VX_HOME=/custom/path/vx
# Override specific directories
export VX_CONFIG_DIR=/custom/config
export VX_CACHE_DIR=/custom/cacheBehavior Control
Auto-Install
bash
# Disable auto-install
export VX_AUTO_INSTALL=false
# Enable auto-install (default)
export VX_AUTO_INSTALL=trueVerbose Output
bash
# Enable verbose output
export VX_VERBOSE=true
# Or use flag
vx --verbose node --versionDebug Output
bash
# Enable debug output
export VX_DEBUG=true
# Or use flag
vx --debug node --versionEnvironment Management
Current Environment
bash
# Set current environment
export VX_ENV=my-env
# Check current environment
echo $VX_ENVEnvironment Directory
When an environment is active:
bash
VX_ENV=my-env
VX_ENV_DIR=/home/user/.local/share/vx/envs/my-envTool-Specific Variables
Node.js
bash
NODE_ENV=production vx node server.jsGo
bash
GOPROXY=direct vx go get github.com/user/repo
CGO_ENABLED=0 vx go buildRust
bash
CARGO_HOME=/custom/cargo vx cargo build
RUSTFLAGS="-C target-cpu=native" vx cargo build --releasePython/UV
bash
UV_CACHE_DIR=/custom/cache vx uv pip install requestsShell Integration
When shell integration is enabled, these variables are set automatically:
bash
# Added to PATH
PATH="/home/user/.local/share/vx/envs/default:$PATH"
# Environment tracking
VX_ENV="default"
VX_ENV_DIR="/home/user/.local/share/vx/envs/default"CI/CD Usage
GitHub Actions
yaml
env:
VX_AUTO_INSTALL: true
VX_VERBOSE: true
steps:
- run: vx setup
- run: vx run testGitLab CI
yaml
variables:
VX_AUTO_INSTALL: "true"
VX_HOME: "$CI_PROJECT_DIR/.vx"
script:
- vx setup
- vx run testTroubleshooting
Check Current Settings
bash
# Show all vx-related environment variables
env | grep VX_
# Show effective configuration
vx config showReset Environment
bash
# Unset all vx variables
unset VX_HOME VX_ENV VX_AUTO_INSTALL VX_VERBOSE VX_DEBUG