Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

Configuring the Emulator

Jason Dobry edited this page Dec 23, 2016 · 4 revisions

The Google Cloud Functions Emulator accepts configuration from three sources with the following precedence: command-line arguments, configuration file, and default settings.

For example, by default the CLI will talk to the Emulator over REST (HTTP1.1). For a single operation, you could make it use gRPC (HTTP2):

functions call helloWorld --service=grpc

Or make it always use gRPC:

functions config set service grpc
functions call helloWorld

For an explanation of all configuration settings, run the following:

functions config --help

Config file

The Emulator's CLI uses the configstore library to persist configuration settings to a config.json file located in your user's home directory.

For information on managing the config file, run:

functions config --help

You can print the contents of the config file with the following:

functions config list

Updating a value is easy:

functions config set verbose true

The Emulator must be restarted for changes to the config file to take effect.

Command-line arguments

Many commands available in the CLI take a number of optional flags which can be used to configure settings for a single operation. Run the following to get info on what flags are available for a command:

functions <command> --help

Use the config file if your want your settings to persist across restarts of the Emulator.

Defaults

You can view the default configuration settings with:

functions config defaults