Tom Connors

08/18/2022, 7:24 PM
Hello, I have two directories that I am playing with infracost, and by mistake was in the parent directory and issued a infracost command, perhaps during install or setting the api key. There as a .infracost directory created in the parent directory and I deleted it. The .infracost directory should only be in each project directory or my root, - wherever infracost wants it to be (not sure). Anyway, I deleted the parent directory .infracost directory, and perhaps concidently whenever I attempt to do anything, such as set the api key, I always get this message 2022/08/18 19:19:53 Can't separate key from value
Hugo (Infracost)

Hugo (Infracost)

08/18/2022, 7:30 PM
Hey Tom 👋
7:32 PM
The “can't separate key from value” error normally originates from having a malformed .env file within your project path.
7:33 PM
It normally means theres a variable defined without a mapping in that file
7:33 PM
Are you using a env file in any of these directories?

Tom Connors

08/18/2022, 7:36 PM
Yes, I store my notes there. Perhaps it could mention that in the error message? I can comment out my text in the .env. Thanks
7:38 PM
So do I not need to set the api key if it is in the .env ?

Sylvain Witmeyer

08/18/2022, 7:40 PM
We recommend using this environment variable in CI/CD integrations; it overrides any values you might have set in .config/infracost/credentials.yml, .env or .env.local too.