Skip to content

Conversation

sejas
Copy link
Member

@sejas sejas commented Sep 12, 2025

Related issues

Proposed Changes

  • Add Auth commands:
    • studio auth login
    • studio auth logout
    • studio auth status
  • Currently it receives and saves the token through Studio App. I'm thinking to receive the token in the terminal.

Testing Instructions

  • Run npm run cli:build

  • Run ENABLE_CLI_V2=true node dist/cli/main.js auth login

  • Click on approve in your browser

  • Observe you are logged in

  • Run ENABLE_CLI_V2=true node dist/cli/main.js auth login again

  • Observe the browser doesn't open again because you are already logged in.

  • Run ENABLE_CLI_V2=true node dist/cli/main.js auth status

  • Observe that your data is displayed in the CLI

  • Run ENABLE_CLI_V2=true node dist/cli/main.js auth logout

  • Observe you are logged out

Pre-merge Checklist

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

@sejas sejas self-assigned this Sep 12, 2025
openInBrowser( authUrl );

console.log( __( 'Note: This will open the Studio app to complete authentication.' ) );
console.log( __( "If the Studio app doesn't open automatically, please install it first." ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather not require the Studio App. Did you check the authentication command in my prototype, I have a solution for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing that out. I'll take a look at your branch to bring the logic over here.
I initially took this approach to begin drafting the PR.

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