Add scripts To get the most out of Conductor, you can automate repeated actions using scripts. Conductor lets you define three scripts:
  1. Setup script: runs each time you create a workspace
  2. Run script: runs when you click the “Run” button in the bottom-right corner of the screen
  3. Archive script: runs when you archive a workspace
To configure these scripts, create a conductor.json file in the root of your repo. For example:
{
    "scripts": {
        "setup": "npm install; cp $CONDUCTOR_ROOT_PATH.env .env",
        "run": "npm run dev"
    }
}
In setup scripts, as in the terminal, you can use any of the Conductor environment variables. The scripts run using zshell.

Setup script

When Conductor creates a workspace, it copies in all your git files. Use the setup script to set up any files that aren’t tracked in git: for instance, you might install dependencies or copy .env files. The setup script will run inside the newly-created workspace directory. If your app uses a .env file, we recommend these steps:
  1. Go to the repository settings page (click the repo name in the left sidebar)
  2. Choose “Open In” to open the repository root directory in Finder or an IDE
  3. If your .env file isn’t already in the repository root, copy it there
  4. In your setup script, symlink .env into the workspace with ln -s "$CONDUCTOR_ROOT_PATH/.env" .env

Run script

Use the run script to easily launch your web server, app, or unit tests. Example: python3 -m http.server --port $CONDUCTOR_PORT

Run script mode

If you can’t run multiple dev servers at once, use nonconcurrent mode. In this mode, whenever you click the run button, Conductor will kill any in-progress run scripts before starting the new one.
{
    "scripts" {
        "run": "echo Running..."
    },
    "runScriptMode": "nonconcurrent"
}

Archive script

When you archive a workspace, Conductor deletes the workspace directory. Use the archive script to clean up any resources that live outside this directory. For example, we use rm -rf "$HOME/Library/Application Support/com.conductor.app.dev.$CONDUCTOR_WORKSPACE_NAME" to clean up Application Support data.

conductor.json precedence

Conductor looks for a conductor.json file at the root of your workspace. If it can’t find one there, it will look on the default branch on the remote (typically origin/main).

Tips

Scripts are the trickiest part of Conductor. If you’re having trouble, reach out to us at [email protected]. At Conductor, we’re building a desktop app. We use setup scripts to install dependencies, create a unique database, and even a custom app icon. Here’s a link to the setup script we use for Conductor. Feel free to give it to Claude and ask it to build a custom setup script for your codebase. Here’a video walkthrough on how it works: