GULP(1)

πŸ¦‹ GULP(1) πŸ¦‹

okay bestie, sit down, hydrate, because we're about to talk about gulp β€” the General Commands Manual's finest, and honestly? she's iconic. πŸ’…


πŸ’– NAME πŸ’–

gulp β€” that's it, that's the name. short, sweet, lowercase, main character energy. πŸ‘‘


✨ gulp CLI docs ✨

🌸 Flags 🌸

okay so here's the tea: gulp has very few flags to know about. literally, she's low maintenance. every other flag out there is for tasks to use if they need it, not for the CLI itself. 🫢

  • -v, --version β€” shows you the global gulp version and the local gulp version. both. at once. obsessed. ✨
  • --require <module path> β€” requires a module before running the gulpfile. super useful for transpilers but honestly it has other applications too, iykyk. and yes β€” you can stack multiple --require flags. go off. πŸ”₯
  • --gulpfile <gulpfile path> β€” manually sets the path of the gulpfile. perfect if you've got multiple gulpfiles lying around like little collectibles πŸŽ€. heads up: this also sets the CWD to the gulpfile directory. two for one.
  • --cwd <dir path> β€” manually sets the CWD. from here, the search for the gulpfile happens, and all requires are relative from here too. it's giving home base. 🏠
  • -T, --tasks β€” displays the task dependency tree for the loaded gulpfile. it includes the task names and their descriptions. she's thorough πŸ’…
  • --tasks-simple β€” displays a plaintext list of tasks for the loaded gulpfile. no tree, no drama, just vibes. 🌈
  • --verify β€” verifies the plugins referenced in the project's package.json against the plugins blacklist. safety first bestie ⭐
  • --color β€” forces gulp and gulp plugins to display colors even when no color support is detected. pink is a lifestyle. πŸŽ€
  • --no-color β€” forces gulp and gulp plugins to not display colors even when color support is detected. sometimes we're in our minimal era. πŸ™ˆ
  • --silent β€” disables all gulp logging. not a peep. πŸ’€
πŸ’‘ also: the CLI adds process.env.INIT_CWD, which is the original cwd it was launched from. no cap, remember that one.

🌼 Task specific flags 🌼

want task specific flags? there's a StackOverflow link referenced for exactly how to add those. go check it out, bestie, she's got the answers. 🧚


πŸ’œ Tasks πŸ’œ

tasks get executed by running:

gulp <task> <task>...

here's the part that catches people off guard, so listen up 🫢: if you list more than one task, Gulp will execute all of them concurrently β€” that is, as if they had all been listed as dependencies of a single task.

⚠️ Gulp does NOT serialize tasks listed on the command line. fr fr. if you're coming from other comparable tools, you might expect something like gulp clean build β€” with tasks named clean and build β€” to run one then the other. it will not. the two tasks will be executed concurrently, and you will not get the intended result. this is the plot twist, bestie. 😭

and if you just run:

gulp

she'll execute the task default. but if there is no default task? gulp will error. periodt. πŸ’…


πŸ¦‹ Compilers πŸ¦‹

you can find a list of supported languages at interpret. want to add support for a new language? send a pull request / open issues over there. they'd love to hear from you, go be the main character. ✨


🌈 Examples 🌈

🌸 Example gulpfile 🌸

gulp.task('one', function(done) {
  // do stuff
  done();
});

gulp.task('two', function(done) {
  // do stuff
  done();
});

gulp.task('three', three);

function three(done) {
  done();
}
three.description = "This is the description of task three";

gulp.task('four', gulp.series('one', 'two'));

gulp.task('five',
  gulp.series('four',
    gulp.parallel('three', function(done) {
      // do more stuff
      done();
    })
  )
);

πŸŽ€ -T or --tasks πŸŽ€

command: gulp -T or gulp --tasks

output:

[20:58:55] Tasks for ~\exampleProject\gulpfile.js
[20:58:55] β”œβ”€β”€ one
[20:58:55] β”œβ”€β”€ two
[20:58:55] β”œβ”€β”€ three                                         This is the description of task three
[20:58:55] β”œβ”€β”¬ four
[20:58:55] β”‚ └─┬ <series>
[20:58:55] β”‚   β”œβ”€β”€ one
[20:58:55] β”‚   └── two
[20:58:55] β”œβ”€β”¬ five
[20:58:55] β”‚ └─┬ <series>
[20:58:55] β”‚   β”œβ”€β”¬ four
[20:58:55] β”‚   β”‚ └─┬ <series>
[20:58:55] β”‚   β”‚   β”œβ”€β”€ one
[20:58:55] β”‚   β”‚   └── two
[20:58:55] β”‚   └─┬ <parallel>
[20:58:55] β”‚     β”œβ”€β”€ three
[20:58:55] β”‚     └── <anonymous>

look at that tree. she's branching. she's thriving. πŸŒ³πŸ’–


⭐ --tasks-simple ⭐

command: gulp --tasks-simple

output:

one
two
three
four
five

just the names, no notes. clean, minimal, ate. πŸ”₯


and that's the whole page, bestie!! this one's from gulp 4.0.2, dated March 2025, straight out of the General Commands Manual. go run a task, slay a build, and remember: concurrency is not serialization. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from