rad~$

Environment Variables

A comprehensive reference of environment variables that can be used to configure and control Rad's behavior.

Introduction

Rad supports a variety of environment variables that allow you to customize its behavior without modifying configuration files. These variables can control caching, networking, platform compatibility, and more.

Environment variables provide a convenient way to temporarily change behavior or to set up configuration in CI/CD environments.

Core Environment Variables

VariableDescriptionDefaultExample
RAD_HOMEDirectory where Rad stores its configuration and cache~/.radRAD_HOME=/custom/path
RAD_USER_AGENTCustom User-Agent for requests to gem serversRad/[version]RAD_USER_AGENT="MyCompany/1.0"
RAD_LOG_LEVELLogging verbosity (debug, info, warn, error)infoRAD_LOG_LEVEL=debug
RAD_PLATFORMOverride detected platform (e.g., for cross-platform resolution)[auto-detected]RAD_PLATFORM=x86_64-linux
RAD_TIMEOUTHTTP request timeout in seconds30RAD_TIMEOUT=60

Performance Optimization Variables

VariableDescriptionDefaultExample
RAD_LAZY_LOADINGEnable/disable lazy loading of gem metadata (reduces network traffic by 30-40% and memory usage by 20-30%)trueRAD_LAZY_LOADING=false
RAD_CACHE_TTLTime-to-live for cached metadata in seconds3600 (1 hour)RAD_CACHE_TTL=43200
RAD_PLATFORM_CACHINGEnable platform compatibility caching (good for large projects)falseRAD_PLATFORM_CACHING=true
RAD_CONCURRENCYMaximum number of concurrent operations4RAD_CONCURRENCY=8

Cache Control

VariableDescriptionDefaultExample
RAD_CACHE_DISABLEDDisable the gem metadata cachefalseRAD_CACHE_DISABLED=true
RAD_CACHE_PATHCustom path for the gem metadata cache$RAD_HOME/cacheRAD_CACHE_PATH=/tmp/rad-cache

Network Configuration

VariableDescriptionDefaultExample
RAD_HTTP_PROXYHTTP proxy server for gem downloads[none]RAD_HTTP_PROXY=http://proxy:8080
RAD_HTTPS_PROXYHTTPS proxy server for gem downloads[none]RAD_HTTPS_PROXY=http://proxy:8080
RAD_NO_PROXYHosts to exclude from proxy[none]RAD_NO_PROXY=localhost,127.0.0.1
RAD_RETRY_COUNTNumber of retry attempts for failed requests3RAD_RETRY_COUNT=5
RAD_RETRY_DELAYDelay between retry attempts in milliseconds1000RAD_RETRY_DELAY=2000

Authentication

VariableDescriptionDefaultExample
RAD_API_KEYAPI key for RubyGems.org[none]RAD_API_KEY=abc123...
RAD_GITHUB_TOKENGitHub token for accessing private repositories[none]RAD_GITHUB_TOKEN=ghp_123...

Using Environment Variables

Command Line

Environment variables can be set for a single command:

terminal
RAD_LOG_LEVEL=debug rad install
[DEBUG] Initializing Rad v0.1.0 [DEBUG] Loading configuration from /home/user/.rad/config.toml [DEBUG] Platform detected as x86_64-linux [DEBUG] Fetching gem metadata from https://rubygems.org/... ...

Combined Performance Optimizations

Combine multiple environment variables for maximum performance:

terminal
RAD_LAZY_LOADING=true RAD_PLATFORM_CACHING=true RAD_CACHE_TTL=43200 rad install
📦 Installing gems with default groups 🔄 Initializing installation with optimized performance settings... Installation path: vendor/bundle Platform: darwin-arm64 (compatible with: darwin-arm64, ruby, macos-arm64) ... 📊 Summary: 0 gems installed, 45 gems already present 🎁 45 gems ready to use in 2.53s

Shell Profile

For persistent settings, add environment variables to your shell profile:

terminal
# Add to ~/.bashrc or ~/.zshrc
export RAD_CONCURRENCY=8
export RAD_CACHE_TTL=3600

Project-Specific Settings

For project-specific settings, you can create a .env file in your project root and load it using a tool like dotenv:

terminal
# .env file in project root RAD_LAZY_LOADING=true RAD_PLATFORM_CACHING=true RAD_CACHE_TTL=43200
For CI environments, setting RAD_LAZY_LOADING=true, RAD_PLATFORM_CACHING=true, and an appropriate RAD_CACHE_TTL can dramatically improve build times.
GitHub