Skip to content

feat: warn and suggest install for opt-in launch commands#2656

Merged
harshitha-cstk merged 1 commit into
enh/dx-9742-demote-launch-pluginfrom
fix/add-warning-for-launch
Jul 24, 2026
Merged

feat: warn and suggest install for opt-in launch commands#2656
harshitha-cstk merged 1 commit into
enh/dx-9742-demote-launch-pluginfrom
fix/add-warning-for-launch

Conversation

@harshitha-cstk

Copy link
Copy Markdown
Contributor

What

Adds an init hook that intercepts commands belonging to demoted (now opt-in) plugins when the plugin isn't installed. For launch:*, instead of the generic "command not found", it prints:

Warning: "launch" is now an opt-in plugin and is not installed, so "launch:*" commands are unavailable.

Install it to enable these commands:
  csdx plugins:install @contentstack/cli-launch

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

  • New src/hooks/init/opt-in-plugin-guide.ts — runs on init (before command resolution), so it pre-empts @oclif/plugin-not-found cleanly. command_not_found hooks run concurrently and can't reliably suppress one another, so init is the correct interception point.
  • Driven by a DEMOTED_PLUGINS map (launch@contentstack/cli-launch) for easy extension.
  • No-op when the plugin is installed (launch runs normally); genuinely unknown commands still fall through to plugin-not-found's "did you mean?".
  • Registered under oclif.hooks.init in package.json.

Verification

node bin/dev.js launch / launch:<cmd> → prints the warning + install hint, exits 127. tsc --noEmit clean. Control command (foobar) unchanged.

Related: DX-9742 (demotion), DX-9748 (migration notes).

🤖 Generated with Claude Code

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>
@harshitha-cstk
harshitha-cstk requested a review from a team as a code owner July 24, 2026 05:41
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 1 37 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 37
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@harshitha-cstk
harshitha-cstk merged commit e86f92b into enh/dx-9742-demote-launch-plugin Jul 24, 2026
8 checks passed
@harshitha-cstk
harshitha-cstk deleted the fix/add-warning-for-launch branch July 24, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants