DocsScripts
Configuration
Directory Structure#
The .zirv/ directory contains zirv's configuration; your scripts live in its
commands/ subdirectory (zirv 3.0). The structure is as follows:
.zirv/
├── .shortcuts.yaml
├── ctx.toml
├── commands/
│ └── ...your script filesSchema Examples#
Supported schemas are YAML, JSON, and TOML. Below are examples of each:
YAML Example#
name: Example Config
description: An example script.
params:
- user
commands:
- command: "echo Welcome, ${user}"
capture: welcome_msg
options:
interactive: false
- command: echo ${welcome_msg}
description: Prints greeting
options:
interactive: true
operating_system: linux
proceed_on_failure: false
delay_ms: 2000
fallback:
- command: "echo 'Attempting fallback...'"
secrets:
- name: api_key
env_var: API_KEYJSON Example#
{
"name": "Example Config",
"description": "An example script.",
"params": ["param1"],
"commands": [
{
"command": "echo Welcome, ${user}",
"capture": "welcome_msg",
"options": {
"interactive": false
}
},
{
"command": "echo ${welcome_msg}",
"description": "Prints greeting",
"options": {
"interactive": true,
"operating_system": "linux",
"proceed_on_failure": false,
"delay_ms": 2000,
"fallback": [
{
"command": "echo 'Attempting fallback...'"
}
]
}
}
],
"secrets": [
{
"name": "api_key",
"env_var": "API_KEY"
}
]
}TOML Example#
name = "Example Config"
description = "An example script."
params = ["param1"]
[[commands]]
command = "echo Welcome, ${user}"
capture = "welcome_msg"
options.interactive = false
[[commands]]
command = "echo Token is ${token}"
options.interactive = true
options.operating_system = "linux"
options.proceed_on_failure = false
options.delay_ms = 2000
[[commands.options.fallback]]
command = "echo 'Attempting fallback...'"
[[secrets]]
name = "api"
env_var = "API_KEY"