getkirby / cli

Kirby Command Line Interface
MIT License
51 stars 5 forks source link

Enable host setup loading via ENV variable #78

Closed bastianallgeier closed 3 months ago

bastianallgeier commented 4 months ago

You can now load a different host config by setting the new KIRBY_HOST env variable:

env KIRBY_HOST=production.com kirby my-command

@lukasbestle could you have a look at this. I tried to also implement the idea of an additional --env or --host option, but we need to load Kirby first before we can really start parsing the arguments and it would have turned into a bad hack.

I found HOST to be better than ENV, but I wonder if we should do KIRBY_CLI_HOST instead? Not entirely sure.

lukasbestle commented 4 months ago

I like KIRBY_HOST. Don't think we need KIRBY_CLI_HOST as it's obvious we are running the CLI and the command is just called kirby.

Implementation looks good as well. 👍