feat: auto-generate deprecation warnings from YAML config#941
Open
chaptersix wants to merge 9 commits into
Open
feat: auto-generate deprecation warnings from YAML config#941chaptersix wants to merge 9 commits into
chaptersix wants to merge 9 commits into
Conversation
Add `deprecated: true` and optional `deprecation-message` fields to command YAML config. When set, the generator auto-prepends a CAUTION box to the command description, removing the need to manually add deprecation warnings.
chaptersix
commented
Apr 9, 2026
fretz12
reviewed
May 21, 2026
|
Nice cleanup! I love how deprecation is defined as a YAML flag now. |
Store deprecation message in command annotations and print it to stderr in PersistentPreRunE, so users see the warning when running deprecated commands without breaking JSON output.
Migrate all remaining commands with manual CAUTION boxes to use the `deprecated: true` YAML field. Auto-append "(Deprecated)" to the summary in code gen so authors don't need to add it manually.
Follow PR template convention: stderr messages are lowercase with no trailing punctuation. CAUTION box in help text retains original casing. Add functional tests for stderr deprecation warnings in both text and JSON output modes.
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.
Related issues
Closes #673
What changed?
Auto-generate deprecation warnings from a
deprecated: trueYAML flag instead of manually writing CAUTION boxes in command descriptions. Deprecation warnings are also printed to stderr at runtime so users see them when invoking deprecated commands, without breaking JSON output.Before
Deprecation required manually adding a CAUTION box to the description and
(Deprecated)to the summary:No runtime warning was shown when invoking the command.
After
Set
deprecated: trueand optionallydeprecation-message. The CAUTION box,(Deprecated)summary suffix, and stderr runtime warning are all auto-generated:Runtime stderr output:
JSON output is not affected (warning goes to stderr only):
Checklist
Stability
-o json/-o jsonl) are treated as breaking changesDesign
Help text (see style guide at the top of
commands.yaml)Behavior
Tests
SharedServerSuite)func TestXxx) where applicableManual tests
Setup
Happy path -- stderr warning on deprecated command
Happy path -- JSON output not polluted
Happy path -- help text shows CAUTION box
Happy path -- custom deprecation message