pub struct ExecSpec {Show 13 fields
pub argv: Vec<String>,
pub passthrough: bool,
pub url: Option<String>,
pub file: Option<String>,
pub kotlin: Option<String>,
pub python: Option<String>,
pub node: Option<String>,
pub bash: Option<String>,
pub sh: Option<String>,
pub zsh: Option<String>,
pub text: Option<String>,
pub sha256: Option<String>,
pub ttl: Option<u64>,
}Fields§
§argv: Vec<String>Program argv. For remote url / local file leaves this is an optional
interpreter prefix (e.g. ["python3"]); the script path is appended automatically.
For kotlin: leaves this is the argument list passed to main.
passthrough: boolAppend extra CLI arguments after those from argv / the script path.
url: Option<String>HTTPS URL of a remote script to download, verify, and run.
file: Option<String>Local script path relative to the jan use root (optional sha256 pin).
kotlin: Option<String>Kotlin source relative to the jan use root (.kt / .kts), or an inline
program (multiline YAML string). Paths are a single line ending in
.kt/.kts; anything else is treated as inlined source and compile-once
as .kt. argv is passed to main.
python: Option<String>Python source relative to the jan use root (.py), or an inline program.
Runs with the packages.uv venv interpreter when present. argv is
forwarded after the script / -c body (sys.argv).
node: Option<String>JavaScript source relative to the jan use root (.js / .mjs / .cjs),
or an inline program. Runs with node and packages.pnpm NODE_PATH
when present. argv is forwarded on process.argv.
bash: Option<String>Bash source relative to the jan use root (.sh / .bash), or an inline
program (bash -lc). argv is $1… ($0 is the command name).
sh: Option<String>POSIX sh source (.sh) or inline (sh -c). argv is $1….
zsh: Option<String>Zsh source (.zsh / .sh) or inline (zsh -c). argv is $1….
text: Option<String>Literal text to print with no subprocess (text: or alias cat:).
sha256: Option<String>SHA256 of the script: required with url, optional with file.
ttl: Option<u64>Optional TTL override (seconds) for the remote script cache.
Implementations§
Source§impl ExecSpec
impl ExecSpec
pub fn is_remote(&self) -> bool
pub fn is_local_file(&self) -> bool
pub fn is_kotlin(&self) -> bool
pub fn is_python(&self) -> bool
pub fn is_node(&self) -> bool
pub fn is_bash(&self) -> bool
pub fn is_sh(&self) -> bool
pub fn is_zsh(&self) -> bool
pub fn is_text(&self) -> bool
Sourcepub fn literal_text(&self) -> Option<&str>
pub fn literal_text(&self) -> Option<&str>
Body for exec.text / exec.cat, trimmed of surrounding whitespace.
Sourcepub fn is_language_source(&self) -> bool
pub fn is_language_source(&self) -> bool
True when a language exec.* field is set.
Sourcepub fn kotlin_value_is_path(raw: &str) -> bool
pub fn kotlin_value_is_path(raw: &str) -> bool
True when raw is a single-line .kt / .kts path (not inline source).
pub fn python_value_is_path(raw: &str) -> bool
pub fn node_value_is_path(raw: &str) -> bool
pub fn bash_value_is_path(raw: &str) -> bool
pub fn sh_value_is_path(raw: &str) -> bool
pub fn zsh_value_is_path(raw: &str) -> bool
Sourcepub fn kotlin_is_path(&self) -> bool
pub fn kotlin_is_path(&self) -> bool
True when exec.kotlin names a tree-relative .kt / .kts file.