Skip to content

All Environment Variables

All Environment Variables

Here is a comprehensive list of all environment variables that can be used in sfdx-hardis source code.

This list has been generated with GitHub Copilot so if you see any incoherence please raise an issue :)

Table of Contents


Custom sfdx-hardis Variables

These variables control specific behaviors and configurations within sfdx-hardis itself.

Salesforce Configuration

Variable Name Description Default Value Possible Values Usage Location
CI_SCRATCH_MODE Mode for scratch org in CI (e.g., 'deploy') undefined 'deploy', any string (e.g., 'test', 'dev') src/common/utils/orgUtils.ts
DEVHUB_ALIAS Alias for the Salesforce DevHub org undefined Any valid org alias (e.g., 'MyDevHub', 'production-devhub') Multiple files in config, hooks, and auth
INSTANCE_URL Salesforce instance URL for authentication undefined Valid Salesforce instance URLs (e.g., 'https://mycompany.my.salesforce.com', 'https://test.salesforce.com') src/common/utils/authUtils.ts
NOT_IMPACTING_METADATA_TYPES Comma-separated list of metadata types that don't impact deployments Predefined list Comma-separated metadata type names (e.g., 'Document,StaticResource,Report') src/config/index.ts
ORG_ALIAS Alias for the target Salesforce org undefined Any valid org alias (e.g., 'staging', 'production', 'sandbox1') Multiple files in hooks and auth
SFDX_API_VERSION Salesforce API version to use '62.0' Valid Salesforce API versions (e.g., '62.0') src/config/index.ts
SFDX_AUTH_URL_DEV_HUB Salesforce auth URL for DevHub undefined Valid Salesforce auth URLs (e.g., 'force://PlatformCLI::5Aep8614XXXXXXXXXXXX...') src/common/utils/authUtils.ts
SFDX_AUTH_URL_TECHNICAL_ORG Salesforce auth URL for technical org undefined Valid Salesforce auth URLs (e.g., 'force://PlatformCLI::5Aep8614XXXXXXXXXXXX...') src/commands/hardis/auth/login.ts
SFDX_CLIENT_ID Salesforce connected app client ID undefined Valid connected app client IDs (e.g., '3MVG9CEn_O3jvv0XXXXXXXXXXXX...') src/common/utils/authUtils.ts
SFDX_CLIENT_KEY Salesforce connected app client key undefined Valid connected app client keys (e.g., '/path/to/server.key', certificate content) src/common/utils/authUtils.ts
SFDX_ENV Salesforce CLI environment setting Set to 'development' when debug is enabled 'development', 'production' src/hooks/init/log.ts
SFDX_XML_INDENT Indentation string for XML formatting ' ' (4 spaces) Any string (e.g., ' ' for 4 spaces, '\t' for tabs, ' ' for 2 spaces) src/common/utils/xmlUtils.ts
SKIP_TECHNICAL_ORG Skip technical org connection undefined 'true', 'false' src/common/utils/orgUtils.ts
TARGET_USERNAME Target Salesforce username for operations undefined Valid Salesforce usernames (e.g., 'admin@mycompany.com', 'test-user@example.com.sandbox') src/common/utils/authUtils.ts
TECHNICAL_ORG_ALIAS Alias for technical Salesforce org undefined Any valid org alias (e.g., 'technical-org', 'monitoring-org') src/commands/hardis/auth/login.ts

Deployment Control

Variable Name Description Default Value Possible Values Usage Location
AUTO_UPDATE Enable automatic update of .gitignore and .forceignore files when not in CI undefined 'true', 'false' Found in changelog
SFDX_DEPLOY_WAIT_MINUTES Minutes to wait for deployment completion 120 Positive integers (e.g., '120', '60') Multiple files in deployUtils and Azure config
SFDX_DISABLE_FLOW_DIFF Disable Flow Visual Git Diff calculation in PR comments undefined 'true', 'false' src/common/utils/gitUtils.ts
SFDX_HARDIS_DEPLOY_BEFORE_MERGE Deploy before merge in CI/CD undefined 'true', 'false' src/common/gitProvider/index.ts
SFDX_HARDIS_DEPLOY_IGNORE_SPLIT_PACKAGES Ignore splitting of package.xml files during deployment 'true' 'true', 'false' src/common/utils/deployUtils.ts

