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

# link

> Link the current directory to an Alpic project

Associate the current directory with an existing or new Alpic project. Once linked, commands like `deploy` and `git connect` operate on the linked project without requiring additional flags.

## Usage

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

Interactively links the current directory to an Alpic project. Prompts for project selection or creation if not already linked.

## Extended Usage

Skip all prompts (useful in CI):

```bash theme={null}
alpic link --non-interactive --project-name my-app --runtime node24
```

Link to an existing project by ID:

```bash theme={null}
alpic link --project-id <projectId>
```

Create a new project whose app lives in a monorepo subdirectory (path is relative to the directory where you run the command):

```bash theme={null}
alpic link --project-name my-app --root-dir ./packages/my-mcp-server
```

When linking interactively, **Root directory** defaults to `.` (repository root). Alpic stores this path on the project so builds and deployments run from that folder inside the connected repository.

## Options

| Flag                | Description                                                                                                               |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `--non-interactive` | Skip all confirmation prompts                                                                                             |
| `--team-id`         | Team ID to use                                                                                                            |
| `--project-id`      | Link to this existing project ID                                                                                          |
| `--environment-id`  | Use this environment ID                                                                                                   |
| `--project-name`    | New project name                                                                                                          |
| `--runtime`         | Runtime to use: `node24`, `node22`, `python3.14`, `python3.13`                                                            |
| `--root-dir`        | Relative path to the app root for builds and deployments; only when **creating** a new project (omit for repository root) |
| `--env-file`        | Path to a `.env` file to source environment variables from (new projects only)                                            |

<Note>Authentication is required. Run `alpic login` or set `ALPIC_API_KEY` before linking.</Note>

<Tip>
  If the current directory is a git repository, `link` will offer to connect the project to a GitHub remote after
  linking.
</Tip>
