How to Configure Spectacles

Most Spectacles parameters can be specified from the command line, from a YAML config file, or as an environment variable. In the Reference section, you'll find a list of global flags and validator-specific flags.


Parameters specified via the command line will override those specified by other means. Similarly, parameters in environment variables will override paramters in the config file.

Configuring via a config file

The most convenient approach for parameters that you always need to pass, like your client ID, client secret, or project, is to save your Spectacles configuration as a YAML file (.yaml or .yml).

Here's how an example config file might look. You can name it whatever you want.

client_id: HpB53crD3DMDkdJPCRc
client_secret: jDRSM6ZGG9D5WH3r5FynQ9c

When you call Spectacles, use the --config-file flag to specify the path to your config file.

spectacles connect --config-file looker_configuration.yaml

Configuring via environment variables

You can also configure Spectacles via environment variables. Not all flags have environment variables associated with them. The flags that do are listed in the Reference section of the docs.

Here's how you would configure your API credentials via environment variables:

spectacles connect