gulp4-ing-cli v1.2.2
gulp-cli
Command Line Utility for Gulp
Usage
> gulp [flags] tasksCustom Metadata
When listing tasks with the gulp -T command, gulp-cli displays some custom metadata as defined upon task functions. Currently supported properties:
task.description- String of the description to display.
function clean() { ... }
clean.description = 'Cleans up generated files.';task.flags- Object with key/value pairs being flag/description to display.
function build() { ... }
build.flags = {
'--prod': 'Builds in production mode.'
};Example Usage:
function build() { ... }
build.description = 'Build entire project.';
build.flags = {
'--prod': 'Builds in production mode (minification, etc).'
};
// gulp 3.x
gulp.task('build', build);
// gulp 4.x
gulp.task(build);Tasks
Tasks can be executed by running gulp <task> <othertask>. Just running gulp will execute the task you registered called default. If there is no default task, gulp will error.
Completion
Thanks to the grunt team, specifically Tyler Kellen
To enable tasks auto-completion in shell you should add eval "$(gulp --completion=shell)" in your .shellrc file.
Bash:
Add eval "$(gulp --completion=bash)" to ~/.bashrc.
Zsh:
Add eval "$(gulp --completion=zsh)" to ~/.zshrc.
Powershell:
Add Invoke-Expression ((gulp --completion=powershell) -join [System.Environment]::NewLine) to $PROFILE.
Fish:
Add gulp --completion=fish | source to ~/.config/fish/config.fish.
Compilers
You can find a list of supported languages at https://github.com/js-cli/js-interpret. If you would like to add support for a new language, send pull requests/open issues on that project.
Environment
The CLI adds process.env.INIT_CWD which is the original cwd it was launched from.
Configuration
Configuration is supported through the use of a .gulp.* file (e.g. .gulp.json, .gulp.yml). You can find a list of supported languages at https://github.com/js-cli/js-interpret.
Configuration from the home directory (~) and current working directory (cwd) are merged with cwd taking precedence.
Supported configurations properties:
| Property | Description |
|---|---|
| description | Top-level description of the project/gulpfile (Replaces "Tasks for ~/path/of/gulpfile.js") |
Flags
gulp has very few flags to know about. All other flags are for tasks to use if needed.
Some flags only work with gulp 4 and will be ignored when invoked against gulp 3.
License
MIT
9 years ago