Monitoring & Debugging

Variable Name Description Default Value Possible Values Usage Location
DEBUG Enable debug logging output undefined 'true', 'false' src/common/websocketClient.ts
DEBUG_DEPLOY Enable debug logging for deployment operations undefined 'true', 'false' src/common/utils/orgUtils.ts
MONITORING_BACKUP_SKIP_METADATA_TYPES Metadata types to skip during backup monitoring undefined Comma-separated metadata type names (e.g., 'Document,Report,Dashboard') Found in changelog and documentation
SFDX_HARDIS_MONITORING_KEY Override the monitoring/org identifier used in notifications and metrics (alias: MONITORING_KEY) undefined Any string identifier (e.g., 'production-org', 'my-sandbox') src/common/notifProvider/apiProvider.ts
SFDX_HARDIS_DEBUG_ENV Enable debug environment for sfdx-hardis undefined 'true', 'false' src/hooks/init/log.ts
SFDX_HARDIS_MONITORING Indicates if running a monitoring job undefined 'true', 'false' src/common/utils/index.ts

System Configuration

Variable Name Description Default Value Possible Values Usage Location
CONFIG_BRANCH Override for configuration branch name Current git branch Any valid git branch name (e.g., 'main', 'develop', 'config-override') src/config/index.ts
FORCE_COLOR Control color output in terminal commands '0' '0', '1', '2', '3' src/common/utils/index.ts
GIT_FETCH_EXTRA_FLAGS Extra flags for git fetch operations undefined Valid git fetch flags (e.g., '--depth=1', '--quiet', '--prune') Found in documentation
MERMAID_MODES Modes for Mermaid diagram generation undefined Mermaid mode values (e.g., 'dark', 'light', 'forest') Found in Dockerfile
NODE_OPTIONS Node.js runtime options Cleared if contains --inspect-brk Valid Node.js options (e.g., '--max-old-space-size=4096', '--experimental-modules') src/common/utils/index.ts
PROJECT_NAME Name of the sfdx-hardis project undefined Any project name string (e.g., 'My Salesforce Project', 'CRM-Development') src/config/index.ts
SFDX_HARDIS_WEBSOCKET_PORT Port for sfdx-hardis WebSocket server 2702 Valid port numbers (e.g., 2702) src/common/websocketClient.ts

Bulk API Settings

Variable Name Description Default Value Possible Values Usage Location
BULKAPIV2_POLL_INTERVAL Override BulkApiV2 Poll interval 5000 Any number src/common/utils/apiUtils.ts
BULKAPIV2_POLL_TIMEOUT Override BulkApiV2 Poll Timeout 60000 Any number src/common/utils/apiUtils.ts

Tool-Specific Variables

These variables integrate sfdx-hardis with external tools and platforms.

Azure DevOps

