Hi Previously I used the grunt
in that I want to know the available tasks use grunt --help
. But same as in gulp
use gulp --help
it doesn't show. What is the command to know the available tasks list in gulp

- 4,817
- 5
- 23
- 34
8 Answers
Yes I got it use the gulp --tasks
in command then it display the tasks list.

- 4,817
- 5
- 23
- 34
-
2ahhh i see, that wasn't in 3.9.0 only brought it in with 4.0, nice info – marblewraith Jun 12 '15 at 05:26
-
3@MatthewRath `3.9.x` also has the `--tasks` flag. So it works (at least on my local 3.9.1) – Jesper Rønn-Jensen Aug 02 '16 at 10:23
-
4`gulp --tasks-simple` is perhaps nicer because it displays just the top level tasks, a very clean list, whereas `gulp --tasks` also shows the task dependency graph -- I guess it all depends on how much detail you want. – Purplejacket Dec 21 '16 at 01:07
-
This limit the task depth to top level and also show descriptions: `gulp -T --depth 1` – Fred Yang Feb 13 '18 at 03:04
gulp --tasks-simple
This command print a plaintext list of tasks. My local project:
~ gulp --tasks-simple
clean
default
From gulp CLI documentation:
~ gulp --version
[03:00:05] CLI version 1.2.1
[03:00:05] Local version 4.0.0-alpha.2
~ gulp --help | grep 'tasks-simple'
--tasks-simple Print a plaintext list of tasks for the loaded gulpfile. [boolean]

- 3,090
- 3
- 20
- 25
Another possibility is to use gulp-help-doc module, which provides possibility to print usage information based on jsDoc-like comments in a gulpfile. Currently it also supports TypeScript as well. The benefit is that you simply commenting your code without changing gulp API and you have usage info in command-line as well.

- 31
- 3
you can also use this plugin gulp-task-listing. It gives the main-tasks
and sub-tasks list

- 17,807
- 9
- 78
- 125
-
1I couldn't get this to work w/ Gulp 3.9. Kept getting this error: __**TypeError:** Cannot convert undefined or null to object.__ because `gulp.tasks` was null. – Oak Jun 29 '16 at 23:10
-
1yah @VinegarStrokes I have the same issue with Gulp 4. Did you solve this? – mtpultz Jul 19 '16 at 08:46
As an alternative you can write detailed documentation to your tasks in js comments using gulp-task-doc

- 3,431
- 1
- 22
- 25
If you are using Gulp 4 you can do the following:
const tasks = gulp.registry().tasks();
// Outputs a JS object: { <task name>: <function>, ...}
console.log(tasks);
const taskNames = Object.Keys(tasks);
// Outputs a JS array: ['<task name>', ...]
console.log(taskNames);

- 9,434
- 3
- 36
- 57
There is no native command that does that but i use this plugin with the following code:
module.exports.help = require('gulp-help')(gulp, {description : false});
I can then just run the default gulp
task in the console and it'll display a list of tasks and definitions.

- 768
- 5
- 16
-
Thank you. Is there any way to get in console with out using ` gulp-help` – vamsikrishnamannem Jun 11 '15 at 10:05
-
Not that i've come across, i imagine there would be a way if you fell back to using nodeJS natively but that sounds overly complex. Post if you find an answer. – marblewraith Jun 11 '15 at 10:08
-
8
inspired by @matt-gaunt https://stackoverflow.com/a/65571474/1347601
// gulp task
const list = () => {
const tasks = gulp.registry().tasks();
for (const [key, value] of Object.entries(tasks)) {
console.log(key);
}
}
gulp.task('list', list);
// gulp process default
gulp.task('list', gulp.series(
list
));

- 6,623
- 5
- 41
- 47