# AddSquad

- Module: [CommunityToolkit.Aspire.Hosting.Squad](/reference/api/go/communitytoolkit.aspire.hosting.squad.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

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

```go
func (DistributedApplicationBuilder) AddSquad(
    name string,
    options ...*AddSquadOptions,
) SquadResource
```

## Parameters

- `name` (`string`) -- The Aspire resource name.
- `options` (`...*AddSquadOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddSquadOptions` argument.

- `TeamRoot` (`*string`) -- Absolute path to the workspace root - the directory that contains the `.squad/` folder. Defaults to `GetCurrentDirectory` when not specified.

## Returns

[`SquadResource`](/reference/api/go/communitytoolkit.aspire.hosting.squad/squadresource.md) -- An `IResourceBuilder` for further configuration.

Returns a handle; failures surface later via `Err()`.

## Applies to

- `DistributedApplicationBuilder`
