PopClip JavaScript API Reference
    Preparing search index...

    Interface ShellScriptOptions

    interface ShellScriptOptions {
        arguments?: string[];
        env?: Record<string, string>;
        interpreter?: string;
        prefix?: string | null;
        shellMode?: "none" | "login" | "nonlogin";
        stdin?: string;
    }
    Index
    arguments?: string[]

    Positional arguments for the script, arriving as $1, $2, … — strings only. File form only.

    env?: Record<string, string>

    Extra environment variables for the script, string values only. The escaping-free way to pass data in.

    interpreter?: string

    What runs the script: an absolute path, or a bare name (for example "zsh", "python3") resolved through the login shell's PATH — in every shellMode, since resolution and execution are separate. Required for inline source; optional for a script file that is executable with a shebang line.

    prefix?: string | null

    A line prepended to the script before it runs. Inline form only. Default none — pass null (or "") to be explicit about wanting none. (The $ tag defaults this to "set -euo pipefail".)

    shellMode?: "none" | "login" | "nonlogin"

    How the run is executed:

    • "none" (default): execute the interpreter — or the shebang script file itself — directly, with arguments as its real argument vector. No shell is involved: the fastest and most deterministic mode, with no shell profile output mixed into stdout.
    • "login": run via the user's shell as a login shell (-lc), sourcing their profile — the script sees the user's own PATH and environment, at the cost of whatever the profile does.
    • "nonlogin": run via the user's shell without -l — for setups whose environment lives in .zshenv alone.
    stdin?: string

    Text delivered to the script on standard input. File form only.