From 1b2607d38c788f0a1829c4029ae3934c70e02ed6 Mon Sep 17 00:00:00 2001 From: Oliver Laslett <11660098+owlas@users.noreply.github.com> Date: Fri, 12 Dec 2025 15:50:24 +0000 Subject: [PATCH 1/3] Update guides/cli/cli-authentication.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> --- guides/cli/cli-authentication.mdx | 84 +++++++++++++++++++------------ 1 file changed, 53 insertions(+), 31 deletions(-) diff --git a/guides/cli/cli-authentication.mdx b/guides/cli/cli-authentication.mdx index 9d6a2be7..c0adafb3 100644 --- a/guides/cli/cli-authentication.mdx +++ b/guides/cli/cli-authentication.mdx @@ -6,56 +6,80 @@ icon: "key" ## Login - - -To log in to your Lightdash instance using OAuth2, run the following command: +The CLI uses browser-based OAuth login by default, making authentication quick and easy. - ```bash - lightdash login https://{{ lightdash_domain }} --oauth - ``` +### Basic login - where `{{ lightdash_domain }}` is the address for your running Lightdash instance. For example Lightdash cloud users in the US would type `lightdash login https://app.lightdash.cloud` if you're in Europe you'd type`lightdash login https://eu1.lightdash.cloud`. +```bash +lightdash login analytics +``` -This will open a new tab in your default browser. Log in to your Lightdash account (if you're not already logged in), then authorize the lightdash-cli client. +This opens your browser to authenticate. Once authorized, you're logged in and ready to use the CLI. -Once authorized, you’ll be logged in and ready to use the CLI. + + + - - - +### Flexible URL formats - - - - - To login to your Lightdash instance run the following command and provide your login email and password: +The CLI accepts your instance URL in multiple formats - all of these work: + +```bash +# Just your subdomain (recommended for Lightdash Cloud) +lightdash login analytics + +# Full domain without protocol +lightdash login analytics.lightdash.cloud + +# Full URL with protocol +lightdash login https://analytics.lightdash.cloud + +# Any URL from your Lightdash instance (useful for copying from browser) +lightdash login https://analytics.lightdash.cloud/projects/abc123/dashboards +``` + +For Lightdash Cloud users, you can simply use your subdomain (e.g., `analytics` if your instance is at `analytics.lightdash.cloud`). + +For self-hosted instances, you can use the full domain without the `https://` prefix - it's assumed automatically. + +### Re-authenticate to a previous instance + +Once you've logged in, you can re-authenticate without specifying the URL: + +```bash +lightdash login +``` + +This uses your previously saved instance URL. + + + + If you prefer to use email and password instead of browser-based OAuth: ```bash - lightdash login https://{{ lightdash_domain }} + lightdash login analytics --no-oauth ``` - where `{{ lightdash_domain }}` is the address for your running Lightdash instance. For example Lightdash cloud users in the US would type `lightdash login https://app.lightdash.cloud` if you're in Europe you'd type`lightdash login https://eu1.lightdash.cloud`. + You'll be prompted to enter your email and password. - - First, you'll need to create a new personal access token in the UI by going to Settings > Personal Access Tokens. You can't use an existing personal access token! You have to create a new one just for yourself. + + If you use single sign-on (SSO) in the browser, login with a personal access token. - {' '} + First, create a new personal access token in the UI by going to Settings > Personal Access Tokens. - Then, run the following command in your project: + Then, run the following command: ```bash - lightdash login https://{{ lightdash_domain }} --token + lightdash login analytics --token ``` - - where `https://my-lightdash.domain.com` is the address for your running Lightdash instance. For example Lightdash cloud users in the US would type `lightdash login https://app.lightdash.cloud` if you're in Europe you'd type`lightdash login https://eu1.lightdash.cloud`. - + 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 @@ -67,10 +91,8 @@ Once authorized, you’ll be logged in and ready to use the CLI. Example: ```bash - LIGHTDASH_API_KEY=946fedb74003405646867dcacf1ad345 LIGHTDASH_URL="https://{{ lightdash_domain }}" LIGHTDASH_PROXY_AUTHORIZATION="Bearer " lightdash preview + LIGHTDASH_API_KEY=946fedb74003405646867dcacf1ad345 LIGHTDASH_URL="https://analytics.lightdash.cloud" LIGHTDASH_PROXY_AUTHORIZATION="Bearer " lightdash preview ``` - - Where `{{ lightdash_domain }}` is your domain. For Lightdash Cloud users use `https://app.lightdash.cloud` @@ -108,4 +130,4 @@ Some of our favourites are: * [Testing your changes with developer previews using lightdash preview](/guides/cli/how-to-use-lightdash-preview) -* [Deploying your changes to production using lightdash deploy](/guides/cli/how-to-use-lightdash-deploy) \ No newline at end of file +* [Deploying your changes to production using lightdash deploy](/guides/cli/how-to-use-lightdash-deploy) From 9cad6f11702ae8b549c7192ef3105c3e58b93edc Mon Sep 17 00:00:00 2001 From: Jake Peterson <5532776+jpetey75@users.noreply.github.com> Date: Wed, 17 Dec 2025 19:18:31 -0600 Subject: [PATCH 2/3] clean up AI changes --- guides/cli/cli-authentication.mdx | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/guides/cli/cli-authentication.mdx b/guides/cli/cli-authentication.mdx index c0adafb3..77976b57 100644 --- a/guides/cli/cli-authentication.mdx +++ b/guides/cli/cli-authentication.mdx @@ -10,8 +10,17 @@ The CLI uses browser-based OAuth login by default, making authentication quick a ### Basic login + + ```bash -lightdash login analytics +lightdash login {{ lightdash_domain }} +``` + +where `{{ lightdash_domain }}` is the subdomain for your Lightdash instance. For example, if you login at `https://petey.lightdash.cloud`, then you would type `lightdash login petey` to pop up a login window. + + +```bash +lightdash login petey ``` This opens your browser to authenticate. Once authorized, you're logged in and ready to use the CLI. @@ -20,28 +29,30 @@ This opens your browser to authenticate. Once authorized, you're logged in and r + ### Flexible URL formats -The CLI accepts your instance URL in multiple formats - all of these work: +The CLI accepts your instance URL in multiple formats, all of these work: ```bash # Just your subdomain (recommended for Lightdash Cloud) -lightdash login analytics +lightdash login your_subdomain_here # Full domain without protocol -lightdash login analytics.lightdash.cloud +lightdash login your_subdomain_here.lightdash.cloud # Full URL with protocol -lightdash login https://analytics.lightdash.cloud +lightdash login https://your_subdomain_here.lightdash.cloud # Any URL from your Lightdash instance (useful for copying from browser) -lightdash login https://analytics.lightdash.cloud/projects/abc123/dashboards +lightdash login https://your_subdomain_here.lightdash.cloud/projects/abc123/dashboards ``` -For Lightdash Cloud users, you can simply use your subdomain (e.g., `analytics` if your instance is at `analytics.lightdash.cloud`). +For Lightdash Cloud users, you can simply use your subdomain (e.g., `petey` if your instance is at `petey.lightdash.cloud`). For self-hosted instances, you can use the full domain without the `https://` prefix - it's assumed automatically. + ### Re-authenticate to a previous instance Once you've logged in, you can re-authenticate without specifying the URL: @@ -57,7 +68,7 @@ This uses your previously saved instance URL. If you prefer to use email and password instead of browser-based OAuth: ```bash - lightdash login analytics --no-oauth + lightdash login your_subdomain_here --no-oauth ``` You'll be prompted to enter your email and password. @@ -75,7 +86,7 @@ This uses your previously saved instance URL. Then, run the following command: ```bash - lightdash login analytics --token + lightdash login your_subdomain_here --token ``` @@ -91,7 +102,7 @@ This uses your previously saved instance URL. Example: ```bash - LIGHTDASH_API_KEY=946fedb74003405646867dcacf1ad345 LIGHTDASH_URL="https://analytics.lightdash.cloud" LIGHTDASH_PROXY_AUTHORIZATION="Bearer " lightdash preview + LIGHTDASH_API_KEY=946fedb74003405646867dcacf1ad345 LIGHTDASH_URL="https://your_subdomain_here.lightdash.cloud" LIGHTDASH_PROXY_AUTHORIZATION="Bearer " lightdash preview ``` From 42652d8fb78459497e94a6bde6e7dd65d0cf6afa Mon Sep 17 00:00:00 2001 From: Jake Peterson <5532776+jpetey75@users.noreply.github.com> Date: Wed, 17 Dec 2025 21:01:37 -0600 Subject: [PATCH 3/3] fix image ref --- guides/cli/cli-authentication.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/cli/cli-authentication.mdx b/guides/cli/cli-authentication.mdx index 77976b57..a1aea969 100644 --- a/guides/cli/cli-authentication.mdx +++ b/guides/cli/cli-authentication.mdx @@ -26,7 +26,7 @@ lightdash login petey This opens your browser to authenticate. Once authorized, you're logged in and ready to use the CLI. - +