Variable Name Description Default Value Possible Values Usage Location
BUILD_BUILD_ID Azure build ID for CI/CD pipeline identification undefined Numeric build IDs (e.g., '12345', '987654') src/common/gitProvider/azureDevops.ts
BUILD_REPOSITORY_ID Azure repository ID for accessing repository information undefined Valid Azure repository GUIDs (e.g., '550e8400-e29b-41d4-a716-446655440000') src/common/gitProvider/azureDevops.ts, src/common/ticketProvider/azureBoardsProvider.ts
BUILD_REPOSITORYNAME Azure repository name for building URLs and references undefined Valid Azure repository names (e.g., 'my-salesforce-project', 'CRM-Repository') src/common/gitProvider/azureDevops.ts
BUILD_SOURCEBRANCHNAME Azure source branch name for the current build undefined Valid git branch names (e.g., 'main', 'feature/new-component', 'develop') src/common/gitProvider/azureDevops.ts
CI_SFDX_HARDIS_AZURE_TOKEN Custom Azure DevOps token for sfdx-hardis integration SYSTEM_ACCESSTOKEN Valid Azure DevOps personal access tokens (e.g., 'eyJ0eXAiOiJKV1QiLCJhbGciOiXXXXXXXXXXXX...') src/common/gitProvider/index.ts, src/common/ticketProvider/azureBoardsProvider.ts
SYSTEM_ACCESSTOKEN Azure DevOps system access token undefined Valid Azure DevOps access tokens (e.g., 'eyJ0eXAiOiJKV1QiLCJhbGciOiXXXXXXXXXXXX...') src/common/gitProvider/index.ts, src/common/ticketProvider/azureBoardsProvider.ts
SYSTEM_COLLECTIONURI Azure DevOps collection URI undefined Valid Azure DevOps collection URIs (e.g., 'https://dev.azure.com/myorganization/') src/common/gitProvider/index.ts, src/common/gitProvider/azureDevops.ts, src/common/ticketProvider/azureBoardsProvider.ts
SYSTEM_JOB_DISPLAY_NAME Azure DevOps job display name undefined Valid job display names (e.g., 'Build and Test', 'Deploy to Staging') src/common/gitProvider/azureDevops.ts
SYSTEM_JOB_ID Azure DevOps job ID undefined Valid Azure job IDs (e.g., '550e8400-e29b-41d4-a716-446655440000') src/common/gitProvider/azureDevops.ts
SYSTEM_PULLREQUEST_PULLREQUESTID Azure DevOps pull request ID undefined Valid pull request IDs (e.g., '123', '456') src/common/gitProvider/azureDevops.ts
SYSTEM_TEAMPROJECT Azure DevOps team project name undefined Valid Azure DevOps project names (e.g., 'MyProject', 'Salesforce-Development') src/common/gitProvider/index.ts, src/common/gitProvider/azureDevops.ts, src/common/ticketProvider/azureBoardsProvider.ts

GitLab

Variable Name Description Default Value Possible Values Usage Location
CI_JOB_TOKEN GitLab CI job token for API authentication undefined Valid GitLab job tokens (e.g., 'glcbt-64chars_token_XXXXXXXXXXXXXXXXXXXX') src/common/gitProvider/index.ts
CI_PROJECT_ID GitLab project ID undefined Valid GitLab project IDs (e.g., '123456', '42') src/common/gitProvider/gitlab.ts
CI_PROJECT_URL GitLab project URL for building branch URLs undefined Valid GitLab project URLs (e.g., 'https://gitlab.com/myuser/myproject') src/common/gitProvider/gitlab.ts
CI_SFDX_HARDIS_GITLAB_TOKEN Custom GitLab token for sfdx-hardis integration ACCESS_TOKEN Valid GitLab access tokens (e.g., 'glpat-XXXXXXXXXXXXXXXXXXXX') src/common/gitProvider/index.ts

GitHub

Variable Name Description Default Value Possible Values Usage Location
GITHUB_TOKEN GitHub token for API authentication undefined Valid GitHub personal access tokens (e.g., 'ghp_XXXXXXXXXXXXXXXXXXXX', 'github_pat_XXXXXXXXXXXX') src/common/gitProvider/index.ts

Bitbucket

Variable Name Description Default Value Possible Values Usage Location
BITBUCKET_WORKSPACE Bitbucket workspace identifier for Bitbucket provider detection undefined Valid Bitbucket workspace names (e.g., 'mycompany', 'my-team-workspace') src/common/gitProvider/index.ts
CI_SFDX_HARDIS_BITBUCKET_TOKEN Custom Bitbucket token for sfdx-hardis integration undefined Valid Bitbucket app passwords or tokens (e.g., 'ATBBXXXXXXXXXXXXXXXXXXXX') src/common/gitProvider/index.ts

