disable winml run and winml serve CLI commands#388
Merged
Conversation
Hide run/serve from command discovery and reject direct invocations with a clear error message. Modules remain on disk for internal use.
timenick
approved these changes
Apr 24, 2026
xieofxie
reviewed
Apr 24, 2026
| if cmd_name in _DISABLED_COMMANDS: | ||
| ctx.fail( | ||
| f"'winml {cmd_name}' is currently disabled. " | ||
| f"Use 'winml eval' for model evaluation instead." |
Contributor
There was a problem hiding this comment.
the help is not general for any _DISABLED_COMMANDS
xieofxie
reviewed
Apr 24, 2026
| # Commands that are temporarily disabled from the CLI surface. | ||
| # The modules remain on disk so tests and internal imports still work; | ||
| # they simply do not appear in ``winml --help`` or accept user invocations. | ||
| _DISABLED_COMMANDS: frozenset[str] = frozenset({"run", "serve"}) |
Contributor
There was a problem hiding this comment.
should we add an envvar to enable it ?
ssss141414
pushed a commit
that referenced
this pull request
Apr 27, 2026
## Summary - Hide `run` and `serve` from CLI command discovery (`winml --help`) - Reject direct invocations (`winml run ...`, `winml serve ...`) with a clear "disabled" error message - Modules remain on disk — existing tests and internal imports (e.g. `eval` using `serve/`) are unaffected - Re-enabling is a one-line change: remove entries from `_DISABLED_COMMANDS` frozenset 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
runandservefrom CLI command discovery (winml --help)winml run ...,winml serve ...) with a clear "disabled" error messageevalusingserve/) are unaffected_DISABLED_COMMANDSfrozenset🤖 Generated with Claude Code