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

# outerbounds flowproject teardown-branch

export const GCell = ({children, className}) => <div className={`grid-table-cell ${className || ""}`} role="cell">
    {children}
  </div>;

export const GTH = ({children, className}) => <div className={`grid-table-th ${className || ""}`} role="columnheader">
    {children}
  </div>;

export const GRow = ({children}) => <div className="grid-table-row" role="row">{children}</div>;

export const GBody = ({children}) => <div className="grid-table-body" role="rowgroup">{children}</div>;

export const GHead = ({children}) => <div className="grid-table-head" role="rowgroup">{children}</div>;

export const GTable = ({children, className, cols}) => <div className={`grid-table not-prose overflow-hidden rounded-2xl ${className || ""}`} style={{
  "--grid-table-cols": cols
}} role="table">
    {children}
  </div>;

The `teardown-branch` subcommand deletes all deployed resources for a project branch in a single operation. Use it to clean up after a merged or abandoned feature branch. For the full lifecycle workflow, including promoting assets before teardown, see [Project lifecycle](/docs/platform/guides/projects/project-lifecycle#tearing-down-a-branch).

## Usage

```sh theme={null}
outerbounds flowproject teardown-branch --id <PROJECT/BRANCH> [OPTIONS]
```

## Options

<GTable cols="25% 75%">
  <GHead>
    <GRow>
      <GTH>Option</GTH>
      <GTH>Description</GTH>
    </GRow>
  </GHead>

  <GBody>
    <GRow>
      <GCell>`--id <PROJECT/BRANCH>`</GCell>
      <GCell>Required. The project and branch identifier, such as `fraud_detection/feature-v2`.</GCell>
    </GRow>

    <GRow>
      <GCell>`--dry-run`</GCell>
      <GCell>Discover and list resources without deleting anything.</GCell>
    </GRow>

    <GRow>
      <GCell>`--yes`</GCell>
      <GCell>Skip the confirmation prompt.</GCell>
    </GRow>

    <GRow>
      <GCell>`--output <FORMAT>`</GCell>
      <GCell>Output format: `json` or human-readable. Defaults to human-readable.</GCell>
    </GRow>
  </GBody>
</GTable>

Teardown discovers and deletes these resource types in order:

1. **Workflow templates**: Argo templates matching the project and branch annotations. Deleting a template cascades to its associated CronWorkflows and Sensors.
2. **Data assets**, as listed in the flowproject metadata.
3. **Model assets**, as listed in the flowproject metadata.
4. **Apps**: capsules tagged with the project and branch.
5. **Flowproject metadata**: the metadata record itself.

## Examples

Preview what would be deleted:

```sh theme={null}
outerbounds flowproject teardown-branch --id fraud_detection/feature-v2 --dry-run
```

Execute the teardown:

```sh theme={null}
outerbounds flowproject teardown-branch --id fraud_detection/feature-v2 --yes
```

Produce JSON output for scripting:

```sh theme={null}
outerbounds flowproject teardown-branch --id fraud_detection/feature-v2 --yes --output json
```

<Warning>
  Teardown deletes asset metadata, not the underlying data. To keep assets from a feature branch, promote them with `promote_assets` before tearing down, as described in [Project lifecycle](/docs/platform/guides/projects/project-lifecycle#promoting-assets-before-teardown).
</Warning>
