orchestra-cli 0.3.0__tar.gz → 0.3.1__tar.gz

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 (63) hide show
  1. orchestra_cli-0.3.1/PKG-INFO +467 -0
  2. orchestra_cli-0.3.1/README.md +455 -0
  3. orchestra_cli-0.3.1/orchestra_cli/src/build_pipeline.py +254 -0
  4. orchestra_cli-0.3.1/orchestra_cli/src/cli.py +43 -0
  5. orchestra_cli-0.3.1/orchestra_cli/src/create_pipeline.py +65 -0
  6. orchestra_cli-0.3.1/orchestra_cli/src/delete_pipeline.py +49 -0
  7. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/src/fetch_pipelines.py +13 -16
  8. orchestra_cli-0.3.1/orchestra_cli/src/get_pipeline.py +130 -0
  9. orchestra_cli-0.3.1/orchestra_cli/src/import_pipeline.py +124 -0
  10. orchestra_cli-0.3.1/orchestra_cli/src/migrate_pipeline.py +452 -0
  11. orchestra_cli-0.3.1/orchestra_cli/src/pipeline_upsert.py +77 -0
  12. orchestra_cli-0.3.1/orchestra_cli/src/run_pipeline.py +196 -0
  13. orchestra_cli-0.3.1/orchestra_cli/src/task_logs.py +309 -0
  14. orchestra_cli-0.3.1/orchestra_cli/src/update_pipeline.py +109 -0
  15. orchestra_cli-0.3.1/orchestra_cli/src/validate_pipeline.py +82 -0
  16. orchestra_cli-0.3.1/orchestra_cli/tests/test_build_pipeline.py +900 -0
  17. orchestra_cli-0.3.1/orchestra_cli/tests/test_cli.py +66 -0
  18. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/tests/test_create_pipeline.py +81 -7
  19. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/tests/test_delete_pipeline.py +52 -9
  20. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/tests/test_fetch_pipelines.py +14 -31
  21. orchestra_cli-0.3.1/orchestra_cli/tests/test_get_pipeline.py +179 -0
  22. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/tests/test_import_pipeline.py +163 -17
  23. orchestra_cli-0.3.1/orchestra_cli/tests/test_migrate_pipeline.py +584 -0
  24. orchestra_cli-0.3.1/orchestra_cli/tests/test_pipeline_selector.py +134 -0
  25. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/tests/test_run_pipeline.py +157 -7
  26. orchestra_cli-0.3.1/orchestra_cli/tests/test_task_logs.py +396 -0
  27. orchestra_cli-0.3.1/orchestra_cli/tests/test_update_pipeline.py +645 -0
  28. orchestra_cli-0.3.1/orchestra_cli/tests/test_validate_pipeline.py +91 -0
  29. orchestra_cli-0.3.1/orchestra_cli/tests/utils/__init__.py +1 -0
  30. orchestra_cli-0.3.1/orchestra_cli/tests/utils/test_git.py +116 -0
  31. orchestra_cli-0.3.1/orchestra_cli/utils/api.py +65 -0
  32. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/utils/constants.py +9 -9
  33. orchestra_cli-0.3.1/orchestra_cli/utils/git.py +474 -0
  34. orchestra_cli-0.3.1/orchestra_cli/utils/pipeline_selector.py +129 -0
  35. orchestra_cli-0.3.1/orchestra_cli/utils/pipeline_update.py +27 -0
  36. orchestra_cli-0.3.1/orchestra_cli/utils/yaml_loader.py +124 -0
  37. orchestra_cli-0.3.1/orchestra_cli.egg-info/PKG-INFO +467 -0
  38. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli.egg-info/SOURCES.txt +16 -1
  39. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli.egg-info/requires.txt +1 -0
  40. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/pyproject.toml +7 -2
  41. orchestra_cli-0.3.0/PKG-INFO +0 -299
  42. orchestra_cli-0.3.0/README.md +0 -288
  43. orchestra_cli-0.3.0/orchestra_cli/src/cli.py +0 -20
  44. orchestra_cli-0.3.0/orchestra_cli/src/create_pipeline.py +0 -65
  45. orchestra_cli-0.3.0/orchestra_cli/src/delete_pipeline.py +0 -39
  46. orchestra_cli-0.3.0/orchestra_cli/src/import_pipeline.py +0 -223
  47. orchestra_cli-0.3.0/orchestra_cli/src/pipeline_upsert.py +0 -74
  48. orchestra_cli-0.3.0/orchestra_cli/src/run_pipeline.py +0 -186
  49. orchestra_cli-0.3.0/orchestra_cli/src/update_pipeline.py +0 -65
  50. orchestra_cli-0.3.0/orchestra_cli/src/validate_pipeline.py +0 -70
  51. orchestra_cli-0.3.0/orchestra_cli/tests/test_cli.py +0 -16
  52. orchestra_cli-0.3.0/orchestra_cli/tests/test_update_pipeline.py +0 -176
  53. orchestra_cli-0.3.0/orchestra_cli/tests/test_validate_pipeline.py +0 -11
  54. orchestra_cli-0.3.0/orchestra_cli/utils/git.py +0 -50
  55. orchestra_cli-0.3.0/orchestra_cli.egg-info/PKG-INFO +0 -299
  56. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/src/__init__.py +0 -0
  57. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/tests/__init__.py +0 -0
  58. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/tests/conftest.py +0 -0
  59. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli/utils/styling.py +0 -0
  60. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli.egg-info/dependency_links.txt +0 -0
  61. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli.egg-info/entry_points.txt +0 -0
  62. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/orchestra_cli.egg-info/top_level.txt +0 -0
  63. {orchestra_cli-0.3.0 → orchestra_cli-0.3.1}/setup.cfg +0 -0
