> ## 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 discover — Scan for Hayate Receivers on Your LAN

> hayate discover probes your LAN for active Hayate receivers using QUIC. Key flags: --timeout to control scan duration, --cidr to specify a subnet.

`hayate discover` scans your local network for machines running `hayate receive` and reports each one with its IP address, port, and round-trip time. It is the fastest way to find a receiver's address before switching to Direct Mode, or simply to check which devices on your network are ready to accept transfers. Results stream live to your terminal as peers respond — you never have to wait for the full scan to finish.

## Usage

```
hayate discover [OPTIONS]
```

**Alias:** `hayate scan`

## Options

<ParamField query="-t, --timeout" type="number" default="15">
  Maximum time in seconds to wait for probe responses before ending the scan.
  Hayate streams results as they arrive, so you will typically see discovered
  peers well before the timeout expires. Reduce this value (e.g. `--timeout 5`)
  on fast, low-latency networks; increase it if you are scanning a larger or
  congested subnet.
</ParamField>

<ParamField query="--cidr" type="string">
  Subnet to scan in CIDR notation, e.g. `192.168.1.0/24`. Hayate supports `/24`
  (254 hosts) and `/16` (up to 65 535 hosts, split into 256 `/24` sweeps) prefix
  lengths. If you omit this flag, Hayate auto-detects all active IPv4 subnets
  from your network interfaces and scans each one. Loopback (`127.0.0.1`) is
  always probed to catch other Hayate instances running on the same machine.
</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}
# Scan all detected subnets
hayate discover

# Scan a specific subnet with a 10-second timeout
hayate discover --cidr 192.168.1.0/24 --timeout 10

# Quick scan with 5-second timeout
hayate discover --timeout 5
```

## How it works

`hayate discover` uses high-concurrency QUIC probes to check every host in the target subnet as efficiently as possible:

* **Up to 128 simultaneous QUIC probes** run concurrently, so even a full `/24` sweep (254 hosts) completes in just a few seconds on a typical home or office LAN.
* **Results stream live** as peers respond. Each discovered receiver is printed immediately — you do not need to wait for the scan to complete before seeing results.
* **Priority probing** — gateway-adjacent addresses (`.1`, `.2`, `.3`, `.253`, `.254`) are probed first, since these are the most common locations for fixed devices like servers and desktop machines.
* **RTT quality indicators** — each result includes a visual signal strength icon reflecting the measured round-trip time: excellent (\< 2 ms), good (\< 10 ms), fair (\< 50 ms), or poor (≥ 50 ms).
* **Loopback is always included** — `127.0.0.1` is probed automatically so you can discover Hayate receivers running in another terminal on the same machine.

## Sample output

```
Scanning 192.168.1.0/24 (254 hosts)...
✓ 192.168.1.42:50001   RTT: 1.2ms
✓ 192.168.1.101:50001  RTT: 2.8ms
Found 2 receiver(s) in 3.1s
```

<Tip>
  Run `hayate discover` first when you do not know the receiver's IP address.
  Once you see the address in the results (e.g. `192.168.1.42:50001`), copy it
  directly into a Direct Mode send command:

  ```bash theme={null}
  hayate send ./file.zip 192.168.1.42:50001
  ```

  This is faster than Pairing Mode when you already have the address, and avoids
  any mDNS broadcast latency.
</Tip>
