New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

better-gulp-cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-gulp-cli

Better command line interface for gulp

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bettter-gulp-cli

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

Command Line Utility for Gulp

This is a fork

Fork from https://github.com/gulpjs/gulp-cli to add ability to load user-defined gulp-cli package.

Designed for https://www.npmjs.com/package/gulp-v4, but should work for any customized versions of gulp.

Installation

npm install -g better-gulp-cli

Usage

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

Use customized version of gulp, e.g. gulp-v4, add the following config to package.json,

{
  "gulp-cli": {
    "package": "gulp-v4"
  }
}

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:

PropertyDescription
descriptionTop-level description of the project/gulpfile (Replaces "Tasks for ~/path/of/gulpfile.js")
flags.continueContinue execution of tasks upon failure by default.
flags.compactTasksReduce the output of task dependency tree by default.
flags.tasksDepthSet default depth of task dependency tree.
flags.gulpfileSet a default gulpfile
flags.silentSilence 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.

FlagShort FlagDescription
--help-hShow this help.
--version-vPrint 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-TPrint the task dependency tree for the loaded gulpfile.
--tasks-simplePrint 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.
--tasks-depth [number]Specify the depth of the task dependency tree to print. This flag can be used with --tasks or --tasks-json. (This flag was named --depth before but is deprecated.)
--compact-tasksReduce the output of task dependency tree by printing only top tasks and their child tasks. This flag can be used with --tasks or --tasks-json.
--sort-tasksWill sort top tasks of task dependency tree. This flag can be used with --tasks.
--colorWill force gulp and gulp plugins to display colors, even when no color support is detected.
--no-colorWill force gulp and gulp plugins to not display colors, even when color support is detected.
--silent-SSuppress all gulp logging.
--continueContinue execution of tasks upon failure.
--log-level-LSet the loglevel. -L for least verbose and -LLLL for most verbose. -LLL is default.

License

MIT

Keywords

FAQs

Package last updated on 02 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc