Sazabi
Detect

Manage scripts

Save a reusable bash script to a project, then run it or attach it to an automation.

A script is a named bash file saved to a project. You write it once and reuse it — run it by hand, or attach it to an automation so it runs on a schedule. Scripts are managed with the Sazabi CLI.

Outcome: a saved, versioned script in your project you can attach to an automation. Time: a couple of minutes.

What scripts are

Each script has a name, an optional description, and a body (the bash source). Names use letters, numbers, hyphens, and underscores (1-64 characters). Sazabi stores the body and a content hash, so you can see exactly what will run.

Because a script runs inside the project sandbox, it has access to the same CLIs and tooling the agent uses there. See Set up the sandbox for what the sandbox provides.

Creating and editing

Create a script from inline content or a file:

# From a file
sazabi scripts create deploy-check --file ./deploy-check.sh --description "Nightly deploy sanity check"

# From inline content
sazabi scripts create hello --content '#!/usr/bin/env bash
echo "hello from the sandbox"'

Update the body or description later:

sazabi scripts update deploy-check --file ./deploy-check.sh
sazabi scripts update deploy-check --description "Updated helper"

List and inspect scripts:

sazabi scripts list
sazabi scripts get deploy-check

Delete a script you no longer need:

sazabi scripts delete deploy-check

Scripts and automations

A script becomes scheduled work when you attach it to an automation. The automation owns the schedule and timezone; the script owns the logic. The script's exit status is the run's result — exit 0 marks the run as succeeded, and any non-zero exit marks it as failed. A script that finishes its check and finds a problem should print what it found and still exit 0; reserve non-zero for the script itself failing to run. See Create automations for the full exit-status contract.

Verify

Create a script, then read it back and confirm the stored body matches what you saved:

sazabi scripts create verify-demo --content '#!/usr/bin/env bash
echo ok'
sazabi scripts get verify-demo

The get output should show the exact body you supplied. If the script is missing, confirm you selected the right project with sazabi projects use.

Further reading