# Storage

A storage bucket holds files for your apps. Each bucket has its own S3-compatible credentials, which an S3 client library uses to read and write files.

## Create a bucket

```
astris storage create --name <name>
```

The command prints the bucket id, the name, the endpoint, the bucket, the access key id and the secret key. The secret key is printed on this command only, so save it now.

An account can have 50 buckets. Over that, the API refuses with [bucket_limit](/docs/errors/bucket_limit).

## Read buckets

```
astris storage list
astris storage show --id <id>
```

`show` never prints the secret key.

## Issue a new key

```
astris storage rotate --id <id>
```

The old key stops working and a new one is issued. The new secret key is printed on this command only, so save it now.

## Delete a bucket

```
astris storage delete --id <id> --yes
```

Without `--yes`, the command sends nothing. A bucket that still holds objects is refused with `That bucket is not empty. Remove its objects, then try again.` When the bucket is empty, the command prints `Bucket removed.`

## With the Astris MCP

The MCP tool `storage` takes the action `create`, `list`, `show`, `rotate` or `delete`. The secret key appears only when you create a bucket or issue a new key. Save it when it appears.
