> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alpic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# redeploy

> Rebuild an environment from its connected GitHub branch

Rebuild an environment from its connected GitHub branch and wait for the deployment to complete. No local files are uploaded.

> [!NOTE]
>
> Authentication is required. Run `alpic login` or set `ALPIC_API_KEY`. The project must be connected to GitHub. For
> projects without a GitHub connection, use [alpic deploy](https://docs.alpic.ai/cli/deploy.md).

## Usage

```bash theme={null}
alpic redeploy --environment-id <environmentId>
```

Rebuilds the specified environment using its current settings and connected branch. When deployment succeeds, prints the MCP endpoint (`/mcp`), playground URL (`/try`), and available dashboard link outside the summary box so each link stays intact for copying. It also prints a command to view build logs. See [alpic deploy](https://docs.alpic.ai/cli/deploy.md) for the supported MCP endpoint paths.

## Extended Usage

Redeploy the environment linked in the current directory's `.alpic` configuration:

```bash theme={null}
alpic redeploy
```

Choose an environment by name within a project:

```bash theme={null}
alpic redeploy --environment-name production --project-name my-app
```

Use a project ID instead of a project name:

```bash theme={null}
alpic redeploy --environment-name production --project-id <projectId>
```

Disable interactive prompts for CI:

```bash theme={null}
alpic redeploy --environment-id <environmentId> --non-interactive
```

If no environment is specified or linked, interactive mode prompts for a project and environment. Non-interactive mode requires an environment ID, an environment name with project context, or a linked environment.

## Options

| Flag | Description |
| - | - |
| `--environment-id` | The ID of the environment. Cannot be combined with `--environment-name`. |
| `--environment-name` | The name of the environment. Requires project context from flags or `.alpic` configuration. |
| `--project-id` | The ID of the project. Cannot be combined with `--project-name`. |
| `--project-name` | The name of the project. Cannot be combined with `--project-id`. |
| `--non-interactive` | Skip all interactive prompts. Enabled by default when output is not a terminal. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.