Skip to content

Studio CLI: Add support for xdebug beta flag - #2316

Merged
bcotrim merged 5 commits into
dev/studio-cli-i2from
stu-1165-cli-xdebug-support
Jan 8, 2026
Merged

Studio CLI: Add support for xdebug beta flag#2316
bcotrim merged 5 commits into
dev/studio-cli-i2from
stu-1165-cli-xdebug-support

Conversation

@bcotrim

@bcotrim bcotrim commented Dec 24, 2025

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

  • Add studio site set-xdebug <enable> command to enable/disable xdebug for a site
  • Pass xdebug configuration to the Playground CLI when starting sites
  • Respect both the beta feature flag (xdebugSupport) and per-site setting (enableXdebug)
  • Add helper function isXdebugBetaEnabled() to check the beta feature flag

Testing Instructions

  1. Enable the xdebug beta feature in Studio desktop app (Settings > Beta Features > Xdebug Support)
  2. Build the CLI: npm run cli:build
  3. Create or use an existing site: node dist/cli/main.js site create --name test-xdebug --path /tmp/xdebug-test
  4. Enable xdebug for the site: node dist/cli/main.js site set --xdebug true --path /tmp/xdebug-test
  5. Start the site: node dist/cli/main.js site start --path /tmp/xdebug-test
  6. Verify xdebug is enabled by checking the site or PM2 logs for "Enabling Xdebug support" message
  7. Test disabling: node dist/cli/main.js site set --xdebug false --path /tmp/xdebug-test
  8. Restart the site and verify xdebug is no longer enabled

Edge cases to verify:

  • Site starts normally without xdebug when beta flag is off
  • Site starts normally without xdebug when site setting is off (even if beta flag is on)
  • Error message shown when trying to enable xdebug but beta flag is off

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@bcotrim bcotrim self-assigned this Dec 24, 2025
@bcotrim
bcotrim requested review from a team and fredrikekelund December 24, 2025 18:22

@nightnei nightnei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If some site has xdebux already - then everything good
    Screenshot 2025-12-29 at 14 42 10
  2. I tried to disable Xdebug in UI - everything behaves as normal, but it's not actually disabled - in UI, it's still enabled, and it's still indeed enabled. It seems we have regression.
  3. Turning on/off xdebug via cli - doesn't reflect changes in Studio, hovever terminal doesn't print errors.

Maybe it's again solely local issues, however, I removed node_modules and did everything from scratch. @bcotrim, coudl you please double-check these two points?

@bcotrim

bcotrim commented Jan 5, 2026

Copy link
Copy Markdown
Contributor Author
2. I tried to disable Xdebug in UI - everything behaves as normal, but it's not actually disabled - in UI, it's still enabled, and it's still indeed enabled. It seems we have regression.
3. Turning on/off xdebug via cli - doesn't reflect changes in Studio, hovever terminal doesn't print errors.

Thanks for the review and feedback @nightnei
I can also replicate that. There's currently an issue with site settings not updating in the UI STU-1163 that should be fixed in #2313
I believe this issue will be resolved once that PR is merged.

@nightnei

nightnei commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

I believe this issue will be resolved once that PR is merged.

I see 👍 Let's merge that PR and rebase this one, and I will re-test

@bcotrim

bcotrim commented Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

I see 👍 Let's merge that PR and rebase this one, and I will re-test

I updated the branch with the latest changes. Everything works for me now, can you retest please?

@bcotrim
bcotrim requested a review from nightnei January 6, 2026 11:00

@gavande1 gavande1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this, and it works great. XDebug was enabled and disabled as expected. Functionality-wise, it looks good to me. ✅

Image
@bcotrim
bcotrim requested a review from gavande1 January 7, 2026 15:58
@bcotrim

bcotrim commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@nightnei @gavande1 @fredrikekelund after we merged #2355 I updated this PR to merge the studio site set-xdebug command into studio site set
Can I ask for another review, please?

@gavande1 gavande1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and works as expected. LGTM 👍

I had run following command to enable and disable xdebug.

// Enable 
node dist/cli/main.js site set --xdebug --path /tmp/xdebug-test

// Disable
node dist/cli/main.js site set --xdebug=false --path /tmp/xdebug-test
Image

Perhaps, It would be great idea to update test instructions for posterity. cc @bcotrim

@bcotrim

bcotrim commented Jan 8, 2026

Copy link
Copy Markdown
Contributor Author

I tested this and works as expected. LGTM 👍

I had run following command to enable and disable xdebug.

// Enable 
node dist/cli/main.js site set --xdebug --path /tmp/xdebug-test

// Disable
node dist/cli/main.js site set --xdebug=false --path /tmp/xdebug-test
Image

Perhaps, It would be great idea to update test instructions for posterity. cc @bcotrim

Nice catch, thank you! Updated

@fredrikekelund fredrikekelund left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@bcotrim
bcotrim merged commit 9fa854a into dev/studio-cli-i2 Jan 8, 2026
4 of 5 checks passed
@bcotrim
bcotrim deleted the stu-1165-cli-xdebug-support branch January 8, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants