Environment Variables
The Tenderly CLI uses configuration files for most settings, but you can also customize behavior through command-line flags and environment-specific configurations.Configuration Files
The CLI uses two main configuration files:Global Configuration
Global Configuration
Location: This will look for
~/.tenderly/config.yaml (or ~/.tenderly/config.json)Purpose: Stores user authentication and global settingsContents:- Access tokens and authentication keys
- Account ID
- Username or organization name
- Email (for user accounts)
--global-config flag:~/.tenderly/my-config.yaml instead of config.yaml.Project Configuration
Project Configuration
Location: This will look for
./tenderly.yaml (in your project directory)Purpose: Stores project-specific settingsContents:- Project slug
- Account ID
- Provider (deployment framework)
- Compiler configuration
- Network settings
- Actions configuration
- Node extensions configuration
--project-config flag:my-project.yaml instead of tenderly.yaml.Configuration Flags
While the Tenderly CLI doesn’t use traditional environment variables, you can configure it using global flags:Global Flags
Specify a custom global configuration file name (without extension)Example:This allows you to maintain separate configurations for different environments.
Specify a custom project configuration file name (without extension)Example:This allows you to maintain separate project configurations for different environments.
Specify the project directory containing your smart contractsExample:
Set the output format: JSON output is useful for scripting and automation.
text or jsonExample:Enable debug logging for troubleshootingExample:Debug mode provides detailed logging including:
- API request/response details
- File system operations
- Internal processing steps
Clear the set deployment provider and auto-detectExample:Useful when switching between different smart contract frameworks (Truffle, Hardhat, etc.)
Multi-Environment Setup
You can manage multiple environments using different configuration files:Separate Global Configs
Maintain separate authentication for different accounts:~/.tenderly/dev.yaml~/.tenderly/prod.yaml
Separate Project Configs
Maintain different project settings:CI/CD Integration
For continuous integration and deployment pipelines, use these patterns:Authenticate with Access Key
JSON Output for Parsing
Use JSON output mode for programmatic access:Non-Interactive Mode
Provide all parameters via flags to avoid prompts:Configuration File Locations
Global Configuration Directory
Global Configuration Directory
Default Location:
~/.tenderly/Files:config.yaml(orconfig.json) - Main config file- Custom configs when using
--global-configflag
Project Configuration Files
Project Configuration Files
Default Location: Project root directoryFiles:
tenderly.yaml(ortenderly.json) - Main project config- Custom configs when using
--project-configflag
Best Practices
Secure Credentials
Never commit authentication tokens or access keys to version control. Use:
- Separate global configs for different accounts
- CI/CD secret management for automation
- Access keys instead of email/password for automated workflows
Environment Separation
Use different project configs for different environments:
tenderly-dev.yamlfor developmenttenderly-staging.yamlfor stagingtenderly-prod.yamlfor production
Automation
For CI/CD pipelines:
- Use
--output jsonfor programmatic parsing - Provide all flags to avoid interactive prompts
- Use access keys for authentication
- Enable
--debugwhen troubleshooting
Multi-Account Management
Manage multiple Tenderly accounts:
- Use
--global-configto switch between accounts - Keep separate configs for personal, team, and client accounts
- Document which config corresponds to which account