studio icon indicating copy to clipboard operation
studio copied to clipboard

Studio: Delete old proof-of-concept WP-CLI implementation

Open katinthehatsite opened this issue 8 months ago • 2 comments

Related issues

Fixes STU-302

Proposed Changes

This PR removes the old implementation of the WP-CLI execution from the terminal (related PR) in favour of the studio CLI commands available right now.

Testing Instructions

Test Studio CLI to make sure everything works as expected:

I modified a couple of different things so let's test various aspects to make sure everything works as expected.

  • Pull the changes from this branch
  • Run npm install
  • Run npm run cli:build
  • Run node dist/cli/main.js preview list FOLDER where FOLDER is a path to a Studio site with preview sites (example: node dist/cli/main.js preview list --path="/Users/katerynakodonenko/Studio/my-bright-website")
  • Ensure that the command either prints a table containing information about the preview sites or prints No snapshots found

Check opening different terminal apps

  • Pull the changes from this branch
  • Run npm install and npm start
  • Once the app is started, navigate to the Overview tab
  • Click on your preferred terminal app to open your site in that app
  • Confirm that it open the site in a preferred terminal app
  • Try out a couple of different terminal apps
  • Confirm that it works correctly for different terminal apps

Check assistant code block running CLI inline

  • Pull the changes from this branch
  • Run npm install and npm start
  • Once the app is started, navigate to the Assistant tab
  • Ask Assistant for the CLI command for listing plugins on your site
  • Run the command inline
  • Confirm everything works:
Screenshot 2025-05-22 at 1 13 39 PM

TBD

Pre-merge Checklist

  • [ ] Have you checked for TypeScript, React or other console errors?

katinthehatsite avatar May 22 '25 08:05 katinthehatsite

Do you have this erorr on running Terminal or iTerm? I have it even in trunk, hm...

I am not getting it on my end either or trunk on this PR? @sejas did this work for you when you were testing the PR?

@nightnei I am also going to explore this suggestion from Fredrik: https://github.com/Automattic/studio/pull/1426#discussion_r2102405813 Perhaps you could retest once I make that change.

katinthehatsite avatar May 22 '25 18:05 katinthehatsite

@nightnei I only looked briefly, but I am wondering if you have iTerm added in these settings:

Screenshot 2025-05-22 at 8 25 45 PM

katinthehatsite avatar May 22 '25 18:05 katinthehatsite

@katinthehatsite I don't have iTerm/Terminal there, but today I tested it again and I don't know what changed, but I don't see that error anymore:
Screenshot 2025-05-26 at 18 34 09

nightnei avatar May 26 '25 17:05 nightnei