Add functionality for running commands with different environments