feat: warn and suggest install for opt-in launch commands#2656
Merged
harshitha-cstk merged 1 commit intoJul 24, 2026
Merged
Conversation
Add an init hook that intercepts commands belonging to demoted (now opt-in) plugins when the plugin is not installed. For launch:* it prints a warning and the install command (csdx plugins:install @contentstack/cli-launch) instead of a generic "command not found", then exits. If the plugin is installed, the hook is a no-op and commands run normally. Driven by a DEMOTED_PLUGINS map for easy extension. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
cs-raj
approved these changes
Jul 24, 2026
harshitha-cstk
merged commit Jul 24, 2026
e86f92b
into
enh/dx-9742-demote-launch-plugin
8 checks passed
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.
What
Adds an
inithook that intercepts commands belonging to demoted (now opt-in) plugins when the plugin isn't installed. Forlaunch:*, instead of the generic "command not found", it prints:Why
After the launch demotion (DX-9742), a bare "command not found" reads like a regression to users for whom
launch:*previously worked out of the box. This gives an actionable hint pointing at the install command, consistent with the README opt-in note and the migration guide (DX-9748).How
src/hooks/init/opt-in-plugin-guide.ts— runs oninit(before command resolution), so it pre-empts@oclif/plugin-not-foundcleanly.command_not_foundhooks run concurrently and can't reliably suppress one another, soinitis the correct interception point.DEMOTED_PLUGINSmap (launch→@contentstack/cli-launch) for easy extension.plugin-not-found's "did you mean?".oclif.hooks.initinpackage.json.Verification
node bin/dev.js launch/launch:<cmd>→ prints the warning + install hint, exits 127.tsc --noEmitclean. Control command (foobar) unchanged.Related: DX-9742 (demotion), DX-9748 (migration notes).
🤖 Generated with Claude Code