Create global configuration using Grunt JS

Ok, I have a couple of questions. First of all, I'd like to call grunt in different ways, for example:

grunt prod

And I'd like that when I call it like this, it creates my config file like follows:

this.config = {
  debug = false,
  stack = 'prod',
  server = 'http://' + stack + 'xxx.xx',
  mock = false
  ...
};

So I can make it pointing to prod and change also some other variables. Also, add that object in the begging of my build.js. The only plugin I found capable to do something similar is: ng-constants. However, I am not using Angular... and I also don't want a plugin depending on Angular.

Second part of the question is for this "stack"-"server" variable. Will be possible for grunt to detect the machine I am (for example 'http://prod.xxx.xx' and set this variable automatically?, so I only need to call 'grunt' in those machines).

Thank you in advance.