Spice Labs CLI Environment Variables
Linux and macOS
Required Environment Variables
SPICE_PASS (Required for uploads)
Your authentication token from the Spice Labs Dashboard:
export SPICE_PASS="your-jwt-token-here"
Optional Environment Variables
| Variable | Description | Default |
|---|---|---|
SPICE_LABS_CLI_USE_JVM | Use local JVM instead of Docker (1 = enable) | 0 |
SPICE_LABS_CLI_JAR | Path to CLI JAR when using JVM mode | /opt/spice-labs-cli/spice-labs-cli.jar |
SPICE_LABS_JVM_ARGS | Custom JVM tuning flags | --XX:MaxRAMPercentage=75 |
SPICE_IMAGE | Docker image to use | spicelabs/spice-labs-cli |
SPICE_IMAGE_TAG | Docker image tag | latest |
SPICE_LABS_CLI_SKIP_PULL | Skip docker pull before run (1 = skip) | 0 |
JVM Mode Configuration
For better performance or air-gapped environments, you can use JVM mode:
# Enable JVM mode
export SPICE_LABS_CLI_USE_JVM=1
# Optional: custom JVM settings
export SPICE_LABS_JVM_ARGS="-Xmx2g -XX:+UseG1GC"
# Run normally
spice --command run --input ./project --output ./results
Windows
Installation Path for the Spice CLI: %USERPROFILE%\.spice\bin
This path automatically resolves to the current user directory (for example, C:\Users\Charlie\.spice\bin).
1. Temporary Environment Variables (Current Session Only)
cmd.exe
set "PATH=%PATH%;%USERPROFILE%\.spice\bin"
set "SPICE_PASS=your-secret-token"
PowerShell
$env:Path += ';' + (Join-Path $HOME '.spice\bin')
$env:SPICE_PASS = 'your-secret-token'
2. Permanent Environment Variables (User Scope Only)
Advanced System Settings (GUI)
- Open Settings → System → About → Advanced system settings → Environment Variables…
- Under User variables:
- Edit Path → Add:
%USERPROFILE%\.spice\bin - New → Name:
SPICE_PASS, Value:your-secret-token
- Edit Path → Add:
- Open a new terminal to apply changes.
cmd.exe (setx)
setx Path "%PATH%;%USERPROFILE%\.spice\bin"
setx SPICE_PASS "your-secret-token"
Note: Changes affect new sessions only.
setxcan truncate very long PATHs.
PowerShell (.NET API)
$add = Join-Path $HOME '.spice\bin'
$u = [Environment]::GetEnvironmentVariable('Path','User')
if (-not $u) { $u = '' }
if (($u -split ';') -notcontains $add) {
[Environment]::SetEnvironmentVariable('Path', ($u.TrimEnd(';') + ';' + $add).Trim(';'), 'User')
}
[Environment]::SetEnvironmentVariable('SPICE_PASS','your-secret-token','User')
Refresh Current Session (Optional)
$env:Path = [Environment]::GetEnvironmentVariable('Path','User') + ';' + \
[Environment]::GetEnvironmentVariable('Path','Machine')
$env:SPICE_PASS = [Environment]::GetEnvironmentVariable('SPICE_PASS','User')
Verification
Linux / macOS
# Check version
spice --version
# Test functionality (requires SPICE_PASS)
spice --command survey-artifacts --input . --output ./test-output
Windows PowerShell
Get-Command spice
$env:SPICE_PASS
Windows cmd.exe
where spice
echo %SPICE_PASS%
Security Notes
%USERPROFILE%,$HOME, and environment variables automatically adapt to the current user.- Avoid storing sensitive tokens permanently when possible.
- Prevent multiple duplicate entries in PATH to avoid bloating the variable.
- System-level variables affect all users; restrict
SPICE_PASSto user scope unless automation requires it.