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

# store.deleteRepo()

> Permanently delete a repository and all its contents.

> [!WARNING]
>
> This page documents the earlier Code Storage SDKs: `@pierre/storage`, `pierre-storage`, and
> `code-storage-go`. New code uses the [Pierre SDK](https://code.storage/docs/sdks.md). To move code to the new SDK, use the
> [`pierre-migrate`
> skill](https://github.com/pierrecomputer/skills/tree/main/skills/pierre-migrate).

```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
// Delete a repository
const result = await store.deleteRepo({
  id: 'team/project-alpha',
});

console.log(result.message);
// "Repository team/project-alpha deletion initiated. Physical storage cleanup will complete asynchronously."

// Handle deletion errors
try {
  await store.deleteRepo({ id: 'non-existent-repo' });
} catch (error) {
  if (error instanceof ApiError) {
    console.error('Delete failed:', error.message);
    if (error.statusCode === 404) {
      console.log('Repository not found or already deleted');
    } else if (error.statusCode === 403) {
      console.log('Missing repo:write permission');
    }
  }
}
```

```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
# Delete a repository
result = await storage.delete_repo(
    id="team/project-alpha"
)

print(result.message)
# "Repository team/project-alpha deletion initiated. Physical storage cleanup will complete asynchronously."

# Handle deletion errors
try:
    await storage.delete_repo(id="non-existent-repo")
except ApiError as error:
    print(f"Delete failed: {error.message}")
    if error.status_code == 404:
        print("Repository not found or already deleted")
    elif error.status_code == 403:
        print("Missing repo:write permission")
```

```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
// Delete a repository
result, err := client.DeleteRepo(context.Background(), storage.DeleteRepoOptions{
	ID: "team/project-alpha",
})
fmt.Println(result.Message)

_, err = client.DeleteRepo(context.Background(), storage.DeleteRepoOptions{ID: "non-existent-repo"})
if err != nil {
	var apiErr *storage.APIError
	if errors.As(err, &apiErr) {
		fmt.Printf("Delete failed: %s", apiErr.Message)
		if apiErr.Status == 404 {
			fmt.Println("Repository not found or already deleted")
		} else if apiErr.Status == 403 {
			fmt.Println("Missing repo:write permission")
		}
	} else {
		fmt.Println(err)
	}
}
```

## Options

**id** `string` *required*

Repository ID to delete

## Response

**repoId** `string`

The ID of the deleted repository

**message** `string`

Confirmation message about the deletion

## Important Notes

* Repository deletion is **permanent and irreversible**
* All branches, commits, and files are permanently removed


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.