You need to add all registered commands to the activationEvents
list in package.json so that they are available on invocation. Update your package.json as such:
{
...
"activationEvents": [
"onCommand:extension.openMyExtension",
"onCommand:extension.useMyExtension"
]
...
}
You can find more details on activation events in the official VSCode Documentation.