# aspire restore command

## Name

`aspire restore` - Restore dependencies and generate SDK code for an apphost.

## Synopsis

```bash title="Aspire CLI"
aspire restore [options]
```

## Description

The `aspire restore` command restores the AppHost and generates the SDK code that Aspire uses for resources, integrations, and tooling. Use it when you want to make restore an explicit step in automation or validate that the AppHost can restore cleanly without starting it.

For TypeScript AppHosts, restore reads the `packages` section in `aspire.config.json`, restores those hosting integration packages, and regenerates the `.aspire/modules/` TypeScript SDK imported by `apphost.mts`. This is useful after running `aspire add`, switching branches, updating pinned package versions, or restoring dependencies in CI before `aspire run`, `aspire publish`, or deployment workflows.

<Include relativePath="reference/cli/includes/project-search-logic-description.md" />

This command is useful in CI/CD pipelines, after adding or updating integrations, or before running build, publish, and deployment workflows.

## Options

The following options are available:

- <Include relativePath="reference/cli/includes/option-project.md" />

- <Include relativePath="reference/cli/includes/option-help.md" />

- <Include relativePath="reference/cli/includes/option-log-level.md" />

- <Include relativePath="reference/cli/includes/option-non-interactive.md" />

- <Include relativePath="reference/cli/includes/option-nologo.md" />

- <Include relativePath="reference/cli/includes/option-banner.md" />

- <Include relativePath="reference/cli/includes/option-wait.md" />

## Examples

- Restore the AppHost discovered from the current directory:

  ```bash title="Aspire CLI"
  aspire restore
  ```

- Restore a specific AppHost project:

  ```bash title="Aspire CLI"
  aspire restore --apphost './src/MyApp.AppHost/MyApp.AppHost.csproj'
  ```

- Restore a specific TypeScript AppHost and regenerate `.aspire/modules/`:

  ```bash title="Aspire CLI"
  aspire restore --apphost './apphost.mts'
  ```

## See also

- [aspire run](../aspire-run/)
- [aspire start](../aspire-start/)
- [aspire publish](../aspire-publish/)