Skip to main content

Overview

The cloud.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

ScenarioExample
Auth/config filesCreate files that are generated by CI but not committed
Codegen scriptsRun GraphQL, Prisma, or other code generation
Test fixturesSet up environment-specific test data
Pre-test setupAny setup that isn’t part of npm install

Configuration

Add a cloud section to your stably.yaml with a setupScript field:
stably.yaml
cloud:
  setupScript: |
    npm run codegen
    npm run generate:fixtures

Configuration Options

FieldTypeRequiredDescription
cloud.setupScriptstringNoBash 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.
Your script runs from the directory where stably.yaml is located.

The stably.yaml file supports additional configuration for other Stably features: