@lightdash/cli 2.194.1 → 2.195.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.
- package/README.md +34 -18
- package/dist/.tsbuildinfo +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -0
- package/dist/config.test.js +32 -0
- package/dist/handlers/renameHandler.d.ts.map +1 -1
- package/dist/handlers/renameHandler.js +6 -5
- package/dist/handlers/renameHandler.test.js +41 -0
- package/dist/handlers/selectProject.d.ts +10 -3
- package/dist/handlers/selectProject.d.ts.map +1 -1
- package/dist/handlers/selectProject.js +35 -10
- package/dist/handlers/selectProject.test.js +89 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -136,28 +136,43 @@ The `--non-interactive` flag is designed for environments where interactive prom
|
|
|
136
136
|
|
|
137
137
|
### Global Options
|
|
138
138
|
|
|
139
|
-
| Flag
|
|
140
|
-
|
|
139
|
+
| Flag | Description |
|
|
140
|
+
| ------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
141
141
|
| `--non-interactive` | Disable all interactive prompts. Commands auto-select defaults where possible. Designed for CI/CD and agentic coding tools. |
|
|
142
142
|
|
|
143
143
|
### Command-Specific Options
|
|
144
144
|
|
|
145
|
-
| Command
|
|
146
|
-
|
|
147
|
-
| `login`
|
|
148
|
-
| `login`
|
|
149
|
-
| `login`
|
|
150
|
-
| `deploy`
|
|
151
|
-
| `generate` | `-y, --assume-yes` | Answer yes to prompts
|
|
152
|
-
| `dbt run`
|
|
153
|
-
| `rename`
|
|
145
|
+
| Command | Flag | Description |
|
|
146
|
+
| ---------- | ------------------ | -------------------------------------------------------- |
|
|
147
|
+
| `login` | `--token <token>` | Authenticate with personal access token (bypasses OAuth) |
|
|
148
|
+
| `login` | `--email <email>` | Login with email and password |
|
|
149
|
+
| `login` | `--project <uuid>` | Select a specific project by UUID after login |
|
|
150
|
+
| `deploy` | `-y, --assume-yes` | Answer yes to all confirmation prompts |
|
|
151
|
+
| `generate` | `-y, --assume-yes` | Answer yes to prompts |
|
|
152
|
+
| `dbt run` | `-y, --assume-yes` | Answer yes to prompts |
|
|
153
|
+
| `rename` | `-y, --assume-yes` | Answer yes to prompts |
|
|
154
154
|
|
|
155
155
|
### Environment Variables
|
|
156
156
|
|
|
157
|
-
| Variable
|
|
158
|
-
|
|
159
|
-
| `CI=true`
|
|
160
|
-
| `LIGHTDASH_API_KEY` | API token for authentication (can be used instead of `--token`)
|
|
157
|
+
| Variable | Description |
|
|
158
|
+
| ------------------- | ------------------------------------------------------------------------------------------------ |
|
|
159
|
+
| `CI=true` | Equivalent to `--non-interactive` |
|
|
160
|
+
| `LIGHTDASH_API_KEY` | API token for authentication (can be used instead of `--token`) |
|
|
161
|
+
| `LIGHTDASH_PROJECT` | Target project UUID; overrides the saved default and active preview unless `--project` is passed |
|
|
162
|
+
|
|
163
|
+
For project selection in commands such as `deploy`, `download`, and `upload`,
|
|
164
|
+
`--project` takes precedence over `LIGHTDASH_PROJECT`. Either override bypasses
|
|
165
|
+
active-preview selection in both interactive and non-interactive runs, without
|
|
166
|
+
clearing the saved preview. When `LIGHTDASH_PROJECT` overrides an active preview
|
|
167
|
+
the CLI warns which preview it ignored, so a variable left in a shell profile or
|
|
168
|
+
`.env` does not silently redirect commands you meant to run against the preview.
|
|
169
|
+
If neither override is set (or `LIGHTDASH_PROJECT` is empty), an active preview
|
|
170
|
+
remains the default in non-interactive runs; interactive runs prompt when both a
|
|
171
|
+
default project and a preview are available.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
LIGHTDASH_PROJECT=<target-project-uuid> lightdash deploy --non-interactive
|
|
175
|
+
```
|
|
161
176
|
|
|
162
177
|
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.
|
|
163
178
|
|
|
@@ -203,6 +218,7 @@ lightdash deploy \
|
|
|
203
218
|
### Behavior in Non-Interactive Mode
|
|
204
219
|
|
|
205
220
|
When `--non-interactive` is set (or `CI=true`):
|
|
221
|
+
|
|
206
222
|
- **Project selection**: Automatically selects the first available project
|
|
207
223
|
- **Confirmation prompts**: Fail with descriptive error unless `--assume-yes` is provided
|
|
208
224
|
- **OAuth login**: Not available - use `--token` or `--email` with `LIGHTDASH_CLI_PASSWORD` env var instead
|
|
@@ -253,7 +269,7 @@ rm /tmp/lightdash_pass.txt
|
|
|
253
269
|
|
|
254
270
|
The CLI supports these environment variables for authentication:
|
|
255
271
|
|
|
256
|
-
| Variable
|
|
257
|
-
|
|
258
|
-
| `LIGHTDASH_CLI_EMAIL`
|
|
272
|
+
| Variable | Description |
|
|
273
|
+
| ------------------------ | ---------------------------------------------- |
|
|
274
|
+
| `LIGHTDASH_CLI_EMAIL` | Email for login (alternative to `--email`) |
|
|
259
275
|
| `LIGHTDASH_CLI_PASSWORD` | Password for email login (used with `--email`) |
|