I want to write few automation that will run on cli and use sfdx force:org:open. How do I simulate the command?
The automation needs the url that sfdx... command leads to in the browser.Example I want to be able to reach the page using selenium. Though I can put this command itself in automation script but that will not link selenium to it.
Also lets say I obtain the url somehow in my script, if I access that link using selenium will I able to or will I encounter any access issue?

So if I run the command from python using subprocess

cmnd='sfdx force:org:open'

I am able to access the org like usual, but I want to access the url in code without actually accessing the link in browser.

  • 1
    What have you tried? Where are you stuck?
    – David Reed
    Aug 17 at 18:37
  • 1
    @DavidReed I have added the try so far, but all I have are question marks ahead Aug 17 at 18:48

1 Answer 1


Adding the -r flag to the command will return the URL instead of attempting to open in browser

sfdx force:org:open -r

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.