# addSquad

- Module: [CommunityToolkit.Aspire.Hosting.Squad](/reference/api/typescript/communitytoolkit.aspire.hosting.squad.md)
- Version: `13.5.0`
- Kind: `method`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/4ff8268fbd97ddd23cb73dc8eff9cc92718156d1)

Adds a Squad AI-agent team to the distributed application. The lifecycle hook discovers agents from `.squad/team.md` (or the default roster when the file does not exist), publishes `Spawning` to `Active` state transitions visible in the Aspire dashboard, and injects a custom `squad://` descriptor that downstream services can consume as metadata. The Squad resource is a logical dashboard/resource-graph entry; it does not start a server process by itself.

## Definition

```typescript
interface IDistributedApplicationBuilder {
  // ... omitted for brevity
  addSquad(
    name: string,
    teamRoot?: string): SquadResource
}
```

## Parameters

- `name` (`string`)
- `teamRoot` (`string`) `optional`

## Returns

[SquadResource](/reference/api/typescript/communitytoolkit.aspire.hosting.squad/squadresource.md) `builder`

## Applies to

- [IDistributedApplicationBuilder](/reference/api/typescript/communitytoolkit.aspire.hosting.squad/idistributedapplicationbuilder.md)
