grunt openport
Will set the first open port with grunt.config('port', port) in your Grunt config.

grunt openport:env.val
Will set the first open port with grunt.config('env.val', port) in your Grunt config.

grunt openport:port:8000
Will set the first open port on or above 8000 with grunt.config('port', port) in your Grunt config.

grunt openport:port:9000:9010
Will set the first open port between 9000 and 9010 with grunt.config('port', port) in your Grunt config.

grunt openports:ports:2000:3000:4000:5000:6000
Will find an open port from the given list of ports then set the array of open ports from the list with grunt.config('ports', ports) in your Grunt config.

grunt openports:ports:2000:3000:4000:5000:6000:3
Same as above but will only find the first 3 open ports.