Script Management
Script Management
Script Management
Overview
spark script manages and executes custom automation scripts. Scripts can be declared in the config file or live as executable files in the scripts/ directory.
Core Capabilities
Script Discovery
Automatically discover scripts from two sources:
- Config-file scripts: the
spark.scripts(or top-levelscripts) key in~/.spark.yaml. - Directory scripts: executable files under the project’s
scripts/directory.
Config-file scripts take precedence.
spark script list
Script Execution
Run a registered script by name, with optional additional arguments.
spark script run my-script
spark script run deploy -- --env production
Parameters
| Command | Argument | Description |
|---|---|---|
list |
— | List every available script |
run |
<name> [args...] |
Run the script and forward arguments |
Config Example
# ~/.spark.yaml
spark:
scripts:
- name: hello
content: |
#!/bin/bash
echo "Hello, World!"
A configured script has exactly three keys: name (the script name), content
(the script body) and path (optional, path to a script file). A key such as
command: has no effect — with an empty content, spark script run
fails with script 'hello' has no content.