add cwd and env to run command api

to add build on publish we need to be in the same cwd as the terminal. Everything we run should have the same cwd and env's