Open
Conversation
Contributor
|
✅ No broken links found! |
Contributor
Documentation Link Check Results✅ Absolute links check passed |
Click 8.1 exits with 0 and Click 8.2+ exits with 2 when a group is invoked without a subcommand. CI installs 8.1.8 due to integration dependency constraints, so accept both exit codes.
Contributor
|
|
…y-cli # Conflicts: # src/zenml/cli/pipeline.py
|
Alex Strick van Linschoten seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the ZenML CLI more reliable for automation, coding agents, and CI jobs while preserving the existing human-friendly table UX.
It improves machine-readable output, makes prompt-heavy flows safer in non-interactive environments, and adds dry-run previews for a focused set of mutating commands.
What changed
Machine-friendly CLI behavior
ZENML_CLI_MACHINE_MODEis_machine_mode()helper--outputdefault to JSON in machine modeStructured output for single-item commands
Migrates the remaining Rich-only
describecommands so they can produce structured output:zenml artifact version describezenml authorized-device describezenml service-account describezenml service-account api-key describezenml code-repository describeThese commands still preserve the existing key/value table presentation for normal table output.
Hardening prompt-heavy CLI flows
Wires machine-mode behavior through remaining prompt-heavy paths, including:
Dry-run previews for mutating commands
Adds
--dry-runsupport for:zenml stack registerzenml stack updatezenml stack deletezenml pipeline runzenml secret createzenml secret updateDry-run behavior validates inputs and returns a structured preview without performing the mutation.
A few intentional safety details:
stack delete --dry-runskips destructive confirmation prompts because no side effects occurpipeline run --dry-runvalidates import/config/preparation and intentionally skips stack activation, snapshot creation, and submissionTests and docs
--columnsfilteringZENML_CLI_MACHINE_MODEin the environment variable docsWhy
ZenML already had a strong centralized output pipeline, but there were still a few places where the CLI was human-first in ways that make automation unreliable:
Verification
Ran:
bash scripts/format.sh --no-yamlfix ...uv run mypy src/zenml/cli/utils.py src/zenml/cli/secret.py src/zenml/cli/pipeline.py src/zenml/cli/stack.pybash scripts/docstring.sh "src/zenml/cli/utils.py src/zenml/cli/secret.py src/zenml/cli/pipeline.py src/zenml/cli/stack.py"uv run pytest tests/integration/functional/cli/test_utils.py tests/integration/functional/cli/test_secret.py tests/integration/functional/cli/test_stack.py tests/integration/functional/cli/test_pipeline.pyResult:
96 passedNotes for reviewers