# ed machines files put

> ed machines files put in the Edith ed command line reference. Uploads one file from this Mac to the machine.

- Canonical URL: https://getedith.pro/docs/cli/machines-files/put
- Updated: 2026-12-02

Uploads one file from this Mac to the machine.

```
ed machines files put <machine> <local> <remote> [--dry-run] [--replace] [--yes] [--json]
```

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `machine` | machine name, SSH alias, id or unambiguous prefix | required | Which machine to write to. |
| `local` | local file path, `~` expanded | required | The file to upload. |
| `remote` | remote file path, or a directory | required | Where to put it. |
| `--dry-run` | flag | off | Print the exact remote destination without uploading. |
| `--replace` | flag | off | Target an existing file instead of choosing a numbered name. |
| `--yes` | flag | off | Confirm replacement requested with `--replace`. |
| `--json` | flag | off | Emit JSON on stdout. |

```json
{
  "operation": "machines.files.upload-file",
  "sourceMachine": "This Mac",
  "destinationMachine": "Devbox",
  "destination": "/home/you/uploads",
  "dryRun": true,
  "executed": false,
  "requiresConfirmation": false,
  "items": [{
    "source": "/Users/you/clip.mov",
    "destination": "/home/you/uploads/clip 2.mov",
    "replacesExisting": false
  }],
  "skipped": []
}
```

```
ed machines files put devbox ./deploy.sh /tmp/deploy.sh
ed machines files put devbox ./clip.mov /home/you/uploads/
ed machines files put devbox ~/notes.md /srv/notes.md --json
```

The local file is checked before the machine is dialled, so a typo there exits 3
with `no file at /Users/you/deploy.sh` and costs nothing.

The destination takes a directory as well as a file path. A path ending in `/`
keeps the local filename; so does a path that passes a 20 second remote
file-kind probe as a directory. An existing file remains an exact file target,
including when an empty directory listing would otherwise look identical.

The directory is listed before upload. A matching name is kept by adding ` 2`,
then ` 3`, while preserving the extension. `--dry-run` prints the resolved
target. `--replace` previews an existing target and needs `--yes` to continue.

Uploads always use a unique staging path on the machine. A confirmed replacement
renames the old target to a unique backup only after the complete staged upload
succeeds. It then publishes the staged file and removes the backup. A failed
publication restores the backup, and a failed upload removes only its staging
path:

```
$ ed machines files put devbox ./clip.mov /tmp/no-such-dir/clip.mov
error: Could not read /tmp/no-such-dir on Devbox.
```

The JSON `items` plan is identical before and after execution, so automation can
verify the exact destination before confirming a replacement.

This is a single-file transfer, because a directory has nothing to pipe into
`cat`. Send a tree with `ed devbox 'tar -xzf - -C /srv'` and a local `tar` on the
other end of the pipe, or copy it within the machine with `cp`.

## Where to go next

- [`ed machines files`](https://getedith.pro/docs/cli/machines-files), the rest of this group
- [All `ed` commands](https://getedith.pro/docs/cli)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
