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

# Run transfers on your own machine

> Start a transfer from the Dataerai web app and have it run on your own computer or into your own bucket, under your account — using the dataerai agent.

Normally a download runs in your browser tab. The **agent** lets you start a
transfer from the web app and have it run on **your own machine** instead — so
it keeps going after you close the tab, can deliver straight into a directory on
that machine or an **external S3 bucket you control**, and uses parallel
transfers for large data. The agent acts as **you** (it signs in with your
Dataerai account), so it can only move data you already have access to.

<Note>
  This feature is gated. If you don't see **Run on my client** in an asset's
  action menu, it isn't enabled for your environment yet.
</Note>

## 1. Register your computer

Use the Dataerai desktop app when you want web-routed transfers to browse or
write local folders on your computer:

1. Open the Dataerai desktop app and sign in.
2. Open **Local access**.
3. Click **Register computer**.

Registration adds this computer to your account and starts the local agent. A
newly registered computer has **no local folder access**. The web app cannot
browse or deliver to any local folder until you add one.

## 2. Add local folder access

In **Local access**, choose a folder and grant only the access you need:

* **Read** lets the web app browse files and subfolders under that folder.
* **Write** lets the web app deliver transfers into that folder or a subfolder.
* **Read/write** lets the web app browse the folder and deliver transfers there.

You can remove a folder grant or change its **Read** and **Write** switches at
any time. The web app only lists read-enabled folder grants. If a grant has
**Write** but not **Read**, you can still type a destination path inside that
folder, but the browser cannot show its contents.

## 3. Sign in and start the CLI agent

The agent ships in the same `dataerai` CLI ([sign in first](/cli/authenticate)):

```bash theme={null}
dataerai auth login          # the agent runs as this user
dataerai agent               # registers this machine and waits for work
```

`dataerai agent` registers this machine as a **client endpoint** (named after
your hostname by default) and polls for transfers you route to it. Leave it
running; stop it with `Ctrl-C`.

| Flag       | Description                                                               |
| ---------- | ------------------------------------------------------------------------- |
| `--name`   | Endpoint name shown in the web picker (default: this machine's hostname). |
| `--server` | Backend URL (defaults to the one stored at login).                        |
| `--poll`   | How often to check for work, e.g. `5s` (default).                         |
| `--once`   | Claim and run a single transfer, then exit (handy for scripts/CI).        |

If you use the desktop app registration flow, you do not need this command for
normal desktop transfers; the desktop app starts the local agent after
registration. The CLI command is useful for servers, scripts, CI, and machines
where you do not run the desktop app.

## 4. Route a transfer from the web app

In the web app, select an asset and choose **Run on my client** from its action
menu. This opens the **Run on my client endpoint** dialog, where you pick:

1. **Which endpoint** — one of your running agents (offline ones are greyed out).
2. **Where to deliver:**
   * **Local directory** — a path inside a write-enabled folder grant on the
     agent's machine.
   * **External bucket** — an S3-compatible `endpoint` + `bucket` (+ optional
     `prefix`) you control.

Submit, and the transfer appears in the [**Transfer tracker**](/data/transfers).
Its status moves `Pending → Claimed → In progress → Completed` as your agent
picks it up and runs it; the tracker shows which endpoint is handling it.

## Delivering to an external bucket

For an **external bucket** destination, the agent writes with **your own**
credentials — Dataerai never receives them. Set the standard AWS variables in
the agent's environment before starting it:

```bash theme={null}
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_SESSION_TOKEN=...        # if your creds are temporary
dataerai agent
```

## How it stays your data

* The agent signs in as you; it can only transfer content your account can read.
* Local folders start with no access, and each folder grant is an explicit
  read, write, or read/write opt-in.
* The web app can browse only read-enabled folder grants and can deliver only
  inside write-enabled folder grants.
* Source credentials are short-lived and issued per transfer.
* If the agent stops mid-transfer, the job is automatically returned to the
  queue and your agent re-claims it when it comes back.

## Drive it from a script or notebook (SDK)

The Python and Node SDKs can launch the agent for you — useful in a notebook or
a CI job that should pull one routed transfer and exit:

```python theme={null}
from dataerai import run_agent

# Claim and run a single routed transfer, then return its exit code.
run_agent(binary_path="/usr/local/bin/dataerai", once=True)
```

```ts theme={null}
import { runAgent } from "@dataerai/sdk"

await runAgent({ binaryPath: "/usr/local/bin/dataerai", once: true })
```
