Introducing Conductor Cloud →Skip to docs content

Reference

Setup script reference

Copy local files, install dependencies, and prepare each new workspace

When you create a new workspace, Conductor will copy in all your git files.

To get any other files you need, like dependencies, .env files, or build files, use Files to copy or a setup script. Configure your setup script in Repository Settings by clicking the repo name in the sidebar.

Use Files to copy when Conductor only needs to copy gitignored local files into each new workspace. Use a setup script when the workspace needs commands, generated files, symlinks, or workspace-specific resources.

Example

Here's an example setup script that installs dependencies, copies your .env file, and builds the app:

# Install dependencies
npm install

# Copy .env file
cp $CONDUCTOR_ROOT_PATH/.env .env

# Build the app
npm run build

How it works

The setup script runs in your new workspace directory ($CONDUCTOR_WORKSPACE_PATH) as soon as it's created.

In this example, we copy the .env file from the repository root directory ($CONDUCTOR_ROOT_PATH) into each new workspace.

The repo root directory is a good place to store files you might want to share across workspaces. You can copy or symlink them depending on your needs.

Setup scripts run in non-interactive shells. If a tool works in your normal terminal but fails in a setup script, see Shell configuration.

More tips

Here's the setup script we use for Conductor and a walkthrough of how it works:

Video summary: Advanced setup script walkthrough

The video shows a Conductor setup script creating workspace-specific development resources for the desktop app, including dependencies, app identifiers, data directories, ports, application support folders, and icons. It demonstrates running two workspaces at once so each workspace has its own app instance for testing agent changes.

Use workspace-specific resources

If your app stores local state, make the setup script create resources for each workspace instead of sharing one development instance.

Use CONDUCTOR_WORKSPACE_NAME to name generated resources such as app identifiers, local data directories, application support folders, or development icons. Use CONDUCTOR_PORT when each workspace needs its own server port.

This is especially useful for desktop apps and other projects that keep local databases or config files outside the repository. Each workspace can run its own dev instance, so testing one agent's changes does not overwrite another workspace's database, port, or configuration.

Next steps

For long-running processes that should run in the background while you develop, add a run script.

For more details about how setup scripts work, see Scripts.

On this page