I have recently installed VS Code and migrated my projects from Eclipse over to VS Code. I'm getting familiarized with the IDE. I've gotten my projects created and authorized and have successfully retrieved metadata and pushed metadata to the orgs.
I am still trying to get a handle on DevHub and scratch orgs. I created a Trailhead playground and enabled DevHub in the Trailhead playground. I went thru the steps to install a sample gallery into a scratch org by cloning a git repo. I've gone thru the trailhead modules on setting this all up, but I'm still struggling to get a full grasp on how this works. Is the only purpose for the DevHub to enable the command line interface? It indicates that the scratch orgs are only good for 7 to 30 days depending on what you set. I set it for 30 days. Is the scratch org deleted after the expiration of the number of days that have been set? The local directory where I cloned the git repo would no longer be connected to an org and would need to be reconnected to a new scratch org and then have the metadata pushed back into the new scratch org, is that correct?
I created a scratch org for the sample gallery that I pulled down from the git repo. I was able to open the project from the terminal using the command
However, today, then I typed it in, it gave me the error
Must pass a user and/or OAuth options when creating an AuthInfo instance.
Where can I find the username and how to pass that when running the open org command?
Is there a way to open the scratch org without using the terminal commands and instead use
Ctrl + Shift + p and then use the sfdx to search for a command in the UI to open the scratch org? Or, can you only open the scratch org using commands in the terminal?