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

# Send Files and Directories with Hayate

> Use hayate send to transfer files and directories to any Hayate receiver on your LAN using Pairing Mode or a direct IP:port connection.

Hayate gives you two ways to send files: **Pairing Mode**, where peers find each other automatically on your LAN using a shared code phrase, and **Direct Mode**, where you dial a receiver by its IP address and port. Both modes encrypt every byte in transit using X25519 key agreement and hardware-accelerated AEAD — no configuration required.

## Basic File Transfer

In Pairing Mode, share a code phrase with the person running `hayate receive` and Hayate handles the rest. In Direct Mode, supply the receiver's `ip:port` as a positional argument.

```bash theme={null}
# Pairing mode (auto-discovery)
hayate send ./document.pdf --code "cherry-blossom-spring"

# Direct mode (known IP)
hayate send ./document.pdf 192.168.1.50:50001
```

## Auto-Generating a Code

If you omit `--code` and don't specify a target address, Hayate generates a random 4-word phrase and prints it to your terminal. Share that phrase with the receiver — both sides derive the session key from it.

```bash theme={null}
hayate send ./photos.zip
# Output: ● Code: apple-bravo-charlie-delta
# Share this code with the receiver
```

The sender waits, listening via mDNS and UDP broadcast, until a receiver claiming the same code connects.

## Choosing an Integrity Algorithm

Use the `--hash` flag to select the algorithm Hayate uses to verify the transfer end-to-end.

* `blake3` *(default)* — fastest option; cryptographically secure and parallelised
* `sha256` — widely recognised standard; useful when you need the checksum to be verifiable by external tools

```bash theme={null}
hayate send ./dataset.csv 192.168.1.50:50001 --hash sha256
```

The chosen algorithm is announced during the handshake; the receiver uses the same algorithm automatically. The checksum is printed in the transfer summary on both sides when the transfer completes.

## Compression Control

Zstd compression is enabled by default (`-z` / `--compress`). Hayate applies it at level 1 — fast enough that it rarely becomes the bottleneck on a LAN. Turn it off when your files are already compressed (ZIP, MP4, JPEG, and similar formats) to avoid wasting CPU cycles.

```bash theme={null}
hayate send ./backup.zip 192.168.1.50:50001 --compress=false
```

<Note>
  Hayate's Zstd compression applies to the raw byte stream, so passing `--compress=false` for already-compressed archives avoids double-compression overhead without any loss of transfer reliability.
</Note>

## Progress Bar

A live progress bar is shown by default while a transfer is running. Use `--no-progress` to suppress it — helpful when piping output, running in a headless environment, or using a terminal emulator that doesn't handle Unicode block characters cleanly.

```bash theme={null}
hayate send ./report.pdf 192.168.1.50:50001 --no-progress
```

## Sending to a Custom Port

Specify any port in the target address. The receiver must be listening on that same port.

```bash theme={null}
hayate send ./file.tar.gz 192.168.1.50:9000
```

## Sending to a Specific Address

You can combine a custom IP and port freely. Hayate resolves hostnames too, so `laptop.local:50001` works wherever your system can resolve `.local` names.

```bash theme={null}
hayate send ./slides.pdf laptop.local:50001
```

<Tip>
  `hayate send` can also be invoked as `hayate tx` — a shorter alias that's handy when you're typing quickly.

  ```bash theme={null}
  hayate tx ./slides.pdf laptop.local:50001
  ```
</Tip>

<Tip>
  Run `hayate discover` before sending if you don't know the receiver's IP address. It scans every detected subnet and streams results live, showing each active Hayate receiver's address and operating system.

  ```bash theme={null}
  hayate discover
  ```
</Tip>

<CardGroup cols={1}>
  <Card title="Receive Files" icon="download" href="/guides/receive-files">
    Set up a receiver on the destination device to accept incoming transfers.
  </Card>
</CardGroup>
