Technology1 min read

Vercel CLI can now set new projects to expire

By · Published by Everything Blog

In short

The feature was introduced to eliminate manual cleanup for temporary applications, prototypes, and testing environments. Users configure the self-deletion window during the initial deployment command by applying a dedicated flag with a supported duration. Once scheduled, the terminal prints the exact date and time the deletion will occur, though developers can still cancel the scheduled removal at any point using a specific CLI command.

Key points

  • Developers must supply the delete-project-after flag during initial project creation beca…: Developers must supply the delete-project-after flag during initial project creation because it cannot be added later.
  • Scheduled project expirations can be permanently canceled prior to deletion by running th…: Scheduled project expirations can be permanently canceled prior to deletion by running the vercel project keep command.
  • The command-line interface provides immediate confirmation by displaying the precise date…: The command-line interface provides immediate confirmation by displaying the precise date and time of the impending deletion.

Sources checked by our analysis pipeline: 1

You can now set a new project to expire when you deploy it with Vercel CLI. Expired projects are deleted automatically, so prototypes, demos, and test apps don't need cleaning up by hand.

Run vercel deploy

with --delete-project-after

and a duration:

# Delete the new project after one dayvercel deploy --delete-project-after 1d

Deploying a new project that expires after one day

Supported durations are 1h

, 1d

, 1w

, 2w

, and 30d

, and the CLI prints the date and time when the project expires. The flag only applies when vercel deploy

creates the project. If you deploy to an existing project with the flag, its expiration doesn't change and the CLI prints a warning.

To remove a project's expiration, run vercel project keep

:

vercel project keep my-project

Removing a project's expiration

Update Vercel CLI to v65.12.0

or later to get started. Learn more in the vercel deploy documentation.

Technology