Skip to main content

How to install the Lightdash CLI

To install Lightdash, you'll need to have npm installed. Mac/Linux users usually already have npm available.

To install the latest Lightdash CLI, run the following on your command line.

npm install -g @lightdash/cli

Or install a specific version (eg: 0.162.0)

npm install -g @lightdash/cli@0.162.0

You may need to install an additional package if you see any errors:

Mac OS

brew install unixodbc
npm install -g @lightdash/cli

Ubuntu

sudo apt install unixodbc
npm install -g @lightdash/cli

Authenticationโ€‹

Choose your preferred way to authenticate:

  1. Run Login command to use your email and password.
  2. Via environment variables to use a personal access token and help automate CI&CD pipelines.

Loginโ€‹

To login to your Lightdash instance run the following command and provide your login email and password:

lightdash login https://my-lightdash.domain.com

where https://my-lightdash.domain.com is the address for your running Lightdash instance. For example Lightdash cloud users would type lightdash login https://app.lightdash.cloud.

Note that if you are using Google SSO login you should authenticate via environment variables instead.

Environment variablesโ€‹

You can use the following environment variables to authenticate yourself on each command:

  • LIGHTDASH_API_KEY a personal access token you can generate in the app under the user settings
  • LIGHTDASH_URL address for your running Lightdash instance

Example:

LIGHTDASH_API_KEY=946fedb74003405646867dcacf1ad345 LIGHTDASH_URL="https://app.lightdash.cloud" lightdash preview

Set active projectโ€‹

When you login you'll be asked to set an active project. You can change your active project by running:

lightdash config set-project

Or you can use the LIGHTDASH_PROJECT environment variable to indicate what project UUID the command should use.

Example:

LIGHTDASH_PROJECT="3675b69e-8324-4110-bdca-059031aa8da3" lightdash deploy