> ## 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.

# hayate send — Transfer Files and Directories Securely

> hayate send transfers a file or directory to a Hayate receiver. Key flags: --code for Pairing Mode, --hash for integrity, --compress to toggle Zstd.

`hayate send` transmits a file or directory from your machine to an active Hayate receiver over an encrypted QUIC connection. You can reach the receiver in two ways: **Pairing Mode**, where both sides share a short code phrase and find each other automatically on the LAN using mDNS and UDP broadcast, or **Direct Mode**, where you supply the receiver's IP address and port. Either way, your data is encrypted with X25519 + AEAD before a single byte leaves your machine.

## Usage

```
hayate send [OPTIONS] <PATH> [TARGET]
```

**Alias:** `hayate tx`

## Positional arguments

<ParamField path="PATH" type="string" required>
  Path to the local file or directory you want to send. Directories are streamed
  as a compressed, encrypted tar archive and reconstructed safely on the
  receiver's end.
</ParamField>

<ParamField path="TARGET" type="string">
  Receiver address in the form `ip:port` or `hostname:port` (e.g.
  `192.168.1.50:50001`). Use this for Direct Mode when you already know the
  receiver's address. Mutually exclusive with `--code`.
</ParamField>

## Options

<ParamField query="--code" type="string">
  Pairing code phrase for LAN discovery. When you supply a phrase (e.g.
  `"alpha-bravo-charlie-delta"`), Hayate broadcasts it via mDNS and UDP so a
  receiver running `hayate receive --code <same-phrase>` can locate you
  automatically — no IP address required. If you omit both `--code` and
  `TARGET`, Hayate auto-generates a 4-word phrase and prints it to your
  terminal.
</ParamField>

<ParamField query="--peer" type="string">
  Equivalent to the positional `TARGET` argument. Specify the receiver address
  as `ip:port` or `hostname:port`. Useful when you prefer named flags over
  positional arguments.
</ParamField>

<ParamField query="-z, --compress" type="boolean" default="true">
  Enable or disable Zstd level-1 compression on the data stream before
  encrypting. Compression is on by default and works well for text files, source
  code, and other compressible data. Pass `--compress=false` for files that are
  already compressed (`.zip`, `.mp4`, `.jpg`, etc.) to avoid wasting CPU cycles.
</ParamField>

<ParamField query="--hash" type="string" default="blake3">
  Integrity algorithm used to verify the transfer end-to-end. Accepted values:

  * `blake3` *(default)* — cryptographic hash, extremely fast on modern CPUs
  * `sha256` — industry-standard SHA-2, useful when the receiver needs to cross-check with external tooling

  The computed checksum is printed in the summary after the transfer completes.
</ParamField>

<ParamField query="--no-progress" type="boolean" default="false">
  Suppress the real-time progress bar, transfer speed, and ETA display. Recommended
  when piping output to logs or running Hayate inside a CI pipeline or script where
  terminal escape codes would produce noise.
</ParamField>

<ParamField query="--color" type="string" default="auto">
  Control colored terminal output. Accepted values:

  * `auto` *(default)* — color when stdout is a TTY; honors `NO_COLOR`, `CLICOLOR`, and `CLICOLOR_FORCE`
  * `always` — always emit ANSI color codes, even when output is redirected
  * `never` — plain text output with no color
</ParamField>

## Examples

```bash theme={null}
# Pairing mode — auto-discover receiver by code
hayate send ./report.pdf --code "alpha-bravo-charlie-delta"

# Direct mode — send to a known IP and port
hayate send ./archive.tar.gz 192.168.1.50:50001

# Auto-generate a code phrase (printed to terminal)
hayate send ./photos.zip

# Disable compression for already-compressed data
hayate send ./backup.zip 192.168.1.50:50001 --compress=false

# Use SHA-256 integrity instead of Blake3
hayate send ./dataset.csv 192.168.1.50:50001 --hash sha256

# Headless scripting
hayate send ./output.bin 10.0.0.5:50001 --no-progress
```

## Output

When you run `hayate send`, Hayate guides you through each stage of the transfer with structured terminal output:

1. **Pairing or connect** — prints the pairing code (if auto-generated) or the address Hayate is dialing, followed by a spinner while the connection is being established.
2. **Transfer info card** — once connected, displays a summary of what is about to be sent: filename, type (file or directory), size, compression setting, hash algorithm, negotiated cipher (`AES-256-GCM` or `ChaCha20-Poly1305`), and the receiver's address.
3. **Progress bar** — a live bar showing bytes transferred, current throughput (e.g. `1.2 GB/s`), and estimated time remaining. Suppressed with `--no-progress`.
4. **Transfer summary** — after completion, prints the filename, total size, wall-clock duration, average speed, and the final checksum so you can verify integrity independently.

<Note>
  `--code` and `TARGET` (`ip:port`) are mutually exclusive. Supplying both will
  cause Hayate to exit with an error. Use `--code` for Pairing Mode (no IP
  required) and `TARGET` or `--peer` for Direct Mode (explicit address).
</Note>
