Electron interacting with cli program?


#1

Hey guys,

So this title and question may seem weird, but i have an idea for an electron app, but i was wondering how it can interact with a command line program??.. For eg: I have melt video editor installed on my linux machine, and i would like electron to be the gui for it, but how to interact with it??, say creating and updating bash scripts?, because it is easy to use the command line features in melt, but my question still remains… what is the easiest way to use electron gui with command line features that are used in melt?, would i have to have javascript create bash files and have them updated automatically with every time i make a change in the gui?, or is their another way? maybe database way of holding all the code needed when making changes in the gui then at end using the database to create script that is used in commandline of melt??

Hope someone can guide me in the right direction of interacting with the system command line with an electron gui app??
BTW: this is just an idea of creating a new gui for a command line program.

thanks


#3

Cool I will look into it and give it a go with a test…
The only reason i was thinking about it, was for personal use and tinkering…:slight_smile:


#4

hey… i looked into it and cant quite figure out how…
could you give me a possible example of lets say an electron app with a button, when said button is pressed it opens a program from command line…

and what to put in the main js file and what javascript to have on the html page…

sorry if this is a convenience, i just learn by looking at other peoples code setup, as it makes more sense than reading the electron documentation…

Hope you can help :slight_smile:


#5

actually, if you just want to launch an application, thats not including getting input and output of the command, you simply need the child process module. like so:

<...>
launch



i hope this works on first try, but that is the essence of it.

#6

hey yeah i ended up working out that part, from reading the node js doc, now just working out the next parts, of interaction… Just didnt realise that i had to read the electron doc and the node js doc…lol, but its cool, was really excited when i got a native program to launch, it was like “Fricken awsome!!”…lol well… onto learning and tinkering with the other stuff of the program now…:slight_smile: