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