How to delete a Bitbucket project with Bitbucket Command Line Interface (CLI)

This article explains how to delete a Bitbucket project using Bitbucket Command Line Interface (CLI).


An empty project with no repositories can be deleted directly with the deleteProject action.

Refer to the following sample action command to delete a project, test, as an example:

--action deleteProject --project "test"

In this CLI action:

  • --project value refers to the project key, name, or ID. 

If a project contains repositories, it cannot be deleted. CLI throws the following error: Remote error: The project "project_name" cannot be deleted because it has repositories. 

Refer to the How to delete a Bitbucket repository using Command Line Interface article to know how to delete all the repositories in the project.

It is recommended to test this scenario in a non-production environment, or run the action with the --simulate parameter to verify the behavior before deploying.