The method you're seeking is
PluginManager.callCommand. An interpreter reference is expected, so you should pass a reference to an appropriate interpreter instance, e.g.
JavaScript:
var interpreter = $gameMap._interpreter;
var pluginName = 'factions';
var commandName = 'open';
var args = {};
PluginManager.callCommand(interpreter, pluginName, commandName, args);
If you're in battle, consider
$gameTroop._interpreter instead. However, this shouldn't make a difference unless your plugin command is context-dependent.
Invoking plugin commands remotely is much simpler if you write the commands as public functions: you can then just call those functions directly, e.g.
Spoiler: Example plugin code
JavaScript:
// example.js //
/*:
* @target MZ
* @plugindesc example plugin
* @help help text
*
* @command test
* @desc Say hello!
*/
window.myStuff ||= {}; // author namespace (global)
($ => { // $ = myStuff.myPlugin = plugin namespace
const PLUGIN_NAME = 'example';
$.sayHello = function() { alert('Hello!'); };
PluginManager.registerCommand(PLUGIN_NAME, 'test', $.sayHello);
})(myStuff.myPlugin ||= {});
For this plugin, the following script call is identical to the
test command:
JavaScript:
myStuff.myPlugin.sayHello();
This works because
myStuff is defined on the global object,
window, so all of its properties, including the
sayHello function, are also globally accessible.
(I've structured the example like this partly for organisational purposes, and partly to avoid defining any unnecessary global variables.)