System Call Access for UXP

For those interested in gaining CLI access, currently it’s not possible via UXP directly, however it can be via UXP C++ Hybrid Plugins.

Starting your own hybrid plugin from scratch or based off the example isn’t easy, but in our new UXP boilerplate Bolt UXP we have a Hybrid Plugin template available that comes pre-packaged with an execSync() function for you to start using.

      let hybridModule: {
        execSync: (cmd: string) => string;
      } = await require("bolt-uxp-hybrid.uxpaddon");

      let execSyncRes = hybridModule.execSync("echo test");

You only need C++ experience if you want to modify the hybrid portion of the plugin, if you don’t want or need to mess with that portion, you can just use as is from the JS side and start accessing the command line.

Bolt UXP is free and open-source, so feel free to use it, or if you have your own thing copy the Hybrid Plugin files into your own system:

1 Like