---
schema_version: "1"
id: 310e753108cbd1a52ae559768cc7c6ceca5ad2d6de9bdf70d713a74c52f77ae1
title: agent adl upload
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/agent/cli_reference_agent_adl_upload.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_agent_adl_upload.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1489bf2b9cc7ae76cf9984174df9b9c4fb5de776448aed79c7515e9ec9683cf0
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# agent adl upload

Upload a file to an SFDRIVE Agentforce Data Library.

## Description for agent adl upload

Performs the multi-step upload workflow: checks upload readiness, obtains a pre-signed S3 URL, uploads the file, triggers indexing, and optionally polls until the library is ready (retrieverId is populated).

Upload triggers the full Data Cloud provisioning pipeline, creating all downstream assets (DLO, DMO, SearchIndex, Retriever). Use `sf agent adl status` to monitor progress. For adding files to an already-provisioned library, use `sf agent adl file add` instead.

This command only works with SFDRIVE libraries. KNOWLEDGE libraries index automatically after creation, and RETRIEVER libraries require no file upload.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;file</code> | <code>&#8209;f</code> | **Type:** Value<br>**Required**<br><br>Path to the file to upload. |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;library&#8209;id</code> | <code>&#8209;i</code> | **Type:** Value<br>**Required**<br><br>Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD). |
| <code>&#8209;&#8209;target&#8209;org</code> | <code>&#8209;o</code> | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |
| <code>&#8209;&#8209;wait</code> | <code>&#8209;w</code> | **Type:** Value<br><br>Number of minutes to wait for indexing to complete. If not specified, returns after triggering indexing. |

## Examples for agent adl upload

Upload a file and wait for indexing to complete:

```shell
sf agent adl upload --library-id 1JDSG000007IbWX4A0 --file ./docs/guide.pdf --target-org myOrg --wait 10
```

Upload a file without waiting:

```shell
sf agent adl upload --library-id 1JDSG000007IbWX4A0 --file ./docs/guide.pdf --target-org myOrg
```
<!-- prettier-ignore-end -->
