GithubHelp home page GithubHelp logo

gulp-cli's Introduction

gulp-cli

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Command Line Utility for Gulp

Usage

> gulp [flags] <task> <task>...

Custom 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

The task(s) listed on the command line will be executed. If more than one task is listed, 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. From using other comparable tools users may expect to execute something like gulp clean build, with tasks named clean and build. This will not produce the intended result, as the two tasks will be executed concurrently.

Just running gulp will execute the task 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.gulpfile Set a default gulpfile
flags.silent Silence logging by default

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.

Flag Short Flag Description
--help -h Show this help.
--version -v Print the global and local gulp versions.
--require [path] Will require a module before running the gulpfile. This is useful for transpilers but also has other applications.
--gulpfile [path] Manually set path of gulpfile. Useful if you have multiple gulpfiles. This will set the CWD to the gulpfile directory as well.
--cwd [path] Manually set the CWD. The search for the gulpfile, as well as the relativity of all requires will be from here.
--verify [path (optional)] Will verify plugins referenced in project's package.json against the plugins blacklist.
--tasks -T Print the task dependency tree for the loaded gulpfile.
--depth [number] Specify the depth of the task dependency tree to print.
--tasks-simple Print a plaintext list of tasks for the loaded gulpfile.
--tasks-json [path] Print the task dependency tree, in JSON format, for the loaded gulpfile. The [path] argument is optional, and if given writes the JSON to the path.
--color Will force gulp and gulp plugins to display colors, even when no color support is detected.
--no-color Will force gulp and gulp plugins to not display colors, even when color support is detected.
--silent -S Suppress all gulp logging.
--continue Continue execution of tasks upon failure.
--log-level -L Set the loglevel. -L for least verbose and -LLLL for most verbose. -LLL is default.

License

MIT

gulp-cli's People

Contributors

phated avatar heikki avatar sttk avatar romanx avatar pdehaan avatar sindresorhus avatar jpeer264 avatar xiphe avatar axvm avatar austinpray avatar soulcutter avatar erikkemperman avatar kahlil avatar stramel avatar nmn avatar nicosantangelo avatar suyash avatar louisremi avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.