Set env variable immediately in cli

Closes #151