Skip to content

Shell script orchestration in an optional terminal user interface

License

Notifications You must be signed in to change notification settings

prototypo/script-launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

script-launcher

Shell script orchestration in an optional terminal user interface

Script Launcher is a terminal application with an optional terminal user interface (TUI) to execute a list of shell scripts. Scripts are listed in any number of JSON files that are fed as input to Script Launcher.

Script Launcher may be run with a terminal user interface to allow full control of execution and error handling during development, then run in noninteractive (headless) mode for production use to immediately execute all scripts in order.

Why?

Developers often collect a large amount of shell scripts to support software projects. Good scripts are reusable components that do one or at most just a few things, so Script Launcher provides a framework to collect them into project files that implement task-specific pipelines.

Usage

Running script-launcher.py -h or script-launcher --help will show the usage information, as shown in Figure 1.

Script Launcher help message Figure 1 Script Launcher usage information

Providing a JSON file on the command line is mandatory. The provided example file script-launcher.json is the default JSON file. You will need to either create you own on the command line via the -j or --json options, or locate script-launcher.json in the current working directory.

Script Launcher will present a terminal user interface by default. Each script will be represented as buttons in the left sidebar. The scripts may be executed in any order by pressing the buttons. An example of this behaviour is show in Figure 2.

If you want to see more or less information about your scripts' execution, try the q or --quiet flag to reduce noise and the -v or --verbose flag to present debugging information.

Script Launcher partial execution Figure 2 Script Launcher showing execution of a single script out of order

Script Launcher will show any errors that occur during execution, as shown in Figure 3.

Script Launcher error Figure 3 Script Launcher showing the result of a script execution with an error

Menu items at the bottom of the terminal user interface provide additional functionality. Figure 4 shows the results of the "Show steps" command (accessed by selecting the s key). The steps come from the JSON file selected by the user.

Script Launcher show steps Figure 4 Script Launcher showing the "Show steps" command and result

Alternatively to executing each script in sequence, Script Launcher will immediately execute all scripts in order when the -e or --execute flag is provided on startup. Figure 5 shows the state immediately after launch when immediate execution has been requested.

Script Launcher immediate execution Figure 5 Script Launcher terminal user interface after immediate script execution.

Finally, Script Launcher may be launched with the -n or --noninteractive flag to skip the terminal user interface entirely. Doing so immediately executes all scripts in order. That is, the -n flag infers the -e flag. This mode is intended for headless use, e.g., on a server, when no human is present. It is useful for production use once any bugs have been addressed.

Figure 6 shows the noninteractive mode in action.

Script Launcher noninteractive mode Figure 6 Script Launcher in noninteractive mode

About

Shell script orchestration in an optional terminal user interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages