A scratch org is a disposable deployment of Salesforce code and metadata. Sometimes it's helpful to share a scratch org with a teammate. In this scenario Person A wants to share their scratch org with Person B. Reasons for sharing an org include:
Collaboration on a ticket
Passing along an org that you no longer need so a teammate can jump right into development instead of spinning up a new org
Person A gets the Auth Url to provide for Person B by doing the following:
In the terminal run sfdx force:org:display -u --verbose and replace or simply sfdx force:org:display --verbose to use the default org.
Copy the value for Sfdx Auth Url and give it to Person B. The value will have the format "force://@" or "force://::@".
Then Person B stores the Auth Url by doing the following:
Create an auth.key file.
Open that file with vscode or another text editor
Add the Auth Url provided by Person A
In the terminal run the command
sfdx force:auth:sfdxurl:store -f ../auth.keywhere
../auth.keyis the path to the file with the auth url info. This command will use that file to identify and connect to the scratch org.
Open the org with the command
sfdx force:org:openand voila! They're in Person A's org.