tfctl CLI configuration
This topic describes how to configure the tfctl CLI, including configuration file locations, environment variables, and telemetry settings.
Configuration directories
The tfctl CLI stores its configuration in the following directories:
- Linux and MacOS:
~/.config/tfctl - Windows:
%USERPROFILE%\.config\tfctl
tfctl stores configuration for individual profiles in the profiles subdirectory. For example, profiles/default.hcl stores the configuration for your default profile.
Environment variables
You can set the following variables to configure the active profile. Corresponding profile configuration flags take precedence over these variables. Configure tfctl with environment variables when you use it in automation, such as CI/CD pipelines.
TFCTL_ORGANIZATION: The organization to use for commands that require an organizationTFCTL_HOSTNAME: The Terraform Enterprise or HCP Terraform hostname. Defaults toapp.terraform.ioTFCTL_TOKEN: An HCP Terraform API token for the default profileTFCTL_TOKEN_<profile>: An HCP Terraform API token for a named profileTF_TOKEN_<hostname>: An HCP Terraform API token with hostname in Punycode format, for exampleTF_TOKEN_app_terraform_io
Set the following variables to configure CLI behavior:
TFCTL_CONFIG_DIR: Change the location of the tfctl config directory. Default is~/.config/tfctlTFCTL_SKIP_MIGRATE: Set totrueto prevent the installed skill files from migrating to the latest versionCHECKPOINT_DISABLE: Set totrueto prevent tfctl from checking for newer versions
Telemetry
By default, HashiCorp collects anonymous, redacted trace telemetry for each command invocation, including the command name, exit status, network metrics, and basic process information.
You can disable telemetry using any of these methods:
- Set
TFCTL_TELEMETRYenvironment variable todisabled - Set
DO_NOT_TRACKenvironment variable totrue - Configure in your profile:
tfctl profile set telemetry disabled
To view the telemetry that is transmitted, set profile telemetry to log:
$ tfctl profile set telemetry log