JIRA Integration

Variable Name Description Default Value Possible Values Usage Location
JIRA_EMAIL JIRA user email for authentication undefined Valid email addresses (e.g., 'admin@mycompany.com', 'jira-user@example.org') src/common/ticketProvider/jiraProvider.ts
JIRA_HOST JIRA server hostname "https://define.JIRA_HOST.in.cicd.variables/" Valid JIRA server URLs (e.g., 'https://mycompany.atlassian.net', 'https://jira.mycompany.com') src/common/ticketProvider/jiraProvider.ts
JIRA_PAT JIRA Personal Access Token for authentication undefined Valid JIRA personal access tokens (e.g., 'ATATTXXXXXXXXXXXXXXXXXXXX') src/common/ticketProvider/jiraProvider.ts
JIRA_TICKET_REGEX Regular expression for JIRA ticket references "(?<=[^a-zA-Z0-9_-]|^)([A-Za-z0-9]{2,10}-\\d{1,6})(?=[^a-zA-Z0-9_-]|$)" Valid regular expressions (e.g., 'PROJ-\\d+', '[A-Z]+-\\d{1,4}') src/common/ticketProvider/jiraProvider.ts
JIRA_TOKEN JIRA API token for authentication undefined Valid JIRA API tokens (e.g., 'ATATT3xFfGF0T4JVXXXXXXXXXXXXXXXXXXXX') src/common/ticketProvider/jiraProvider.ts

Slack Integration

Variable Name Description Default Value Possible Values Usage Location
SLACK_CHANNEL_ID Slack channel ID for notifications undefined Valid Slack channel IDs (e.g., 'C1234567890', 'C0123456789') src/common/notifProvider/slackProvider.ts
SLACK_CHANNEL_ID_ERRORS_WARNINGS Slack channel ID for error and warning notifications undefined Valid Slack channel IDs (e.g., 'C1234567890', 'C9876543210') src/common/notifProvider/slackProvider.ts
SLACK_CHANNEL_ID_{BRANCH} Branch-specific Slack channel ID undefined Valid Slack channel IDs (e.g., 'C1234567890' for main branch) src/common/notifProvider/slackProvider.ts
SLACK_TOKEN Slack API token for notifications undefined Valid Slack bot tokens (e.g., 'xoxb-XXXXXXXXXXXXXXXXXXXXXXXX') src/common/notifProvider/slackProvider.ts, src/common/notifProvider/utils.ts

AI Common variables

Variable Name Description Default Value Possible Values Usage Location
AI_MAXIMUM_CALL_NUMBER Maximum allowed number of calls to AI Providers during a single command 10000 Any positive integer (e.g., 1000, 10000) src/common/aiProvider/aiProviderRoot.ts
PROMPTS_LANGUAGE Language to use for prompts results (en,fr, ISO codes) en Any ISO language code (e.g., en, fr, de) Prompt templates & generation code
DEBUG_PROMPTS Show prompt requests/responses in logs (useful for debugging) false 'true', 'false' AI prompt/debug flows
MAX_DEPLOYMENT_TIPS_AI_CALLS Max number of deployment errors analyzed by AI for a single Pull Request 20 Positive integers (e.g., 5, 20) src/common/utils/deployTips.ts
DISABLE_AI Disable external AI API calls while keeping configuration false 'true', 'false' All AI provider selection logic
IGNORE_AI_CACHE Disable use of AI prompt cache files to force fresh API calls false 'true', 'false' Features that cache AI results
AI_MAX_TIMEOUT_MINUTES Maximum timeout in minutes for AI operations 30 (in CI), 0 (local) Positive integers (e.g., 30, 60) src/common/aiProvider/index.ts

