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

# Blueprint Lifecycle

> Manage blueprint launch parameters, deletion, and cleanup

<Tip>Start with the [Runloop Quickstart](/docs/tutorials/quickstart) to use the examples below.</Tip>

## Launch Parameters

Because Blueprints map to images that launch devboxes, they share some of the same launch parameters as devboxes. See these pages for more customizable parameters:

* [Sizes](/docs/devboxes/configuration/sizes)
* [Architecture](/docs/devboxes/configuration/devbox-architecture)
* [Bash Profile](/docs/devboxes/configuration/bash-profile-environment-setup)
* [Network Policies](/docs/network-policies)

## Deleting Blueprints

By default, Blueprints persist indefinitely and continue to incur storage costs. To optimize resource usage and costs, you can delete Blueprints that are no longer needed.

### Deleting a Single Blueprint

To delete a specific Blueprint, use its ID:

<CodeGroup>
  ```python Python theme={null}
  blueprint = await runloop.blueprint.from_id(blueprint_id)
  await blueprint.delete()
  ```

  ```typescript TypeScript theme={null}
  const blueprint = await runloop.blueprint.fromId(blueprintId);
  await blueprint.delete();
  ```
</CodeGroup>

### Cleaning Up Old Blueprint Versions

When you create multiple versions of a Blueprint with the same name, you may want to delete older versions to reduce storage costs. Here's how to keep only the latest version:

<CodeGroup>
  ```python Python theme={null}
  # Create a new blueprint
  new_blueprint = await runloop.blueprint.create(
    name="my_blueprint_name",
    launch_parameters={"launch_commands": ["sudo apt install -y jq"]}
  )

  # Get all blueprints with the same name
  blueprints = await runloop.blueprint.list(name='my_blueprint_name')

  # Delete all older blueprints, keeping only the newest one
  for blueprint in blueprints:
    if blueprint.id != new_blueprint.id:
      await blueprint.delete()

  ```

  ```typescript TypeScript theme={null}
  // Create a new blueprint
  const newBlueprint = await runloop.blueprint.create({
    name: "my_blueprint_name",
    launch_parameters: { launch_commands: ["sudo apt install -y jq"] }
  });

  // Get all blueprints with the same name
  const blueprints = await runloop.blueprint.list(name='my_blueprint_name');

  // Delete all older blueprints, keeping only the newest one
  for (const blueprint of blueprints) {
    if (blueprint.id !== newBlueprint.id) {
      await blueprint.delete();
      console.log(`Deleted old blueprint: ${blueprint.id}`);
    }
  }
  ```
</CodeGroup>

<Note>
  Be careful when deleting Blueprints, as this action cannot be undone. Ensure you're not deleting Blueprints that you may need later.
</Note>

## Managing Blueprints with the CLI

The CLI provides convenient commands for listing, deleting, and pruning blueprints:

```bash theme={null}
# List all blueprints
rli blueprint list

# Delete a specific blueprint by ID
rli blueprint delete bpt_abc123

# Prune old blueprint versions, keeping only the latest for each name
rli blueprint prune

# Prune with dry-run to see what would be deleted
rli blueprint prune --dry-run
```

<Tip>
  The `rli blueprint prune` command is particularly useful for cleaning up old versions when you frequently rebuild blueprints with the same name.
</Tip>

## Next Steps

* [Back to Blueprints Overview](/docs/devboxes/blueprints/overview) - Review blueprint basics and best practices
* [Troubleshoot blueprint builds](/docs/devboxes/configuration/troubleshooting/troubleshooting-blueprints) - Debug failed builds
* [Learn about Devbox lifecycle](/docs/devboxes/lifecycle) - Understand how Devboxes work with Blueprints
