---
title: "env pull"
description: "Write DATABASE_URL template to .env"
canonical: "https://pgbeam.com/docs/cli/projects/env/pull"
last-updated: "2026-09-14T19:37:21.000Z"
---

# env pull

> Write DATABASE_URL template to .env

URL: https://pgbeam.com/docs/cli/projects/env/pull

Write a `DATABASE_URL` connection string template to a `.env` file (or a custom file via `--file`). The URL points to the project's PgBeam proxy host. You'll need to replace `USER`, `PASS`, and `YOUR_DB` with your actual upstream database credentials. If the file already contains a `DATABASE_URL`, you'll be prompted before overwriting unless `--yes` is passed.

## Usage

## Options

Option

Description

Required

Default

`--file <value>`

Path to the output file

No

`.env`

`--yes`, `-y`

Skip the confirmation prompt if the file already contains DATABASE\_URL

No

`false`

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 confirming the file was written and reminds you to replace the placeholder credentials (USER, PASS, YOUR\_DB).