@@ -0,0 +1,467 @@
1
+ Metadata-Version: 2.4
2
+ Name: orchestra-cli
3
+ Version: 0.3.1
4
+ Summary: Orchestra CLI. Perform operations with Orchestra locally.
5
+ Author-email: Orchestra Technologies <support@getorchestra.io>
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: httpx>=0.28.1
9
+ Requires-Dist: pydantic>=2.13.4
10
+ Requires-Dist: pyyaml>=6.0.2
11
+ Requires-Dist: typer>=0.16.0
12
+
13
+ # orchestra-cli
14
+
15
+ Orchestra CLI for working with Orchestra pipelines from your terminal.
16
+
17
+ Two entrypoints are available: `orchestra` and `orchestra-cli` (they are equivalent).
18
+
19
+ See [`AGENTS.md`](AGENTS.md) for contributor and AI agent guidance (environment setup, code conventions, testing).
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ pip install orchestra-cli
25
+ ```
26
+
27
+ Or with pipx:
28
+
29
+ ```bash
30
+ pipx install orchestra-cli
31
+ ```
32
+
33
+ ## Environment variables
34
+
35
+ - `ORCHESTRA_API_KEY`: Required for actions that call the API (`pipeline import`, `pipeline new`, `pipeline update`, `pipeline migrate`, `pipeline get`, `pipeline list`, `pipeline delete`, `pipeline run`, `pipeline build`).
36
+ - `BASE_URL`: Optional. Override the default Orchestra host (`https://app.getorchestra.io`) for non‑production/testing.
37
+
38
+ ## Command structure
39
+
40
+ Commands follow a `noun verb` shape. The current nouns are `pipeline` and `task`:
41
+
42
+ | Command | Description |
43
+ | ------------------------------------ | ------------------------------------------------------------------------------------------- |
44
+ | `orchestra pipeline validate <file>` | Validate a pipeline YAML locally against the Orchestra API schema. |
45
+ | `orchestra pipeline import` | Register a pipeline YAML (from a git repo) with Orchestra under an alias. |
46
+ | `orchestra pipeline get` | Fetch one pipeline by path, alias, or pipeline ID. |
47
+ | `orchestra pipeline list` | Fetch the pipelines visible to the current API key as JSON. |
48
+ | `orchestra pipeline new` | Create an Orchestra-backed pipeline from a local YAML file. |
49
+ | `orchestra pipeline update` | Update an existing Orchestra-backed pipeline from a local YAML file. |
50
+ | `orchestra pipeline migrate` | Migrate an Orchestra-backed pipeline to git-backed storage. |
51
+ | `orchestra pipeline delete` | Delete an existing pipeline by alias. |
52
+ | `orchestra pipeline run` | Start a pipeline run by alias, optionally pinning branch/commit and waiting for completion. |
53
+ | `orchestra pipeline build` | Validate local YAML, create or update a draft pipeline, and start that draft version. |
54
+ | `orchestra task logs` | Fetch or follow logs for a single task run. |
55
+
56
+ Use `orchestra --help`, `orchestra <noun> --help`, or `orchestra <noun> <verb> --help` for built-in help.
57
+
58
+ ### Legacy command names
59
+
60
+ The previous flat command names continue to work as hidden top-level aliases so existing scripts keep running:
61
+
62
+ | Legacy alias | New canonical form |
63
+ | --------------------------- | ----------------------------- |
64
+ | `orchestra validate` | `orchestra pipeline validate` |
65
+ | `orchestra import` | `orchestra pipeline import` |
66
+ | `orchestra fetch-pipelines` | `orchestra pipeline list` |
67
+ | `orchestra create-pipeline` | `orchestra pipeline new` |
68
+ | `orchestra update-pipeline` | `orchestra pipeline update` |
69
+ | `orchestra delete-pipeline` | `orchestra pipeline delete` |
70
+ | `orchestra run` | `orchestra pipeline run` |
71
+
72
+ New code and documentation should prefer the noun/verb form.
73
+
74
+ ---
75
+
76
+ ## pipeline validate
77
+
78
+ Validate a YAML file against the Orchestra API schema.
79
+
80
+ ```bash
81
+ orchestra pipeline validate path/to/pipeline.yaml
82
+ # or
83
+ orchestra-cli pipeline validate path/to/pipeline.yaml
84
+ ```
85
+
86
+ Options
87
+
88
+ - `file` (positional): Path to the YAML file to validate.
89
+
90
+ Behavior
91
+
92
+ - Prints a success message on valid input.
93
+ - On validation errors, prints the failing location(s), readable messages, and a YAML snippet when possible.
94
+ - Exit codes: `0` on success, `1` on invalid file/validation failure/HTTP error.
95
+
96
+ Example output (failure)
97
+
98
+ ```text
99
+ ❌ Validation failed with status 422
100
+ Error at: pipeline.tasks[0].type
101
+ Invalid task type "foo"
102
+
103
+ YAML snippet:
104
+ pipeline:
105
+ tasks:
106
+ - type: foo
107
+ ```
108
+
109
+ ---
110
+
111
+ ## pipeline import
112
+
113
+ Create (import) a pipeline in Orchestra by referencing a YAML file inside a git repository. The command infers your repository host/provider, default branch, and YAML path relative to the repo root.
114
+
115
+ ```bash
116
+ export ORCHESTRA_API_KEY=... # required
117
+
118
+ orchestra pipeline import \
119
+ --alias my-pipeline \
120
+ --path ./pipelines/pipeline.yaml \
121
+ --working-branch my-feature-branch # optional; defaults to current local branch
122
+ # or
123
+ orchestra-cli pipeline import -a my-pipeline -p ./pipelines/pipeline.yaml
124
+ ```
125
+
126
+ Options
127
+
128
+ - `-a, --alias` (required): The alias you want to register the pipeline under.
129
+ - `-p, --path` (required): Path to the YAML file. Must be inside a git repository.
130
+ - `-w, --working-branch` (optional): Branch to associate as the working branch for this pipeline import. If omitted, the current local git branch is used.
131
+
132
+ Notes
133
+
134
+ - The YAML is validated with the API before import; failures are printed clearly.
135
+ - Git details are detected automatically:
136
+ - Supported providers: GitHub, GitLab, Azure DevOps.
137
+ - The default branch is detected from `origin`.
138
+ - The working branch defaults to your current local branch when not specified.
139
+ - The YAML path is computed relative to the repository root.
140
+ - On success, the command prints the created pipeline ID (or a success message).
141
+ - Exit codes: `0` on success, `1` on failure.
142
+
143
+ Common errors
144
+
145
+ - Missing `ORCHESTRA_API_KEY`.
146
+ - Not running inside a git repository, or no `origin` remote configured.
147
+ - Could not detect storage provider or default branch.
148
+
149
+ ---
150
+
151
+ ## pipeline new
152
+
153
+ Create an Orchestra-backed pipeline directly from a local YAML file.
154
+
155
+ ```bash
156
+ export ORCHESTRA_API_KEY=...
157
+
158
+ orchestra pipeline new \
159
+ --alias my-pipeline \
160
+ --path ./pipelines/pipeline.yaml \
161
+ --publish # optional, defaults to --no-publish
162
+ ```
163
+
164
+ Options
165
+
166
+ - `-a, --alias` (required): Pipeline alias.
167
+ - `-p, --path` (required): Path to pipeline YAML file.
168
+ - `--publish/--no-publish` (optional, default `--no-publish`): Whether the pipeline is published.
169
+
170
+ Behavior
171
+
172
+ - Validates YAML against the Orchestra schema endpoint before creating.
173
+ - Sends pipeline data to `POST /pipelines` with `storage_provider=ORCHESTRA`.
174
+ - On success, prints the pipeline edit URL (`/pipelines/{pipeline_id}/edit`) when an ID is returned.
175
+ - Exit codes: `0` on success, `1` on failure.
176
+
177
+ ---
178
+
179
+ ## pipeline get
180
+
181
+ Fetch one pipeline using the shared pipeline selector flags.
182
+
183
+ ```bash
184
+ export ORCHESTRA_API_KEY=...
185
+
186
+ orchestra pipeline get --alias my-pipeline
187
+ orchestra pipeline get --pipeline-id f374e795-50aa-4aeb-9936-d68d2b90475c
188
+ orchestra pipeline get --path ./pipelines/pipeline.yaml
189
+ ```
190
+
191
+ Options
192
+
193
+ - `-a, --alias` (optional): Pipeline alias.
194
+ - `-i, --pipeline-id` (optional): Pipeline ID.
195
+ - `-p, --path` (optional): Path to pipeline YAML file. Inside a git repository, this resolves to `repository` and `yaml_path`; outside a git repository, the CLI prompts to use a generated alias.
196
+
197
+ Behavior
198
+
199
+ - Resolves the selector using the shared rules: alias first, then pipeline ID, then path.
200
+ - Sends `GET /api/engine/public/pipeline` with the resolved selector.
201
+ - Prints the returned pipeline metadata in a labeled, human-readable format.
202
+ - Exit codes: `0` on success, `1` on failure.
203
+
204
+ ---
205
+
206
+ ## pipeline list
207
+
208
+ Fetch the pipelines available to the current Orchestra API key.
209
+
210
+ ```bash
211
+ export ORCHESTRA_API_KEY=...
212
+
213
+ orchestra pipeline list
214
+ ```
215
+
216
+ Behavior
217
+
218
+ - Sends `GET /api/engine/public/pipelines`. Responses always include each pipeline's latest run metadata.
219
+ - Prints the response payload as pretty JSON for scripting and inspection.
220
+ - Exit codes: `0` on success, `1` on failure.
221
+
222
+ ---
223
+
224
+ ## pipeline update
225
+
226
+ Update an existing pipeline from a local YAML file.
227
+
228
+ ```bash
229
+ export ORCHESTRA_API_KEY=...
230
+
231
+ orchestra pipeline update \
232
+ --alias my-pipeline \
233
+ --path ./pipelines/pipeline.yaml \
234
+ --no-publish # default
235
+ ```
236
+
237
+ Options
238
+
239
+ - `-a, --alias` (optional): Pipeline alias.
240
+ - `-i, --pipeline-id` (optional): Pipeline ID.
241
+ - `-p, --path` (required): Path to pipeline YAML file.
242
+ - `--publish/--no-publish` (optional, default `--no-publish`): Whether the pipeline is published.
243
+ - `--force/--no-force` (optional, default `--no-force`): Skip interactive confirmation prompts when the CLI generates aliases or performs git-backed commit/branch fallback actions.
244
+
245
+ Behavior
246
+
247
+ - Validates YAML against the Orchestra schema endpoint before updating.
248
+ - Resolves the pipeline selector with shared rules (alias, then pipeline ID, then `repository + yaml_path` from `--path` inside git).
249
+ - Fetches pipeline metadata from `GET /pipeline` before mutating.
250
+ - If the pipeline is Orchestra-backed, updates it through `PUT /pipelines` using `alias` or `pipeline_id`.
251
+ - If the pipeline is git-backed, applies the same commit/push protection flow as `pipeline build`, then reports the branch + commit used.
252
+ - For Orchestra-backed success, prints the pipeline edit URL (`/pipelines/{pipeline_id}/edit`) when an ID is returned.
253
+ - Exit codes: `0` on success, `1` on failure.
254
+
255
+ ---
256
+
257
+ ## pipeline migrate
258
+
259
+ Migrate an existing Orchestra-backed pipeline to git-backed storage.
260
+
261
+ ```bash
262
+ export ORCHESTRA_API_KEY=...
263
+
264
+ orchestra pipeline migrate \
265
+ --alias my-pipeline \
266
+ --path ./pipelines/pipeline.yaml
267
+ ```
268
+
269
+ Options
270
+
271
+ - `-p, --path` (required): Target YAML path inside your git repository.
272
+ - `-a, --alias` (optional): Pipeline alias selector.
273
+ - `-i, --pipeline-id` (optional): Pipeline ID selector.
274
+ - `--default-branch` (optional): Defaults to your git remote default branch.
275
+ - `--working-branch` (optional): Defaults to your current git branch (unless it matches default branch).
276
+
277
+ Behavior
278
+
279
+ - Requires a git repository and a resolvable `origin` remote.
280
+ - Fetches the selected pipeline, verifies it is Orchestra-backed, then downloads pipeline YAML from Orchestra.
281
+ - If published and latest versions differ, prompts which version to migrate.
282
+ - If a local file already exists at `--path` and differs, prompts to overwrite, keep local, or choose a new path.
283
+ - Commits and pushes the selected YAML path before calling `PATCH /pipelines/storage-settings`.
284
+ - If push is blocked by branch protection, suggests a new migration branch and offers to retry there.
285
+ - Prints a compare/PR link when migration is pushed to a non-default branch.
286
+
287
+ ---
288
+
289
+ ## pipeline delete
290
+
291
+ Delete a pipeline by alias.
292
+
293
+ ```bash
294
+ export ORCHESTRA_API_KEY=...
295
+
296
+ orchestra pipeline delete --alias my-pipeline
297
+ ```
298
+
299
+ Options
300
+
301
+ - `-a, --alias` (required): Pipeline alias to delete.
302
+
303
+ Behavior
304
+
305
+ - Sends `DELETE /pipelines/{alias}` with API key authentication.
306
+ - Deletes the pipeline resolved by alias within the authenticated account.
307
+ - On success, exits with code `0` after printing a confirmation message.
308
+ - Exit codes: `0` on success, `1` on failure.
309
+
310
+ ---
311
+
312
+ ## pipeline run
313
+
314
+ Start a pipeline run by alias. Optionally specify a branch and/or commit. By default, the command waits and polls the run status until completion.
315
+
316
+ ```bash
317
+ export ORCHESTRA_API_KEY=...
318
+
319
+ # Start and wait for completion
320
+ orchestra pipeline run --alias my-pipeline
321
+
322
+ # Start without waiting (prints run id and exits)
323
+ orchestra pipeline run -a my-pipeline --no-wait
324
+
325
+ # Start for a specific branch/commit
326
+ orchestra pipeline run -a my-pipeline -b feature/my-change -c 0123abc
327
+ ```
328
+
329
+ Options
330
+
331
+ - `-a, --alias` (required): Pipeline alias to run.
332
+ - `-b, --branch` (optional): Git branch name to associate with this run.
333
+ - `-c, --commit` (optional): Commit SHA to associate with this run.
334
+ - `--wait/--no-wait` (default: `--wait`): Poll until the run ends.
335
+ - `--force/--no-force` (default: `--no-force`): Skip confirmation if local git warnings are detected.
336
+
337
+ Behavior
338
+
339
+ - Prints the run ID when known and a link to the run lineage page.
340
+ - When waiting, polls status every ~5s until a terminal state:
341
+ - `SUCCEEDED` (exit `0`), `WARNING` (exit `0`), `SKIPPED` (exit `0`)
342
+ - `FAILED` or `CANCELLED` (exit `1`)
343
+ - When not waiting, exits after start and prints the run ID.
344
+
345
+ Non-interactive usage
346
+
347
+ - If your repo has warnings (e.g., uncommitted changes), the CLI prompts for confirmation unless `--force` is provided. For CI or scripts, pass `--force` or ensure a clean repo.
348
+
349
+ ---
350
+
351
+ ## pipeline build
352
+
353
+ Validate a local pipeline YAML, create or update its draft pipeline definition, then start that draft version. This is intended for quick local iteration without publishing a pipeline first.
354
+
355
+ ```bash
356
+ export ORCHESTRA_API_KEY=...
357
+
358
+ # Build from a local YAML file and wait for completion.
359
+ # Alias is optional; if omitted, the CLI resolves the pipeline from the shared selector rules
360
+ # and generates an alias from --path when it needs to create a new draft.
361
+ orchestra pipeline build --path ./pipelines/pipeline.yaml
362
+
363
+ # Build a specific existing pipeline by alias or pipeline ID
364
+ orchestra pipeline build --path ./pipelines/pipeline.yaml --alias my-pipeline
365
+ orchestra pipeline build --path ./pipelines/pipeline.yaml --pipeline-id f374e795-50aa-4aeb-9936-d68d2b90475c
366
+
367
+ # Run against a specific branch/commit override
368
+ orchestra pipeline build -p ./pipelines/pipeline.yaml -a my-pipeline -b feature/my-change -c 0123abc
369
+ ```
370
+
371
+ Options
372
+
373
+ - `-p, --path` (required): Path to pipeline YAML file.
374
+ - `-a, --alias` (optional): Pipeline alias. You can omit this flag entirely and still build from `--path` alone—the CLI resolves the target using the shared selector rules and only prompts for or generates an alias when it must create a new draft pipeline.
375
+ - `-i, --pipeline-id` (optional): Pipeline ID.
376
+ - `-b, --branch` (optional): Git branch name to associate with the draft run.
377
+ - `-c, --commit` (optional): Commit SHA to associate with the draft run.
378
+ - `--wait/--no-wait` (default: `--wait`): Poll until the run ends.
379
+ - `--force/--no-force` (default: `--no-force`): Skip confirmation if local git warnings are detected.
380
+
381
+ Behavior
382
+
383
+ - Validates the local YAML with the schema endpoint before any pipeline mutation.
384
+ - Treats `--alias` as optional and resolves the target pipeline using the shared selector rules: alias first, then pipeline ID, then path.
385
+ - When only `--path` is provided inside a git repository, the CLI looks up the existing pipeline using `repository` + `yaml_path`.
386
+ - When the pipeline does not exist, the CLI creates a draft Orchestra-backed pipeline from the local YAML, generating an alias from `--path` via the shared selector helper when needed.
387
+ - When the pipeline exists and is Orchestra-backed, the CLI updates that draft and starts the returned `versionNumber`, preserving the same wait, polling, and branch/commit override behavior as `pipeline run`.
388
+ - Existing git-backed pipelines reuse the same commit + branch-protection logic as `pipeline update`, then run using the resolved branch/commit target.
389
+ - Exit codes follow `pipeline run`: success terminal states return `0`; failed or cancelled runs return `1`.
390
+
391
+ ---
392
+
393
+ ## task logs
394
+
395
+ Fetch or follow logs for a single task run.
396
+
397
+ ```bash
398
+ export ORCHESTRA_API_KEY=...
399
+
400
+ # Select a log file interactively, then follow it
401
+ orchestra task logs --task-run-id 3d68b5dc-54eb-43db-8294-4734d032ff92
402
+
403
+ # Follow a specific log file
404
+ orchestra task logs -tr 3d68b5dc-54eb-43db-8294-4734d032ff92 -f main.log
405
+
406
+ # Print the current contents once without waiting for new lines
407
+ orchestra task logs -tr 3d68b5dc-54eb-43db-8294-4734d032ff92 -f main.log --no-watch
408
+ ```
409
+
410
+ Options
411
+
412
+ - `-tr, --task-run-id` (required): Task run ID to fetch logs for.
413
+ - `-f, --filename` (optional): Specific log filename to fetch.
414
+ - `--no-watch` (optional): Print the current log content once instead of waiting for new lines.
415
+
416
+ Behavior
417
+
418
+ - Resolves the task run's pipeline run ID automatically.
419
+ - If no filename is provided, lists available log files and prompts for a selection.
420
+ - By default, polls the log download endpoint using byte ranges and prints only new content as it arrives until the file is complete.
421
+ - Press `Ctrl+C` to stop following logs.
422
+
423
+ ---
424
+
425
+ ## Examples
426
+
427
+ ```bash
428
+ # Validate a pipeline file
429
+ orchestra pipeline validate ./examples/etl.yaml
430
+
431
+ # Import a pipeline and capture the created ID
432
+ PIPELINE_ID=$(orchestra pipeline import -a finance-etl -p ./pipelines/etl.yaml)
433
+
434
+ # Start a run and wait for completion
435
+ orchestra pipeline run -a finance-etl
436
+
437
+ # Start a run and exit immediately
438
+ orchestra pipeline run -a finance-etl --no-wait
439
+
440
+ # Build a draft pipeline from local YAML and let the CLI generate an alias if needed
441
+ orchestra pipeline build -p ./pipelines/etl.yaml
442
+
443
+ # Follow task run logs
444
+ orchestra task logs -tr 3d68b5dc-54eb-43db-8294-4734d032ff92 -f main.log
445
+ ```
446
+
447
+ ---
448
+
449
+ ## Development
450
+
451
+ - Make sure [uv](https://github.com/astral-sh/uv) is installed
452
+ - Use `uv pip install -e ".[dev]"` to install the CLI in editable mode for development
453
+ - For local development, run `uv run orchestra` to start the CLI
454
+ - you can use `uv run --env-file .env ...` to run the CLI with env vars
455
+ - For testing, run `uv run pytest`
456
+ - For linting, run `uv run ruff check .`
457
+ - For formatting, run `uv run black --check .`
458
+ - For type checking, run `uv run pyright`
459
+
460
+ ## Building and Releasing
461
+
462
+ - Bump the version in `pyproject.toml` or by running `uv version --bump <major/minor/patch>`
463
+ - Run `uv sync` to install the dependencies
464
+ - Run `uv build` to build the CLI
465
+ - Run `uv publish` to publish the CLI (you will need to pass the `--token` flag)
466
+
467
+ **Note: Failure to bump the version will result in a failed release.**