MegaLinter LLM Advisor

Variable Name Description Default Possible Values Usage Location
LLM_ADVISOR_ENABLED Toggle enabling the external LLM advisor used by linters/workflows undefined 'true', 'false' .github/workflows/mega-linter.yml, linters
LLM_ADVISOR_LEVEL Advisor severity level for linter suggestions undefined info, warning, error .mega-linter.yml
LLM_PROVIDER Name of the LLM provider used by linters/CI undefined openai, anthropic, google-genai, ollama, etc. .mega-linter.yml, CI configs
LLM_MODEL_NAME Model identifier used by the LLM advisor undefined Provider-specific model names (e.g., gpt-4o, claude-2) .mega-linter.yml, CI configs
LLM_MAX_TOKENS Maximum tokens to use for LLM advisor requests undefined Positive integer .mega-linter.yml, CI configs
LLM_TEMPERATURE Sampling temperature for LLM advisor requests undefined 0..1 .mega-linter.yml, CI configs
LLM_ADVISOR_WITH_METADATAS Opt-in: include Salesforce metadata file contents when calling the LLM advisor false 'true', 'false' src/common/utils/deployTipJson.ts (opt-in behavior; requires enabling in CI or env)
LLM_METADATA_SEARCH_PATHS Optional: comma-separated additional paths to search for metadata files undefined Comma-separated paths (e.g., config/,src/) Used by metadata-aware AI flows to extend search roots (suggested usage)

Agentforce (Salesforce) integration

Variable Name Description Default Possible Values Usage Location
USE_AGENTFORCE Enable use of Agentforce prompts (Salesforce-hosted prompts) false 'true', 'false' src/common/aiProvider/agentforceProvider.ts
GENERIC_AGENTFORCE_PROMPT_TEMPLATE Name of Agentforce prompt template (Flex) to use SfdxHardisGenericPrompt Any Agentforce prompt template name Agentforce integration
GENERIC_AGENTFORCE_PROMPT_URL Override URL for the Agentforce prompt generation endpoint /services/data/v{{API_VERSION}}/einstein/prompt-templates/{{GENERIC_AGENTFORCE_PROMPT_TEMPLATE}}/generations URL string Agentforce integration
SFDX_AUTH_URL_TECHNICAL_ORG (Optional) Auth URL for a technical org to use when calling Agentforce undefined Salesforce auth URL Agentforce / auth flows

Non-sensitive defaults (prompt template, custom endpoint) can be placed directly at the root of .sfdx-hardis.yml using camelCase keys that mirror the environment variables (e.g., useAgentforce, genericAgentforcePromptTemplate). Authentication details such as auth URLs or technical org credentials must still be supplied via secure variables.

LangChain integration (OpenAI, Anthropic, Gemini...)

Variable Name Description Default Possible Values Usage Location
USE_LANGCHAIN_LLM Enable LangChain-based LLM provider integration false 'true', 'false' src/common/aiProvider/langchainProvider.ts
LANGCHAIN_LLM_PROVIDER LangChain provider to use (e.g., ollama, openai, anthropic, google-genai) ollama, openai, anthropic, google-genai LangChain configuration
LANGCHAIN_LLM_MODEL Model identifier to use with the selected provider Provider-specific model names (e.g., gpt-4o, qwen2.5-coder:14b) LangChain configuration
LANGCHAIN_LLM_MODEL_API_KEY API key / credentials for the chosen LangChain provider API key string LangChain configuration
LANGCHAIN_LLM_TEMPERATURE Sampling temperature for LangChain requests 0..1 LangChain configuration
LANGCHAIN_LLM_MAX_TOKENS Maximum tokens to generate for LangChain responses Positive integer LangChain configuration
LANGCHAIN_LLM_MAX_RETRIES Number of retries for failed LangChain requests Positive integer LangChain configuration
LANGCHAIN_LLM_BASE_URL Base URL for LangChain HTTP-based providers (e.g., Ollama) http://localhost:11434 URL string LangChain / Ollama examples

