Skip to main content
Forge supports environment variables for advanced configuration and fine-tuning. Set these in your .env file or system environment.

API Configuration

FORGE_API_URL
string
default:"https://api.forgecode.dev"
Custom Forge API URL.Example:
FORGE_API_URL=https://api.forgecode.dev
FORGE_WORKSPACE_SERVER_URL
string
default:"https://api.forgecode.dev/"
URL for the workspace indexing server.Example:
FORGE_WORKSPACE_SERVER_URL=http://localhost:8080

Retry Configuration

FORGE_RETRY_INITIAL_BACKOFF_MS
integer
default:"1000"
Initial backoff time in milliseconds for retries.Example:
FORGE_RETRY_INITIAL_BACKOFF_MS=2000
FORGE_RETRY_BACKOFF_FACTOR
number
default:"2"
Multiplier for backoff time on each retry.Example:
FORGE_RETRY_BACKOFF_FACTOR=2
FORGE_RETRY_MAX_ATTEMPTS
integer
default:"3"
Maximum number of retry attempts.Example:
FORGE_RETRY_MAX_ATTEMPTS=5
FORGE_RETRY_SUPPRESS_RETRY_ERRORS
boolean
default:"false"
Suppress retry error messages.Example:
FORGE_RETRY_SUPPRESS_RETRY_ERRORS=true
FORGE_RETRY_STATUS_CODES
string
default:"429,500,502,503,504"
HTTP status codes to retry (comma-separated).Example:
FORGE_RETRY_STATUS_CODES=429,500,502

HTTP Configuration

Connection Settings

FORGE_HTTP_CONNECT_TIMEOUT
integer
default:"30"
Connection timeout in seconds.Example:
FORGE_HTTP_CONNECT_TIMEOUT=60
FORGE_HTTP_READ_TIMEOUT
integer
default:"900"
Read timeout in seconds.Example:
FORGE_HTTP_READ_TIMEOUT=1800
FORGE_HTTP_POOL_IDLE_TIMEOUT
integer
default:"90"
Connection pool idle timeout in seconds.Example:
FORGE_HTTP_POOL_IDLE_TIMEOUT=120
FORGE_HTTP_POOL_MAX_IDLE_PER_HOST
integer
default:"5"
Maximum idle connections per host.Example:
FORGE_HTTP_POOL_MAX_IDLE_PER_HOST=10
FORGE_HTTP_MAX_REDIRECTS
integer
default:"10"
Maximum redirects to follow.Example:
FORGE_HTTP_MAX_REDIRECTS=5

TLS Configuration

FORGE_HTTP_TLS_BACKEND
string
default:"default"
TLS backend to use: default or rustls.Example:
FORGE_HTTP_TLS_BACKEND=rustls
FORGE_HTTP_MIN_TLS_VERSION
string
default:"1.2"
Minimum TLS version: 1.0, 1.1, 1.2, or 1.3.Example:
FORGE_HTTP_MIN_TLS_VERSION=1.2
FORGE_HTTP_MAX_TLS_VERSION
string
default:"1.3"
Maximum TLS version: 1.0, 1.1, 1.2, or 1.3.Example:
FORGE_HTTP_MAX_TLS_VERSION=1.3
FORGE_HTTP_ACCEPT_INVALID_CERTS
boolean
default:"false"
Accept invalid SSL certificates.
Disables certificate verification. Only use in development environments.
Example:
FORGE_HTTP_ACCEPT_INVALID_CERTS=true
FORGE_HTTP_ROOT_CERT_PATHS
string
Paths to custom root certificate files (comma-separated). Supports PEM, CRT, CER formats.Example:
FORGE_HTTP_ROOT_CERT_PATHS=/path/to/cert1.pem,/path/to/cert2.crt

Keep-Alive Configuration

FORGE_HTTP_KEEP_ALIVE_INTERVAL
integer
default:"60"
Keep-alive interval in seconds. Use none or disabled to disable.Example:
FORGE_HTTP_KEEP_ALIVE_INTERVAL=30
FORGE_HTTP_KEEP_ALIVE_TIMEOUT
integer
default:"10"
Keep-alive timeout in seconds.Example:
FORGE_HTTP_KEEP_ALIVE_TIMEOUT=20
FORGE_HTTP_KEEP_ALIVE_WHILE_IDLE
boolean
default:"true"
Keep connections alive while idle.Example:
FORGE_HTTP_KEEP_ALIVE_WHILE_IDLE=false

Advanced HTTP Settings

