Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Variables

Reference of all environment variables used by Two-Face.

Connection Variables

Direct eAccess Mode

VariableDescriptionRequired
TF_ACCOUNTSimutronics account nameYes (if --account not provided)
TF_PASSWORDAccount passwordYes (if --password not provided)
TF_GAMEGame instanceYes (if --game not provided)
TF_CHARACTERCharacter nameYes (if --character not provided)
# Set credentials via environment
export TF_ACCOUNT="myaccount"
export TF_PASSWORD="mypassword"
export TF_GAME="prime"
export TF_CHARACTER="Warrior"

# Launch without command-line credentials
two-face --direct

Lich Mode

VariableDescriptionDefault
TF_HOSTLich proxy host127.0.0.1
TF_PORTLich proxy port8000
export TF_HOST="192.168.1.100"
export TF_PORT="8001"
two-face  # Uses environment values

Configuration Variables

VariableDescriptionDefault
TF_CONFIG_DIRConfiguration directory~/.two-face
TF_CONFIGMain config file path$TF_CONFIG_DIR/config.toml
TF_LAYOUTLayout config path$TF_CONFIG_DIR/layout.toml
TF_COLORSColors config path$TF_CONFIG_DIR/colors.toml
TF_KEYBINDSKeybinds config path$TF_CONFIG_DIR/keybinds.toml
# Custom config directory
export TF_CONFIG_DIR="/home/user/games/two-face"

# Individual file overrides
export TF_LAYOUT="/home/user/layouts/hunting.toml"

Logging Variables

VariableDescriptionDefault
TF_LOG_LEVELLog verbosityinfo
TF_LOG_FILELog file path$TF_CONFIG_DIR/two-face.log
RUST_LOGRust logging (alternative)-
# Enable debug logging
export TF_LOG_LEVEL="debug"

# Custom log file
export TF_LOG_FILE="/tmp/two-face.log"

# Or use Rust's standard logging
export RUST_LOG="two_face=debug"

Log Levels

LevelDescription
errorErrors only
warnWarnings and above
infoGeneral information
debugDebug information
traceVerbose tracing

Display Variables

VariableDescriptionDefault
TF_NO_COLORDisable colorsfalse
TF_FORCE_COLORForce colorsfalse
TERMTerminal typeSystem default
COLORTERMColor support levelSystem default
# Disable colors (for logging/piping)
export TF_NO_COLOR=1

# Force colors (for terminals that don't advertise support)
export TF_FORCE_COLOR=1

Build Variables

Used during compilation:

VariableDescription
VCPKG_ROOTvcpkg installation path (Windows)
OPENSSL_DIROpenSSL installation path
OPENSSL_LIB_DIROpenSSL library path
OPENSSL_INCLUDE_DIROpenSSL headers path
# Windows (vcpkg)
set VCPKG_ROOT=C:\tools\vcpkg

# macOS (Homebrew)
export OPENSSL_DIR=$(brew --prefix openssl)

# Linux (custom OpenSSL)
export OPENSSL_DIR=/opt/openssl
export OPENSSL_LIB_DIR=$OPENSSL_DIR/lib
export OPENSSL_INCLUDE_DIR=$OPENSSL_DIR/include

TTS Variables

VariableDescriptionDefault
TF_TTS_ENGINETTS engine overrideSystem default
TF_TTS_VOICEVoice overrideSystem default
# Force specific TTS engine
export TF_TTS_ENGINE="espeak"
export TF_TTS_VOICE="en-us"

Precedence

Environment variables are applied in this order:

  1. Default values (lowest)
  2. Configuration files
  3. Environment variables
  4. Command-line arguments (highest)

Example:

# Config file says port = 8000
# Environment says TF_PORT=8001
# Command line says --port 8002

# Result: port 8002 is used

Security Notes

Credentials in Environment

Environment variables are visible to:

  • The current process
  • Child processes
  • Process inspection tools

Recommendations:

  • Don’t export credentials in shell profile files
  • Use temporary environment for session
  • Clear history after entering passwords
# Safer approach - prompt for password
read -sp "Password: " TF_PASSWORD
export TF_PASSWORD

Logging Redaction

Logs may contain environment values. The log system attempts to redact:

  • TF_PASSWORD
  • TF_ACCOUNT (partially)

But review logs before sharing publicly.

Shell Integration

Bash/Zsh

# ~/.bashrc or ~/.zshrc

# Two-Face config
export TF_CONFIG_DIR="$HOME/.two-face"
export TF_LOG_LEVEL="info"

# Alias with common options
alias gs4='two-face --host 127.0.0.1 --port 8000'

Fish

# ~/.config/fish/config.fish

set -x TF_CONFIG_DIR "$HOME/.two-face"
set -x TF_LOG_LEVEL "info"

alias gs4 'two-face --host 127.0.0.1 --port 8000'

PowerShell

# $PROFILE

$env:TF_CONFIG_DIR = "$env:USERPROFILE\.two-face"
$env:TF_LOG_LEVEL = "info"

function gs4 { two-face --host 127.0.0.1 --port 8000 $args }

Windows Command Prompt

:: Set for current session
set TF_CONFIG_DIR=%USERPROFILE%\.two-face

:: Set permanently (requires admin)
setx TF_CONFIG_DIR "%USERPROFILE%\.two-face"

Debugging

Check current environment:

# Show all TF_ variables
env | grep ^TF_

# Show specific variable
echo $TF_CONFIG_DIR

See Also