@lightdash/cli 3.87.0 → 3.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +18 -0
  2. package/dist/.tsbuildinfo.build +1 -1
  3. package/dist/agentConnections/agentTokenProvider.d.ts.map +1 -1
  4. package/dist/agentConnections/agentTokenProvider.js +9 -5
  5. package/dist/agentConnections/commandPolicy.d.ts.map +1 -1
  6. package/dist/agentConnections/commandPolicy.js +1 -0
  7. package/dist/agentConnections/initialToken.d.ts.map +1 -1
  8. package/dist/agentConnections/initialToken.js +2 -0
  9. package/dist/agentConnections/personalRecovery.js +1 -1
  10. package/dist/analytics/analytics.js +1 -1
  11. package/dist/config.d.ts +2 -0
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js +19 -11
  14. package/dist/credentials.d.ts +5 -0
  15. package/dist/credentials.d.ts.map +1 -1
  16. package/dist/credentials.js +11 -2
  17. package/dist/handlers/apps/createApp.d.ts.map +1 -1
  18. package/dist/handlers/apps/createApp.js +1 -3
  19. package/dist/handlers/apps/preview.d.ts.map +1 -1
  20. package/dist/handlers/apps/preview.js +12 -10
  21. package/dist/handlers/apps/previewProxy.d.ts +1 -0
  22. package/dist/handlers/apps/previewProxy.d.ts.map +1 -1
  23. package/dist/handlers/apps/previewProxy.js +70 -44
  24. package/dist/handlers/dbt/apiClient.d.ts.map +1 -1
  25. package/dist/handlers/dbt/apiClient.js +20 -12
  26. package/dist/handlers/diagnostics.d.ts.map +1 -1
  27. package/dist/handlers/diagnostics.js +2 -1
  28. package/dist/handlers/download.d.ts.map +1 -1
  29. package/dist/handlers/download.js +4 -9
  30. package/dist/handlers/login/pat.d.ts.map +1 -1
  31. package/dist/handlers/login/pat.js +2 -0
  32. package/dist/handlers/login.d.ts.map +1 -1
  33. package/dist/handlers/login.js +8 -2
  34. package/dist/handlers/logout.d.ts +3 -0
  35. package/dist/handlers/logout.d.ts.map +1 -0
  36. package/dist/handlers/logout.js +67 -0
  37. package/dist/handlers/oauthLogin.d.ts +1 -1
  38. package/dist/handlers/oauthLogin.d.ts.map +1 -1
  39. package/dist/handlers/oauthLogin.js +64 -31
  40. package/dist/handlers/renameHandler.d.ts.map +1 -1
  41. package/dist/handlers/renameHandler.js +3 -3
  42. package/dist/handlers/slugUpdate.d.ts.map +1 -1
  43. package/dist/handlers/slugUpdate.js +3 -3
  44. package/dist/handlers/utils.d.ts.map +1 -1
  45. package/dist/handlers/utils.js +1 -0
  46. package/dist/index.js +6 -0
  47. package/dist/personalLogin/fixtures.d.ts +3 -0
  48. package/dist/personalLogin/fixtures.d.ts.map +1 -0
  49. package/dist/personalLogin/fixtures.js +20 -0
  50. package/dist/personalLogin/instanceKey.d.ts +2 -0
  51. package/dist/personalLogin/instanceKey.d.ts.map +1 -0
  52. package/dist/personalLogin/instanceKey.js +23 -0
  53. package/dist/personalLogin/schema.d.ts +28 -0
  54. package/dist/personalLogin/schema.d.ts.map +1 -0
  55. package/dist/personalLogin/schema.js +69 -0
  56. package/dist/personalLogin/store.d.ts +24 -0
  57. package/dist/personalLogin/store.d.ts.map +1 -0
  58. package/dist/personalLogin/store.js +124 -0
  59. package/dist/personalLogin/tokenProvider.d.ts +31 -0
  60. package/dist/personalLogin/tokenProvider.d.ts.map +1 -0
  61. package/dist/personalLogin/tokenProvider.js +180 -0
  62. package/package.json +3 -3
package/README.md CHANGED
@@ -24,6 +24,18 @@ Commands:
24
24
 
25
25
  eg: `ligthdash test` Runs `dbt test`
26
26
 
27
+ ## Browser login
28
+
29
+ `lightdash login <url>` saves OAuth access and refresh tokens for that instance.
30
+ The personal session ends eight hours after login. Refresh does not extend it.
31
+ Run `lightdash logout` to revoke the tokens and remove the saved login.
32
+ Personal CLI logins follow PAT admission on REST. OAuth scopes, role checks
33
+ and human-only admin guards still apply. They cannot call MCP because browser
34
+ login does not request MCP scopes. See [admission by surface](../../docs/agent-identity/agent-permissions.md#personal-cli-admission-by-surface).
35
+
36
+ A browser login cannot start `lightdash agent connect` or use `agent revoke
37
+ --human`. First run `lightdash login <url> --token <personal access token>`.
38
+
27
39
  ## Agent connection
28
40
 
29
41
  ### Warehouse sign-in
@@ -251,6 +263,12 @@ LIGHTDASH_PROJECT=<target-project-uuid> lightdash deploy --non-interactive
251
263
 
252
264
  With no agent connection selected, credentials resolve in the usual order: command flags, then environment variables, then the config file written by `lightdash login`. So a `LIGHTDASH_API_KEY` left in your shell profile is used ahead of your saved login — `lightdash login` warns when this is the case, and `unset LIGHTDASH_API_KEY` restores the saved token.
253
265
 
266
+ Personal logins accept HTTP and HTTPS instance URLs, including internal hosts. Browser login does not send an OAuth resource parameter.
267
+
268
+ Browser login saves OAuth access and refresh tokens in `personal-logins.yaml` beside the CLI config, with file mode `0600`. Commands refresh access tokens as needed. The session lasts eight hours by default; after it expires, run `lightdash login` again. If a refresh does not complete, sign in again to avoid reusing a refresh token.
269
+
270
+ Run `lightdash logout` to revoke the configured instance's browser session and remove the local login. If the server cannot be reached, the CLI keeps the login so you can retry. For a saved API key, logout removes the key locally; revoke a personal access token in your account settings. `--token` and `--email` logins continue to save an API key and replace any browser login for that instance.
271
+
254
272
  For a selected connection, see [Scoped CLI credentials](#scoped-cli-credentials)
255
273
  for credential selection and local program access.
256
274