I am looking to update SFDX_IMPROVED_CODE_COVERAGE Environment variable to true. Loosely documented here and here. I am using the syntax documented here that seems to show that I can update that Environment variable with something like this:

sfdx force:config:set improvedCodeCoverage=true

however i get this error in the terminal: ERROR running force:config:get: Unknown config key: improvedCodeCoverage.

Any ideas on what i am doing wrong here? coverting to camelcase seems to be what is documented


SFDX config values and environment variable-based configuration are not necessarily congruent, and at least based on the documentation, it looks like these are not: you have to actually set the environment variable.

You can do that for a single command by doing

SFDX_IMPROVED_CODE_COVERAGE=true sfdx force:do:work ...

or set it for a shell session with


If you wish that to be permanent, set it in the config file for your shell (such as ~/.zshrc if you use zsh).

| improve this answer | |
  • Appreciate the answer! I'm on a Mac and zsh looks to be the default. I am a bit new to these command line shells so forgive me but I found a file named zshrc in the hidden etc folder. It says "Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)". Where in this file should i set an environment variable? Theres Default key bindings and default prompt but no default Environment variables – Bobbygllh Apr 23 at 14:04
  • If you don't have a .zshrc file in your home directory, you can create one. You'd then add the export ... line above into that file. Don't modify the one in /etc; that's the global zsh config. – David Reed Apr 23 at 14:06
  • thanks for the help! – Bobbygllh Apr 23 at 14:18

Environment variables always refer to the system's environment variables, not any configuration settings in an app. You can see your current variables with env in any Windows shell. To set them globally, go to Win+X, System, System Info > Advanced System Settings > Environment Variables..., and add a new variable there. Make sure you restart any terminals/shells for the variables to take effect. As mentioned by David, msys32/bash/zsh/etc have "rc" files that you can use to set an environment variable for a single terminal as well. Refer to the online help manual for whichever shell you're using.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.