docs: function(cmd, opts) {
  
      // If we have a mode or are detached then we need to spawn
      if (opts && (opts.mode || opts.detached === true)) {
  
        /*
         * Compose run's require stdin to be a tty to get the correct output back
         * so we have to set stdin on collect to pty so it get's replaced with a
         * pseudo terminal's stdin.
         */
  
        // Stdio per mode
        var mode = kbox.core.deps.get('mode');
        var stdinMode = (mode === 'gui') ? 'ignore' : process.stdin;
        var stdErrMode = (mode === 'gui') ? 'ignore' : process.stderr;
  
        // Attach and collect modes
        var collect = {stdio: [stdinMode, 'pipe', stdErrMode]};
        var attach = {stdio: 'inherit'};
        var stdio = (opts.mode === 'attach') ? attach : collect;
  
        // Merge in our options
        var options = (opts) ? _.extend(opts, stdio) : stdio;
  
        return shell.spawn(cmd, options);
      }
  
      // Otherwise we can do a basic exec
      else {
        return shell.exec(cmd, opts);
      }
    }