# build_detect_script

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/local_context/build_detect_script)

Concatenate all section functions into the full detection script.

Independent sections run as parallel background jobs writing to temp
files, then results are concatenated in the original display order.
The header (CWD / IN_GIT) and project section (sets ROOT) run first
because later sections depend on their variables.

## Signature

```python
build_detect_script() -> str
```

## Returns

`str`

Complete bash heredoc ready for `backend.execute()`.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/3bcc51a95da80094cfc8bc4bcaf25dc1e2ad8f44/libs/cli/deepagents_cli/local_context.py#L361)