- 
            
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 273
 
Description
Hi,
Is it possible to have a runner & script that just allows a user to interact via just the command line, and see their commands and responses come up ? I hoped it might be as simple as having a having a .json runner with something as simple as below, but that doesn’t seem to work ?
  "requires_terminal": "true",
  "output_format": "terminal"
To provide more context, one of the drivers for this is to load .yaml files for an application called Organize which from the command line I would run a configuration like this organize sim config_tech.yaml ? The good thing about this is that the yaml files do not have to be executables..
Would a potential option to achieve this, be to use parameters and see if it’s possible to have people load these Organize configuration files from a pick list (as they are all stored in a folder) ?
Any ideas suggestions much appreciated.
Activity
bugy commentedon Dec 9, 2024  
Hi @nodecentral, I think you are asking for full-fledged terminal and bash support. For this you could just run
bashpotentially and then it will consume all users commands. But script server output window is not well-designed for interactive behaviour.But I guess the proper way would be to give parameters for
Organizenodecentral commentedon Dec 9, 2024  
Hi @bugy thanks so much for responding, having just
bashin a script gives me the direct terminal feel, many thanks.When it comes to creating an interactive pick list, allowing me to select and run any one of a list of Organize
.yamlconfig files? Is there a way I can use a parameter options to look to a defined folder and build a dynamic list of the files in there.Or does every file have to be hard coded into a file
bugy commentedon Dec 9, 2024  
Hi @nodecentral , sure. You can use this parameter type https://github.com/bugy/script-server/wiki/Script-config#server_file
Or if you need more dynamic behavior, you can use this parameter type https://github.com/bugy/script-server/wiki/Script-config#list and define a script which will resolve possible values
nodecentral commentedon Dec 9, 2024  
Thanks @bugy
I was looking at the
server_fileoption, but I’m not sure what the script (in script_path needs to be)?the dynamic option looks interesting, but it’s well out of my coding skills..
bugy commentedon Dec 10, 2024  
Script path will be
organize simi guess in this caseAlso you wouldn't need "param" option
Also, make sure to remove empty curly braces
nodecentral commentedon Dec 12, 2024  
Thanks @bugy , is this looking right ?
Some questions.
working_directoryandfile_dir? They’re both point to where all the xxxxx.yaml files are stored ? Do I need both ?script_path, it needs to receive the chosen parameter from the pick list and pass that to the required command, which would simple beorganize runand then e.g. what’s chosen e.g.config_tech.yaml? Do you have any examples I could use?"include": "${Simple Text}.jsonis that even needed here?bugy commentedon Dec 12, 2024  
Hey, please check my previous answer regarding script path
Working directory is probably not needed.
Include is not needed
Parameters should be an array, i.e. add square braces before and after
In general, i highly recommend not to copy examples. They usually have way more stuff than needed for people's use cases. If you don't know what an option does, then most probably you don't need it
nodecentral commentedon Dec 14, 2024  
Thanks @bugy, having not done this before, hopefully I’m getting closer, how is this looking ?
Recap on the objective : Script that will allow me to look up to the
./organizefolder, to pick a .yaml file (from an auto-generated list of all available .yaml files) e.g.photos.yamland send it to the command line to be prefixed withorganize simand run. (The resulting combined command line entry isorganize sim photos.yaml(Not able to get it to work at the moment, pick list not returning anything, and if I execute it as it, it does this..
Not sure why/where it is pulling the string “config” as search criteria ?
nodecentral commentedon Dec 19, 2024  
Sorry @bugy, any further advice on how I’d get this to work would be great.. many thanks
bugy commentedon Dec 19, 2024  
Hi @nodecentral sorry for a late response. Where is your
organizefolder is located? Relative to script-server folderIf you open "history" tab at the bottom, you can see, which command is actually executed. What does it show for you?
bugy commentedon Dec 19, 2024  
You can also check script-server logs (either stdout or logs/server.log)
bugy commentedon Dec 19, 2024  
I created
organizefolder inside script-server folder and yaml files are correctly displayed in the dropdown list for me. When I use the config, provided by younodecentral commentedon Dec 19, 2024  
Hey @bugy thanks for responding.
I've moved it around since, trying different locations, using the
bashscript I created earlier to manually run them, all the*.yamlfiles are inapp/scripts/organize/bugy commentedon Dec 19, 2024  
and where is script-server located?
bugy commentedon Dec 20, 2024  
Hey @nodecentral , any update?
nodecentral commentedon Dec 20, 2024  
Hey @bugy, sorry I didnt get your reply.
I've installed ScriptServer via docker, here are my volume/binds
bugy commentedon Dec 20, 2024  
And in which host (original) folder are your yaml files located? Is it
share/Container/script-server/organize/config? Then you can use/root/.config/organizeas a path in the parameter