CLI Usage

The default way to submit file size readings is your command line app. It has a couple of useful features built in:

If you don’t have the CLI tool installed, go to installing the command line interface.

Quickstart

Submit a reading using this command:

$ bundlecop submit \
    --projectKey YOUR_PROJECT_KEY \
    --bundleset YOUR_BUNDLE_SET_ID \
    ./build/ ./artifacts/*.js
    --include *.js
    --exclude *.js

Copy your keys from the project dashboard into the configuration, and decide which files and folders you want to submit.

Specifying extensions & files

There are a couple of different ways you can specify the files to measure and submit.

By default, if you give one or more directories, these directories will be searched recursively, and everything matching an include pattern will be submitted. By default, this include pattern contains a number of well-known extensions used for web development. You can customize it using the --include option. There is also --exclude, which is processed after --include.

Examples:

# Submit files matching a default list of supported extensions.
$ bundlecop submit ./build ./dist

# Submit files matching a default list of supported extensions.
$ bundlecop submit ./build ./dist --include *.js
$ bundlecop submit ./build ./dist --exclude *.js

You can also specify files directly; those will be included regardless of any include or exclude patterns:

$ bundlecop submit ./build/bundle.js ./build/bundle.css

Finally, you can specify whole globs instructions. Be sure to wrap them in quotes, as otherwise they would be resolved by your shell:

$ bundlecop submit ./build/*.js ./build/*.css

Giving options as environment variables

All options can be specified as environment variables, prefixed with BUNDLECOP_. Here are some examples:

  • BUNDLECOP_KEY for --projectKey.
  • BUNDLECOP_BUNDLESET for --bundleset.
  • BUNDLECOP_BRANCH for --branch.
  • BUNDLECOP_COMMIT for --commit.