---
title: "Object Store"
description: "Learn how to use Object Store in Lean CLI."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/object-store
markdown: https://www.quantconnect.com/docs/v2/lean-cli/object-store.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/12%20Object%20Store
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Object Store

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Lean CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) > Object Store

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

The Object Store is an organization-specific key-value storage location to save and retrieve data. Similar to a dictionary or hash table, a key-value store is a storage system that saves and retrieves objects by using keys. A key is a unique string that is associated with a single record in the key-value store and a value is an object being stored. Some common use cases of the Object Store include the following:

- Transporting data between the backtesting environment and the research environment.
- Training machine learning models in the research environment before deploying them to live trading.

The Object Store is shared across the entire organization. Using the same key, you can access data across all projects in an organization.

To use the CLI, you must be a member in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md) on a paid tier.

## Local Storage

To add files to your Object Store, add them to the `storage` directory of your [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) or call the [Save methods](https://www.quantconnect.com/docs/v2/writing-algorithms/object-store.md#04-Save-Data) in your algorithm.

To view the contents of the Object Store, run `lean object-store ls`.

```
$ lean object-store ls
```

This command opens File Explorer to show the `storage` directory. You can delete and rename files in the Object Store directly from the File Explorer. To edit files, open them in a text editor.

## Cloud Storage

The CLI enables you to upload files to the Object Store, view a summary of your stored files, and delete files.

### Upload Files

To upload files to the Object Store, run `lean cloud object-store set <storage-key> <local-file-path>`.

```
$ lean cloud object-store set 15737956/signals D:\qc\magic-signals.txt
Setting object 15737956/signals in organization d6d62db48592c72e67b534553413b691
```

If the file fails to upload, you may have insufficient [storage space](https://www.quantconnect.com/docs/v2/cloud-platform/object-store.md#05-Storage-Sizes). If you need more, [edit your storage plan](https://www.quantconnect.com/docs/v2/cloud-platform/object-store.md#07-Edit-Storage-Plan).

### List Directory Contents

To view all of the files and folders in the root directory of the Object Store, run `lean cloud object-store ls`.

```
$ lean cloud object-store ls
Key              Bytes  Folder  Filename
/15710069        None   True    15710069
/15727540        None   True    15727540
/15727540-1      None   True    15727540-1
/15730221        89649  False   15730221
/15730422        89748  False   15730422
```

To view all of the files and folders that are inside of one of the directories, run `lean cloud object-store ls <folder-name>`.

```
$ lean cloud object-store ls 15710069
Key                Bytes  Folder  Filename
15710069/adjusted  60024  False   adjusted
15710069/raw       60143  False   raw
```

### Get File Metadata

To view the metadata of a file in the Object Store, run `lean cloud object-store properties <path/to/file>`.

```
$ lean cloud object-store properties 15710069/adjusted
Bytes  Modified             Filename           Preview
60024  2023-08-30 23:08:23  15710069/adjusted  {"12723264
```

### Delete Content

To delete a file or directory in the Object Storage, run `lean cloud object-store delete <key>`.

```
$ lean cloud object-store delete 15710069/adjusted
```

## Download Files

Downloading files from the Object Store is only available to [Institution](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md#06-Institution-Tier) tier organizations that have signed QuantConnect's derived data agreement. It is not available on the Free, Quant Researcher, Team, or Trading Firm tiers, and [adding storage](https://www.quantconnect.com/docs/v2/cloud-platform/object-store.md#07-Edit-Storage-Plan) doesn't change that.

The restriction applies to every file in the Object Store, including files you upload and files your algorithms generate. Section 2.6 of our [Terms of Service](https://www.quantconnect.com/terms) treats all Object Store contents as QuantConnect data. The platform can't distinguish your own files from data derived from licensed datasets, so there is no per-file or per-organization exception. Keeping the data in the cloud is what lets QuantConnect offer licensed data at a fraction of its direct cost. Even permissioned organizations can only download derived data such as machine learning models and signal files. Raw price and alternative data can never be downloaded.

If your organization isn't permissioned, the **Download** action on the Object Store page is unavailable, and the [API](https://www.quantconnect.com/docs/v2/cloud-platform/api-reference/object-store-management/get-object-store-file.md) and [CLI](https://www.quantconnect.com/docs/v2/lean-cli/object-store.md#04-Download-Files) return `Organization does not have derivative export enabled`. Use the data in the cloud instead:

- Read the file in the [Research Environment](https://www.quantconnect.com/docs/v2/research-environment/object-store.md#05-Read-Data) or in a [backtest](https://www.quantconnect.com/docs/v2/writing-algorithms/object-store.md#05-Read-Data) and do the analysis there. For a full walkthrough, see [Example for Logging](https://www.quantconnect.com/docs/v2/writing-algorithms/object-store.md#13-Example-for-Logging).
- For values a backtest produces, plot them and use [Download Results](https://www.quantconnect.com/docs/v2/cloud-platform/backtesting/results.md#17-Download-Results), or log them within your [log quota](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/resources.md#09-Log-Quotas).
- Project source files don't need the Object Store. Pull them with [lean cloud pull](https://www.quantconnect.com/docs/v2/lean-cli/projects/cloud-synchronization.md#02-Pulling-Cloud-Projects).

If you represent a fund or company and are interested in the Institution tier but unsure if it's right for you, [contact us](https://www.quantconnect.com/appointments) to schedule a demo with QuantConnect to learn more.

To download a file or directory from the Object Store, run `lean cloud object-store get <key>`.

```
$ lean cloud object-store get 15710069/adjusted
Fetching object store download url
Unzipping object store keys values into: <Current Directory>
```

## Bulk File Upload

To upload all files from a directory to the Object Store, run the following Python script:

```python
from os import listdir, path
from subprocess import run
SRC = ""   # Source directory
DST = ""   # Destination directory (empty is root)
if __name__ == '__main__':

    command = [ "lean", "cloud", "object-store", "set" ]

    for key in listdir(SRC):
        fullname = path.join(SRC, key)
        if not path.isfile(fullname):
            continue
        key = DST + '/' + key
        args = [key, fullname]
        print(' '.join(command + args))
        run(command + args)
```

## Live Trading Considerations

When you deploy a live algorithm, you can access the data within minutes of modifying the Object Store. Ensure your algorithm is able to handle a changing dataset.

## Special Folders

Your organization's Object Store includes a reserved `.assistant` folder that the [QuantConnect AI agents](https://www.quantconnect.com/docs/v2/ai-assistance/agents.md) read. It holds the custom [skills](https://www.quantconnect.com/docs/v2/ai-assistance/agents.md#14-Custom-Skills), [memories](https://www.quantconnect.com/docs/v2/ai-assistance/agents.md#15-Custom-Memories), and [templates](https://www.quantconnect.com/docs/v2/ai-assistance/agents.md#16-Custom-Templates) that let the agents apply your own expertise, remember each project's context, and start new projects from your own scaffolds.

The `.assistant` folder contains the following subfolders:

| Subfolder | Purpose |
| --- | --- |
| `skills` | Reusable instructions and conventions the agents apply. |
| `memories` | Facts the agents remember about each project, in one `<project_id> / memory.md` file per project. |
| `templates` | Your own project scaffolds for the agents to initialize for new projects. |

These files are shared across your organization. To add or update them, see [Cloud Storage](https://www.quantconnect.com/docs/v2/lean-cli/object-store.md#03-Cloud-Storage).
