---
title: "link"
description: "Link current directory to a PgBeam project"
canonical: "https://pgbeam.com/docs/cli/projects/link"
last-updated: "2026-09-14T19:37:21.000Z"
---

# link

> Link current directory to a PgBeam project

URL: https://pgbeam.com/docs/cli/projects/link

Link the current working directory to a PgBeam project by creating a `.pgbeam` configuration file. This saves the project ID so subsequent commands (like `pgbeam db list` or `pgbeam projects inspect`) automatically use the linked project without requiring `--project`. An interactive selector is shown to choose from your organization's projects.

## Usage

All global options (`--token`, `--profile`,
`--project`, `--org`, `--json`, `--no-color`, `--no-trunc`, `--debug`) are
also available on this command.

## Examples

## Output

Prints a success message with the linked project ID and suggests `pgbeam db list` as a next step. A `.pgbeam` file is created in the current directory.