FORGE_HTTP_USE_HICKORY
boolean
default:"false"
Use Hickory DNS resolver.Example:
FORGE_HTTP_USE_HICKORY=true
FORGE_HTTP_ADAPTIVE_WINDOW
boolean
default:"true"
Enable HTTP/2 adaptive window.Example:
FORGE_HTTP_ADAPTIVE_WINDOW=false

Tool Configuration

FORGE_TOOL_TIMEOUT
integer
default:"300"
Maximum execution time in seconds for a tool before termination.Example:
FORGE_TOOL_TIMEOUT=600
FORGE_MAX_IMAGE_SIZE
integer
default:"262144"
Maximum image file size in bytes (default: 256 KB).Example:
FORGE_MAX_IMAGE_SIZE=524288  # 512 KB
FORGE_DUMP_AUTO_OPEN
boolean
default:"false"
Automatically open dump files in browser.Example:
FORGE_DUMP_AUTO_OPEN=true
FORGE_DEBUG_REQUESTS
string
Write debug HTTP request files to specified path (absolute or relative).Example:
FORGE_DEBUG_REQUESTS=/tmp/forge-debug.json

System Configuration

FORGE_MAX_SEARCH_RESULT_BYTES
integer
default:"10240"
Maximum bytes for search results (default: 10 KB).Example:
FORGE_MAX_SEARCH_RESULT_BYTES=20480
FORGE_MAX_LINE_LENGTH
integer
default:"2000"
Maximum characters per line for file read operations.Example:
FORGE_MAX_LINE_LENGTH=4000
FORGE_STDOUT_MAX_LINE_LENGTH
integer
default:"2000"
Maximum characters per line for shell output.Example:
FORGE_STDOUT_MAX_LINE_LENGTH=4000
FORGE_HISTORY_FILE
string
Custom path for Forge history file.Example:
FORGE_HISTORY_FILE=/path/to/custom/history
FORGE_BANNER
string
Custom banner text to display on startup.Example:
FORGE_BANNER="Welcome to My Forge Environment"
FORGE_MAX_CONVERSATIONS
integer
default:"100"
Maximum number of conversations to show in list.Example:
FORGE_MAX_CONVERSATIONS=200
SHELL
string
Shell to use for command execution (Unix/Linux/macOS).Example:
SHELL=/bin/zsh
COMSPEC
string
Command processor to use (Windows).Example:
COMSPEC=cmd.exe

Semantic Search Configuration

FORGE_SEM_SEARCH_LIMIT
integer
default:"200"
Maximum number of results from initial vector search.Example:
FORGE_SEM_SEARCH_LIMIT=300
FORGE_SEM_SEARCH_TOP_K
integer
default:"20"
Top-k parameter for relevance filtering during semantic search.Example:
FORGE_SEM_SEARCH_TOP_K=30

Display Configuration

FORGE_CURRENCY_SYMBOL
string
default:"$"
Currency symbol for cost display in ZSH theme.Example:
FORGE_CURRENCY_SYMBOL="€"
FORGE_CURRENCY_CONVERSION_RATE
number
default:"1.0"
Conversion rate for currency display.Example:
FORGE_CURRENCY_CONVERSION_RATE=0.85  # USD to EUR
NERD_FONT
boolean
Enable Nerd Font icons in ZSH theme. Auto-detected by default.Example:
NERD_FONT=1  # or "true" to enable
USE_NERD_FONT
boolean
Alternative variable for enabling Nerd Font icons (same as NERD_FONT).Example:
USE_NERD_FONT=0  # or "false" to disable

ZSH Plugin Configuration

FORGE_BIN
string
default:"forge"
Command to use for forge operations in the ZSH plugin.Example:
FORGE_BIN=forge

Logging Configuration

FORGE_LOG
string
Log filter level using standard tracing filter syntax.Default:
  • forge=info when tracking enabled
  • forge=debug when tracking disabled
Levels:
  • forge=error - Only errors
  • forge=warn - Warnings and errors
  • forge=info - Informational messages
  • forge=debug - Debug information
  • forge=trace - Detailed tracing
Example:
FORGE_LOG=forge=debug

Configuration Examples

# .env - Production configuration

# API settings
FORGE_API_URL=https://api.forgecode.dev

# Timeouts for stable connections
FORGE_HTTP_CONNECT_TIMEOUT=30
FORGE_HTTP_READ_TIMEOUT=900

# Conservative retry settings
FORGE_RETRY_MAX_ATTEMPTS=3
FORGE_RETRY_INITIAL_BACKOFF_MS=1000

# Error logging
FORGE_LOG=forge=info

Next Steps

forge.yaml Reference

Configure model behavior and workflow

Custom Rules

Define coding guidelines

Build docs developers (and LLMs) love