# Local Link And Sync

Run link from the local folder that contains the user's recorded media:

```sh
slate link
```

If the user says something like "I plugged in my SD card; edit my Slate video" and does not give a folder, first orient yourself:

```sh
pwd
ls
ls /Volumes
find /Volumes -maxdepth 3 -type f \( -iname '*.mov' -o -iname '*.mp4' -o -iname '*.m4v' \) 2>/dev/null | head -50
slate projects list --json
```

Choose the obvious media folder and Slate project when there is only one plausible match. If several folders or projects are plausible, ask the user one short question to choose between them.

For non-interactive agents:

```sh
slate link --project-id <project-id> --yes --json
```

Slate writes `.slate/link.json`, which binds the folder to the project. After that, commands can usually infer `projectId` and the local media root from the current folder.

The agent should run these commands directly after auth. Do not ask the user to learn CLI flags.

## Upload Recorded Media

After recording:

```sh
slate sync media --proxy --yes --wait --json
```

This uploads every media file in the folder to Slate Cloud, into the linked project. Each take's sound goes up ahead of the file, so Slate has its words while the original is still uploading; Slate then prepares and analyses each file. `--wait` waits until every uploaded file is analysed. A file Slate already has is reported under `alreadyInLibrary` with its clip id and is not uploaded again.

Suggest `--proxy` when the user is preparing a local Slate edit from recorded video, especially for large or high-resolution footage, or when a previous edit loop felt slow. Proxies are local cache files for Slate `probe` and `render`; they are not uploaded, do not affect server analysis, and are not used for FCP/Premiere handoff.

An interrupted upload resumes with `slate media resume <upload-id>`; `slate media uploads --json` lists the ones still on their way.

Useful inspection commands:

```sh
slate status --local --json
slate clips list --processing-phase completed --limit 100 --json
slate clips search "hands typing at laptop" --type b_roll --limit 10 --json
```

After media analysis, verify clip categorization before building A-roll:

```sh
slate clips list --processing-phase completed --limit 100 --json
slate clips set-type <clip-id> a_roll --yes --json
slate clips set-type <clip-id> b_roll --yes --json
```

Only recategorize when the analyzed metadata clearly disagrees with the user's footage: A-roll should be primary narration/talking-head material; B-roll should be supplemental visuals.

If the reconciled script uses clips from outside this project, materialize them before edit hydration:

```sh
slate sync b-roll --mode reference --yes --json
slate sync b-roll --mode download --yes --json
```

Ask the user before the download step because it may copy real media files into `External Media`.
