sonburn You can pass the context your command receives along:
...runPluginCommandWithIdentifier_fromBundleAtURL('layout-artboards', this.pluginURL, context);
If you need to create one from scratch, try something like:
var command = // ... context.command;
var ctx = context.document.pluginContext();
var fullContext = command.fullContextFromContext_url_(ctx, fileURL);
You'll want to pay special attention to the parameters you're passing, as the invoked command needs to receive the correct and up-to-date context, etc., in order to function properly.