> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cli/integrations/conductor.md).

# Conductor

SonarQube CLI integration runs automatically in every Conductor workspace when you configure a setup script.

[Conductor](https://conductor.build/) orchestrates AI coding agent sessions such as Claude Code and OpenAI Codex, running each in an isolated Git worktree. A project-scoped SonarQube CLI integration writes agent files into the current working directory, so a newly created workspace may not contain those files unless they are committed or installed during workspace setup.

Use a Conductor setup script to run the integration automatically each time Conductor creates a workspace.

## Prerequisites

* [The SonarQube CLI is installed and authenticated](/sonarqube-cli/quickstart-guide.md) on the machine that runs the Conductor workspace.
* The repository has been analyzed with SonarQube and has a project key.
* `sonar` is available on the `PATH` used by Conductor setup scripts.

## Add a setup script

Conductor runs a setup script each time it creates a workspace. Add the integration command there:

1. In the Conductor sidebar, hover over your project under **Projects** and select the gear icon to open **Repo settings**.

   <div align="left"><figure><img src="https://91575325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeHsJzr9cYhsTa0LTZlmo%2Fuploads%2Fgit-blob-7a19b1868cdc5b4f0d0eb77d7d4a4d6bcabc55a7%2Fconductor-repo-settings.png?alt=media" alt="The Conductor sidebar with a project hovered, showing the gear icon and the Repo settings tooltip." width="563"><figcaption></figcaption></figure></div>
2. Under **Repositories**, select your repository, then select **Scripts**.
3. In the **Setup script** field, add this command:

   ```bash
   sonar integrate <codex|claude|cursor> --project <YourProjectKey> --non-interactive
   ```

   <div align="left"><figure><img src="https://91575325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeHsJzr9cYhsTa0LTZlmo%2Fuploads%2Fgit-blob-e730fd41c8d5142d73f480325eef29772e031257%2Fconductor-setup-script.png?alt=media" alt="The Scripts page of the Conductor repository settings, showing the sonar integrate command in the Setup script field." width="563"><figcaption></figcaption></figure></div>

Replace `<codex|claude|cursor>` with the agent you run in Conductor, and `<YourProjectKey>` with your SonarQube project key.

Conductor runs setup scripts in a non-interactive shell from the workspace directory. The `--non-interactive` flag prevents prompts, and the explicit integration subcommand and `--project` flag give the CLI the information it needs without relying on interactive selection.

If your repository already has a setup script, append the integration command to the existing setup flow:

```bash
npm install && sonar integrate <codex|claude|cursor> --project <YourProjectKey> --non-interactive
```

### Share the script with your team

The settings UI saves the script to `.conductor/settings.local.toml`, which applies only on your machine. To give your whole team the same setup script, put it in `.conductor/settings.toml` instead:

```toml
"$schema" = "https://conductor.build/schemas/settings.repo.schema.json"

[scripts]
setup = "sonar integrate <codex|claude|cursor> --project <YourProjectKey> --non-interactive"
```

Commit `.conductor/settings.toml` and merge it to your default branch. Conductor picks up shared repository settings only after they land there.

## Use the right integration

Choose the integration that matches the agent you use in Conductor:

* `sonar integrate codex --project <YourProjectKey> --non-interactive`
* `sonar integrate claude --project <YourProjectKey> --non-interactive`
* `sonar integrate cursor --project <YourProjectKey> --non-interactive`

If you use more than one agent in the same repository, add one command for each integration.

## Verify the workspace

After Conductor creates a workspace, open a terminal in that workspace and run:

```bash
sonar auth status
sonar system status
```

The status output should show the configured SonarQube connection and the installed integration features. If setup fails, confirm that the CLI is authenticated in the environment that runs the Conductor workspace. In non-interactive environments, you can authenticate with [environment variables](/sonarqube-cli/using-sonarqube-cli/environment-variables.md).

## Related pages <a href="#related-pages" id="related-pages"></a>

* [Overview](/sonarqube-cli/integrations/integrations.md)
* [OpenAI Codex](/sonarqube-cli/integrations/codex.md)
* [Git hooks](/sonarqube-cli/integrations/git-hooks.md)
* [Environment variables](/sonarqube-cli/using-sonarqube-cli/environment-variables.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cli/integrations/conductor.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
