You don't need --sourcepath
. It looks at where you are pointing and tries to pull items which match what you have there already.
What you do need is a package.xml
file to get your entire metadata database; you might need help getting that file for your particular org.
Instead, you can do the following to get going with Apex or Lightning Component development:
force:project:create -n MyProject
cd MyProject
sfdx force:source:retrieve -m CustomObject
sfdx force:source:retrieve -m ApexClass
sfdx force:source:retrieve -m ApexPage
sfdx force:source:retrieve -m ApexClass
sfdx force:source:retrieve -m AuraDefinitionBundle
sfdx force:source:retrieve -m LightningComponentBundle
or you can use this nifty one-liner:
sfdx force:source:retrieve -m CustomObject,ApexClass,ApexPage,ApexTrigger,LightningComponentBundle,AuraDefinitionBundle
That will populate your source tree, and --sourcepath
will work when it's pointed at one of those folders.