Overview
Thecloud.setupScript field in stably.yaml allows you to run a bash script during agent session initialization. This is useful for projects that have CI-generated files not in the repository but required for tests to run.
When to use
cloud.setupScript vs postinstall: Use cloud.setupScript for setup that should only run in Stably’s cloud environment. If you need the same setup to run locally and in your own CI, add it to your postinstall script instead.Use Cases
| Scenario | Example |
|---|---|
| Auth/config files | Create files that are generated by CI but not committed |
| Codegen scripts | Run GraphQL, Prisma, or other code generation |
| Test fixtures | Set up environment-specific test data |
| Pre-test setup | Any setup that isn’t part of npm install |
Configuration
Add acloud section to your stably.yaml with a setupScript field:
stably.yaml
Configuration Options
| Field | Type | Required | Description |
|---|---|---|---|
cloud.setupScript | string | No | Bash script to run during session initialization. Use YAML literal block style for multi-line scripts |
Stably automatically runs dependency installation (
npm install, pnpm install, etc.) before your setup script executes. You don’t need to include dependency installation commands in your script.Related Configuration
Thestably.yaml file supports additional configuration for other Stably features: