The DataRobot CLI stores your authentication credentials and preferences in configuration files. This guide explains how configuration files work, where they're stored, and how to manage them.
Note
First time? If you're new to the CLI, you typically don't need to manually create configuration files. They're automatically created when you run dr auth set-url and dr auth login. See the Quick start guide for initial setup.
The CLI automatically stores configuration files in a standard location based on your operating system:
| Platform | Location |
|---|---|
| Linux | ~/.config/datarobot/drconfig.yaml |
| macOS | ~/.config/datarobot/drconfig.yaml |
| Windows | %USERPROFILE%\.config\datarobot\drconfig.yaml |
The main configuration file (drconfig.yaml) stores your DataRobot connection settings and authentication token. Here's what it looks like:
# DataRobot Connection
endpoint: DATA_ROBOT_ENDPOINT_URL # e.g. https://app.datarobot.com
token: API_KEY_HEREConfiguration fields:
endpoint: Your DataRobot instance URL (e.g.,https://app.datarobot.com)token: Your API authentication token (automatically stored afterdr auth login)
Note
You typically don't need to edit this file manually. The CLI manages it automatically when you use dr auth set-url and dr auth login.
Tip
If you work with multiple DataRobot environments (development, staging, production), you can maintain separate configuration files for each. For example:
# Development
~/.config/datarobot/dev-config.yaml
# Staging
~/.config/datarobot/staging-config.yaml
# Production
~/.config/datarobot/prod-config.yamlSwitch between them:
export DATAROBOT_CLI_CONFIG=~/.config/datarobot/dev-config.yaml
dr templates list# Required: DataRobot instance URL
endpoint: https://app.datarobot.com
# Required: API authentication key
token: api key hereOverride configuration with environment variables:
# DataRobot endpoint URL
export DATAROBOT_ENDPOINT=https://app.datarobot.com
# API token (not recommended for security)
export DATAROBOT_API_TOKEN=your_api_token# Custom config file path
export DATAROBOT_CLI_CONFIG=~/.config/datarobot/custom-config.yaml
# Editor for text editing
export EDITOR=nano
# Force setup wizard to run even if already completed
export DATAROBOT_CLI_FORCE_INTERACTIVE=trueThe CLI supports advanced command-line flags for special use cases:
# Skip authentication checks (advanced users only)
dr templates list --skip-auth
# Force setup wizard to run (ignore completion state)
dr templates setup --force-interactive
# Enable verbose logging
dr templates list --verbose
# Enable debug logging
dr templates list --debug
# Timeout for plugin discovery (0s disables discovery)
dr --plugin-discovery-timeout 2s --helpWarning
The --skip-auth flag bypasses all authentication checks and should only be used when you understand the implications. Commands requiring API access will likely fail without valid credentials.
When the CLI needs configuration settings, it looks for them in this order (highest to lowest priority):
- Command-line flags (e.g.,
--config <path>)—overrides everything. - Environment variables (e.g.,
DATAROBOT_CLI_CONFIG)—overrides config files. - Config files (e.g.,
~/.config/datarobot/drconfig.yaml)—default location. - Built-in defaults—fallback values.
This means if you set an environment variable, it will take precedence over what's in your config file. This is useful for temporarily overriding settings without editing files.
# Verify permissions (should be 600)
ls -la ~/.config/datarobot/drconfig.yaml
# Fix permissions if needed
chmod 600 ~/.config/datarobot/drconfig.yaml
chmod 700 ~/.config/datarobot/Warning
Never commit configuration files containing credentials. To ensure this, add them to .gitignore:
# DataRobot credentials
.config/datarobot/
.datarobot/
drconfig.yaml
config.yaml
*.yaml
!.env.template# Never use production credentials in development
# Keep separate config files
~/.config/datarobot/
├── drconfig.yaml # Default config
├── dev-config.yaml # Development
├── staging-config.yaml # Staging
└── prod-config.yaml # Production# ❌ Don't do this (visible in process list)
export DATAROBOT_API_TOKEN=my_secret_token
# ✅ Do this instead (use config file)
dr auth logintemplates:
default_clone_dir: ~/workspace/datarobotOr via environment:
export DR_TEMPLATES_DIR=~/workspace/datarobotEnable debug logging to see detailed execution information:
debug: trueOr temporarily enable it with the --debug flag:
dr --debug templates listWhen you enable debug mode, the CLI:
- Prints detailed log messages to stderr.
- Creates a
.dr-tui-debug.logfile in the home directory for terminal UI debug information.
~/.config/datarobot/dev-config.yaml:
endpoint: https://dev.datarobot.com
token: api token for devUsage:
export DATAROBOT_CLI_CONFIG=~/.config/datarobot/dev-config.yaml
dr templates list~/.config/datarobot/prod-config.yaml:
endpoint: https://app.datarobot.com
token: api key for prodUsage:
export DATAROBOT_CLI_CONFIG=~/.config/datarobot/prod-config.yaml
dr run deploy~/.config/datarobot/enterprise-config.yaml:
datarobot:
endpoint: https://datarobot.enterprise.com
token: enterprise_key
proxy: http://proxy.enterprise.com:3128
verify_ssl: true
ca_cert_path: /etc/ssl/certs/enterprise-ca.pem
timeout: 120
preferences:
log_level: warnProblem: The CLI cannot find or read the configuration file. Common causes:
- Config file doesn't exist (first-time setup)
- Incorrect file path
- Permission issues
- Environment variable overriding the default path
- Config file in wrong location
Solution:
# Check if config file exists
ls -la ~/.config/datarobot/drconfig.yaml
# If file doesn't exist, create it by running:
dr auth set-url https://app.datarobot.com
dr auth login
# Verify it's readable
cat ~/.config/datarobot/drconfig.yaml
# Check environment variables that might override the path
env | grep DATAROBOT
# Verify the directory exists
ls -la ~/.config/datarobot/If using a custom config path:
# Verify the environment variable is set correctly
echo $DATAROBOT_CLI_CONFIG
# Test with explicit path
dr templates list --config ~/.config/datarobot/drconfig.yamlProblem: YAML syntax errors in the configuration file. Common causes:
- Missing colons (
:) after keys - Incorrect indentation (YAML is sensitive to spaces)
- Invalid YAML characters
- Unclosed quotes or brackets
- Mixing tabs and spaces
Solution:
# The CLI will report syntax errors with line numbers
$ dr templates list
Error: Failed to parse config file: yaml: line 5: could not find expected ':'
# Fix syntax and try again
vim ~/.config/datarobot/drconfig.yaml
# or
nano ~/.config/datarobot/drconfig.yamlExample of correct YAML format:
# Correct format
datarobot:
endpoint: https://app.datarobot.com
token: your-api-token-here
# Common mistakes:
# ❌ Missing colon: endpoint https://app.datarobot.com
# ❌ Wrong indentation (must use spaces, not tabs)
# ❌ Missing quotes for values with special charactersValidate YAML syntax:
# Use a YAML validator or check manually
python3 -c "import yaml, os; yaml.safe_load(open(os.path.expanduser('~/.config/datarobot/drconfig.yaml')))"Problem: The CLI cannot read or write the configuration file due to file system permissions. This can occur when:
- File permissions are too restrictive for the current user
- Directory permissions prevent file access
- File was created by a different user (e.g., with
sudo) - SELinux or AppArmor restrictions (Linux)
Solution:
# Fix file permissions (owner read/write only)
chmod 600 ~/.config/datarobot/drconfig.yaml
# Fix directory permissions (owner read/write/execute)
chmod 700 ~/.config/datarobot/
# Verify permissions
ls -la ~/.config/datarobot/drconfig.yaml
# Should show: -rw------- (600)If file was created with sudo:
# Change ownership to your user
sudo chown $USER:$USER ~/.config/datarobot/drconfig.yaml
chmod 600 ~/.config/datarobot/drconfig.yamlFor Windows:
# Check file permissions
icacls %USERPROFILE%\.config\datarobot\drconfig.yaml
# If needed, grant full control to your user
icacls %USERPROFILE%\.config\datarobot\drconfig.yaml /grant %USERNAME%:FProblem: Managing multiple environments (dev, staging, production) with separate configurations.
Solution:
# List all config files
find ~/.config/datarobot -name "*.yaml"
# Switch between them using environment variable
export DATAROBOT_CLI_CONFIG=~/.config/datarobot/dev-config.yaml
dr templates list
# Or use inline for single commands
DATAROBOT_CLI_CONFIG=~/.config/datarobot/prod-config.yaml dr templates listCreate a helper script for easy switching:
# Add to ~/.bashrc or ~/.zshrc
alias dr-dev='export DATAROBOT_CLI_CONFIG=~/.config/datarobot/dev-config.yaml'
alias dr-prod='export DATAROBOT_CLI_CONFIG=~/.config/datarobot/prod-config.yaml'
alias dr-staging='export DATAROBOT_CLI_CONFIG=~/.config/datarobot/staging-config.yaml'
# Usage:
dr-dev
dr templates list # Uses dev config
dr-prod
dr templates list # Uses prod configTip
Always verify which config is active before running commands in production:
echo "Current config: $DATAROBOT_CLI_CONFIG"
cat $DATAROBOT_CLI_CONFIGExample output:
Current config: ~/.config/datarobot/prod-config.yamlThe CLI maintains state information about your interactions with repositories to provide a better user experience. State is tracked per-repository and stores metadata about command executions.
The CLI stores state locally within each repository:
.datarobot/cli/state.yamlin template directory
The state file tracks:
- CLI version: Version of the CLI used for the last successful execution
- Last start: Timestamp of the last successful
dr startexecution - Last dotenv setup: Timestamp of the last successful
dr dotenv setupexecution
cli_version: 1.0.0
last_start: 2025-11-13T00:02:07.615186Z
last_dotenv_setup: 2025-11-13T00:15:30.123456ZAll timestamps are in ISO 8601 format (UTC).
dr start: Updates state after successful executiondr dotenv setup: Records when environment setup was completeddr templates setup: Skips dotenv setup if it was already completed (based on state)
State files are automatically created and updated. To reset state for a repository:
# Remove repository state
rm .datarobot/cli/state.yamlYou can also force the wizard to run without deleting the state file by using the --force-interactive flag:
# Force re-execution of setup wizard while preserving state
dr templates setup --force-interactive
# Or via environment variable
export DATAROBOT_CLI_FORCE_INTERACTIVE=true
dr templates setupThis flag makes commands behave as if setup has never been completed, while still updating the state file. This is useful for:
- Testing setup flows
- Forcing reconfiguration without losing state history
- Development and debugging
State files are small and do not require manual management under normal circumstances. Each repository maintains its own state independently.
- Quick start—initial setup and first-time configuration
- auth command—authentication commands and troubleshooting
Tip
What's next? After understanding configuration:
- Set up authentication:
dr auth login(see auth command) - Browse templates:
dr templates list - Set up your first template:
dr templates setup