How Setup Scripts Work
When a workspace starts, Rigbox executes all attached setup scripts inside the VM as thedeveloper user. Scripts run sequentially in the order you specify, with full network access and sudo privileges.
Each script has a run mode that controls when it executes:
Create a Setup Script
Write the script to a local file, then create it with the CLI. Once created, you can attach it to any number of workspaces.Script Content Guidelines
Setup scripts run as bash inside the workspace VM. Here are guidelines for writing reliable scripts:Attach Scripts to a Workspace
Pass--setup-script-id (repeatable) when spawning a workspace. Scripts run in the order you list them.
Script Ordering
Scripts execute sequentially in array order. This is important when scripts have dependencies:List Your Scripts
Retrieve all setup scripts in your account.Update a Script
Modify an existing script’s name and/or body. Pass--name, --file, or both.
Updating a script affects all future workspace starts that reference it. Already-running workspaces will pick up the change on their next restart (for
every_start scripts) or not at all (for first_boot scripts that have already executed).Delete a Script
Combining with Templates
Templates can include their own setup scripts. When you create a workspace with both a template and additionalsetup_script_ids, the template’s scripts run first, followed by yours.
- Template
devscripts (e.g., install Node.js, npm packages) - Your script
ss_my_custom_config(e.g., clone your repo, set up environment)
Use Case: Team Onboarding
Create a single setup script that configures everything a new team member needs. Every workspace they create starts fully configured.Use Case: Ephemeral Demo Environments
For product demos, create a setup script that loads sample data and starts services:Debugging Setup Scripts
If a setup script fails, the workspace will still start, but the script’s exit code and output are captured. To check script execution results, look at the workspace status after it starts:Next Steps
- Service Specs - define background services that auto-start after setup completes
- Snapshots - snapshot a fully configured workspace and restore it later
- Managed AI Proxy - add AI capabilities to your scripted environments