In case your
bashly.yml file becomes too large, you may import smaller
configuration snippets by using the
Loaded configuration snippets can be placed in:
- Other YAML files, anywhere you want (typically, inside your
- As a YAML front matter, alongside the shell code that they represent.
Importing other YAML files
Consider the below, standard
name: cli help: Sample application commands: name: download alias: d help: Download something args: - ...
download command to a separate YAML file, looks like this:
name: cli help: Sample application commands: - import: src/download.yml - import: ... additional files ...
name: download alias: d help: Download something args: - ...
Embedding the YAML definition alongside its bash code
import directive can also be used to load YAML front matter from any text
file. This feature can be useful in case you wish to embed the definition of
the command alongside its source code (shell script).
name: cli help: Sample application commands: - import: src/download_command.sh
name: download alias: d help: Download a file args: - name: source required: true help: File to upload --- # Your shell script starts here, after the '---' YAML marker inspect_args
Debugging complex configuration
bashly validate --verbose shows the configuration file as Bashly sees
it, even if it is invalid. This can be helpful when trying to debug validation
errors for complex configuration files.