There is the steps.
- select a file or directory in workspaces.
- exec command via keybindings.
- get the selected file or directory path in command handler.
Command handler
vscode.commands.registerCommand('extension.myExtension', function (event) {
// event is undefined.
// how to do in here?
})