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

# Use AWS CLI with Hivenet Object Storage

> Configure a Hivenet profile, list objects, and upload or download files with AWS CLI.

The AWS CLI can call Hivenet Object Storage through the Hivenet S3 endpoint. Use a dedicated profile so these settings do not replace an existing AWS configuration.

## What you'll need

* AWS CLI installed.
* Your Hivenet access key ID and secret access key.
* A bucket created in [Object Storage](https://docs.hivenet.com/documentation/object-storage/buckets.md).
* A small local test file, such as `hello.txt`.

For self-service storage, uploads require a positive organization credit balance. At a zero or negative balance, your organization's configuration determines whether storage becomes **Read only** or **Disabled**. Object listing and downloads remain available in **Read only** mode and are blocked in **Disabled** mode. See [When credits run out](https://docs.hivenet.com/documentation/object-storage/usage-and-billing.md#when-credits-run-out).

These commands use the profile name `hivenet`. Replace `YOUR_BUCKET` with your bucket's name.

## Configure the profile

Run:

```bash theme={null}
aws configure --profile hivenet
```

At the prompts, enter:

| Prompt | Value |
| - | - |
| AWS Access Key ID | Your Hivenet access key ID |
| AWS Secret Access Key | Your Hivenet secret access key |
| Default region name | `Europe` |
| Default output format | `json` |

Then explicitly enable path-style addressing and Signature Version 4:

```bash theme={null}
aws configure set s3.addressing_style path --profile hivenet
aws configure set s3.signature_version s3v4 --profile hivenet
```

> [!WARNING]
>
> Protect the local credentials file created by the CLI. Enter the Hivenet credential pair at the prompts; do not put real secrets in shared commands or documentation.

## Test the connection

List buckets:

```bash theme={null}
aws s3api list-buckets --profile hivenet --endpoint-url https://eu.s3.hivenet.com
```

An empty bucket list is a valid response if your organization has no buckets.

List objects in a bucket:

```bash theme={null}
aws s3 ls "s3://YOUR_BUCKET/" --profile hivenet --endpoint-url https://eu.s3.hivenet.com
```

Every command in this guide includes the Hivenet endpoint. Omitting it can send the request to AWS.

## Upload a file

Choose an object key that does not already contain data you need to keep:

```bash theme={null}
aws s3 cp "./hello.txt" "s3://YOUR_BUCKET/hello.txt" --profile hivenet --endpoint-url https://eu.s3.hivenet.com
```

Uploading to an existing key replaces that object.

The high-level `aws s3 cp` command manages multipart transfers when needed. A raw `s3api put-object` request is a single upload and has Hivenet's 5 GB single-request limit.

## Download a file

Use a new local filename to avoid replacing a file you need:

```bash theme={null}
aws s3 cp "s3://YOUR_BUCKET/hello.txt" "./hello-downloaded.txt" --profile hivenet --endpoint-url https://eu.s3.hivenet.com
```

## Download many objects

First preview a copy of the bucket into a local directory:

```bash theme={null}
aws s3 cp "s3://YOUR_BUCKET/" "./hivenet-download/" --recursive --dryrun --profile hivenet --endpoint-url https://eu.s3.hivenet.com
```

Check the source and destination, then run it without `--dryrun`:

```bash theme={null}
aws s3 cp "s3://YOUR_BUCKET/" "./hivenet-download/" --recursive --profile hivenet --endpoint-url https://eu.s3.hivenet.com
```

To copy only a prefix, use a source such as `s3://YOUR_BUCKET/reports/`.

For repeat downloads, `aws s3 sync` can transfer new or changed files. Review the [AWS sync reference](https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html) before adding filters or deletion options.

## Request reference

See [AWS CLI S3 configuration](https://docs.aws.amazon.com/cli/latest/topic/s3-config.html) and the [copy command reference](https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html) for client syntax. Use only the operations covered by [Hivenet S3 compatibility](https://docs.hivenet.com/documentation/object-storage/s3-compatibility.md).

For connection failures, see [Troubleshooting](https://docs.hivenet.com/documentation/object-storage/troubleshooting.md).


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