Inputs
Define parameters to automatically generate command line flags and a terminal user interface.
Inputs allows users to specify values that can be used as parameters when running a script. This lets scripts to be customized and used in different contexts without the need to edit the script itself.
To create an input, go to the "Editor" tab when editing a script and click the "Add Input" button.
Inputs are passed to Scripts in an idiomatic way, with the correct types. See Supported Runtimes for more details.
Input Types
There are four types input types: Text, Selector, Checkbox and Filepicker.
Text
Arbitrary text from the user. No validation will be performed.
Property | Description |
---|---|
Placeholder | Grey text that will appear in the textfield when it is empty |
Selector
A set of options.
Options can be defined in advance or they can be generated at execution time, based on the output of a shell command.
Property | Description |
---|---|
Suggestions | a static list of possible values |
Generators | A shell script that will be executed to generate suggestions when the script is invoked |
Checkbox
A boolean value.
You can customize the value that is substituted into the script depending on whether the checkbox is off or on.
Property | Description |
---|---|
True Substitution Value | The text value injected into a bash script if the checkbox is selected (Bash only) |
False Substitution Value | The text value injected into a bash script if the checkbox is not selected (Bash only) |
Bash Runtime Only: If the checkbox is left unchecked then the False Substitution Value is used, otherwise the parameter will be replaced with the True Substitution Value.
Filepicker
An absolute path to a file or folder.
Property | Description |
---|---|
Type | "Files & Folders", "Files only", "Folders only" |
File Extensions | Specify the list of acceptable file extensions, for instance: "js", "ts", "jsx" |
You can define additional properties, like a custom Label or a Description on all Input types. These fields help to document the script so it is clear what the inputs are and how they'll be used.