You can also define non-secret defaults (provider, model, temperature, etc.) in your project .sfdx-hardis.yml using camelCase versions of the LangChain environment variables (for example langchainLlmProvider and langchainLlmModel). API keys must still be provided via secure env vars.

OpenAI (direct) variables

Variable Name Description Default Possible Values Usage Location
OPENAI_API_KEY OpenAI API key for AI operations undefined Valid OpenAI API keys src/common/aiProvider/index.ts
OPENAI_MODEL OpenAI model to use for prompts gpt-4o-mini OpenAI model names (e.g., gpt-4o-mini, gpt-4o, gpt-4o-mini-3b) OpenAI-specific configuration

Project-wide defaults (e.g., preferred model) can be stored directly at the root of .sfdx-hardis.yml using camelCase keys (for example openaiModel), but the OPENAI_API_KEY must remain in a secured environment variable.

Email Notifications

Variable Name Description Default Value Possible Values Usage Location
MS_TEAMS_WEBHOOK_URL Microsoft Teams webhook URL for notifications (deprecated) undefined Valid MS Teams webhook URLs (e.g., 'https://outlook.office.com/webhook/XXXXXXXXXXXX...') src/common/notifProvider/utils.ts
NOTIF_EMAIL_ADDRESS Email address for notifications undefined Valid email addresses (e.g., 'notifications@mycompany.com', 'alerts@example.org') src/common/notifProvider/emailProvider.ts, src/common/notifProvider/utils.ts
NOTIF_EMAIL_ADDRESS_{BRANCH} Branch-specific email address for notifications undefined Valid email addresses (e.g., 'prod-alerts@mycompany.com' for main branch) src/common/notifProvider/emailProvider.ts

Browser Automation

Variable Name Description Default Value Possible Values Usage Location
CHROMIUM_PATH Path to Chromium executable for Puppeteer undefined Valid file system paths (e.g., '/usr/bin/chromium', 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe') Found in deployment documentation
PUPPETEER_EXECUTABLE_PATH Path to Chrome/Chromium executable for Puppeteer Auto-detected Valid file system paths (e.g., '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome') src/common/utils/orgConfigUtils.ts

Generic Ticketing

Variable Name Description Default Value Possible Values Usage Location
GENERIC_TICKETING_PROVIDER_REGEX Regular expression for generic ticketing provider ticket references undefined Valid regular expressions (e.g., 'TICKET-\\d+', '[A-Z]{2,5}-\\d{1,6}', '#\\d+') src/common/ticketProvider/genericProvider.ts
GENERIC_TICKETING_PROVIDER_URL_BUILDER URL template for generic ticketing provider undefined Valid URL templates with placeholders (e.g., 'https://tickets.mycompany.com/{ticketId}', 'https://helpdesk.example.com/ticket/{ticketId}') src/common/ticketProvider/genericProvider.ts

Generic CI/CD

Variable Name Description Default Value Possible Values Usage Location
CI Indicates if running in a Continuous Integration environment undefined 'true', 'false' src/common/utils/index.ts
CI_COMMIT_REF_NAME Current git branch name in CI environment Current git branch Valid git branch names (e.g., 'main', 'develop', 'feature/new-feature', 'hotfix/urgent-fix') src/common/utils/index.ts, src/common/utils/filesUtils.ts, src/common/gitProvider/gitlab.ts, src/common/gitProvider/azureDevops.ts

Summary

This documentation covers 182 environment variables used throughout sfdx-hardis:

  • Custom sfdx-hardis Variables: 26 variables controlling native behavior
  • Tool-Specific Variables: 156 variables for external integrations

The variables are organized by functionality to help developers and administrators understand their purpose and configure them appropriately for their environments.