@lightdash/cli 2.577.0 → 2.577.1

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.
package/README.md CHANGED
@@ -26,7 +26,10 @@ eg: `ligthdash test` Runs `dbt test`
26
26
 
27
27
  ## Agent connection
28
28
 
29
- Use your saved CLI login to connect your agent to the warehouse:
29
+ ### Warehouse sign-in
30
+
31
+ Bare `agent connect` and unnamed, unselected `agent status` use your saved
32
+ personal CLI login for warehouse sign-in:
30
33
 
31
34
  ```shell
32
35
  lightdash agent connect --project my-project
@@ -43,6 +46,41 @@ Use `--oauth-port <port>` to choose the local callback port, or set
43
46
  connection every 3 seconds for up to another 120 seconds. Both commands accept
44
47
  `--verbose` and exit with code 1 if the connection is refused or incomplete.
45
48
 
49
+ ### Scoped CLI credentials
50
+
51
+ An agent connection limits the projects and actions available to requests that use
52
+ its credential. Programs the CLI starts run as your computer user and can still
53
+ read your files, including your saved personal API key and connection tokens.
54
+ Removing the API key from those programs' environment helps avoid accidental use
55
+ or exposure; it does not isolate those programs from your account or files.
56
+
57
+ `agent connect --connection` (or a connection option such as `--name`) requests
58
+ an agent connection. Approval is review-only today: it creates no connection,
59
+ code or token. The CLI's issuer contract is exercised against a test double;
60
+ [real issuer evidence is still needed](../../docs/agent-identity/issuer-contract.md#evidence-still-needed-from-the-real-issuer).
61
+
62
+ For a saved connection, `--agent-connection <slot>` or
63
+ `LIGHTDASH_AGENT_CONNECTION` selects its credential. Selected requests do not
64
+ fall back to the personal API key if the connection is missing or invalid.
65
+ `agent status --name <slot>` reports that connection;
66
+ [CLI revocation and recovery](../../docs/agent-identity/revocation.md#cli-revocation-and-recovery)
67
+ use `agent revoke --name <slot>` and its `--human` option.
68
+
69
+ When a connection is selected, the CLI removes exactly one variable from a
70
+ program's environment: `LIGHTDASH_API_KEY`. It keeps the rest, including
71
+ `LIGHTDASH_PROXY_AUTHORIZATION`, and passes the selected slot as
72
+ `LIGHTDASH_AGENT_CONNECTION`. Command-specific environment overrides still
73
+ apply. The CLI does not put the connection's saved access or refresh token into
74
+ that environment. It does not remove credentials already present under other
75
+ variable names or clear the parent CLI's environment.
76
+
77
+ The CLI config is `~/.config/lightdash/config.yaml`; saved connections are in
78
+ `~/.config/lightdash/agent-connections.yaml`. Both are readable YAML text,
79
+ including the saved personal API key and connection tokens. On POSIX systems,
80
+ the CLI uses owner-only permissions: directories `0700`, files `0600`.
81
+ A program running as your computer user can open them. On Windows, access
82
+ depends on the operating system's ACLs; the CLI skips POSIX permission changes.
83
+
46
84
  ## Project validation
47
85
 
48
86
  `lightdash validate` checks existing project content against locally compiled
@@ -211,7 +249,10 @@ default project and a preview are available.
211
249
  LIGHTDASH_PROJECT=<target-project-uuid> lightdash deploy --non-interactive
212
250
  ```
213
251
 
214
- 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.
252
+ 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
+
254
+ For a selected connection, see [Scoped CLI credentials](#scoped-cli-credentials)
255
+ for credential selection and local program access.
215
256
 
216
257
  ### Example Automation Scripts
217
258
 
@@ -377,3 +418,5 @@ project names in ordinary listings retain the server's characters, including
377
418
  control characters.
378
419
 
379
420
  The CLI has no general screen that rewrites its output.
421
+
422
+ For local program and file access, see [Scoped CLI credentials](#scoped-cli-credentials).