Console output capture is not reliable on Windows as Node.js there doesn't always flush buffers before exiting. Until this is fixed Windows users should use the Vagrantfile instead (see below). :bangbang:

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-run-grunt --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

"Yo dawg! I herd you like grunt, so I put some grunt in your grunt so you can grunt while you grunt." :laughing:

Use the run_grunt task to spawn new processes that run grunt-cli and optionally do work on the result data. It will use the global $ grunt command, just like when you'd run grunt manually.

Main use-case is testing your gruntfile or grunt-plugins, but it is also suited for creative use of gruntfiles and grunt-cli output.

For example use it to verify the final output of various reporters and formatters. Alternately parse the output of the "$grunt --help" command and work with the list of tasks and aliases (without instrumenting the gruntfile in any way).

If you need something similar to run grunt in a production build environment or don't really care about the content of the cli output then you are probably looking for grunt-hub instead. If you need to run tasks from one Gruntfile concurrently use grunt-concurrent or grunt-parallel.

In the future there will also be a way to use this as a standard Node.js module, so you can run grunt from inside standard scripts. Why? Who knows?