Files
video-setup/docs/cli/discovery_cli.md
mikael-lovqvists-claude-agent 44090c1d6d docs: write CLI docs for all 12 previously undocumented tools
Add docs/cli/ entries for:
  transport_cli, discovery_cli, config_cli, protocol_cli, query_cli,
  test_image_cli, xorg_cli, v4l2_view_cli, stream_send_cli,
  stream_recv_cli, reconciler_cli, controller_cli

Each doc covers: description, build instructions, full usage with all
options and defaults, example output, and a relationship note pointing
to related tools. controller_cli includes the display control IDs table
and notes its temporary status.

README.md: convert all CLI tool entries to links.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 00:45:27 +00:00

54 lines
1.4 KiB
Markdown

# discovery_cli
A development tool for testing the UDP multicast discovery layer. Announces a node on the local network and prints peers as they appear and disappear.
---
## Build
From the repository root:
```sh
make cli
```
The binary is placed in `build/cli/`.
---
## Usage
```sh
discovery_cli <name> <tcp_port> [flags]
```
| Argument | Description |
|---|---|
| `name` | Node name in `namespace:instance` form, e.g. `v4l2:microscope` |
| `tcp_port` | The TCP port this node listens on for transport connections |
| `flags` | Comma-separated role list: `source`, `relay`, `sink`, `controller` (default: `source`) |
Example — announce a source node and watch for peers:
```sh
./discovery_cli camera:0 8000 source
```
Example output as peers are found and lost:
```
found: unnamed:0 192.168.1.42:8001 site=0 flags=source
found: display:0 192.168.1.55:8002 site=0 flags=sink
lost: unnamed:0 192.168.1.42:8001
```
Run two instances on the same machine (different ports) to verify mutual discovery.
---
## Relationship to the Video Routing System
`discovery_cli` exercises the `discovery` module, which the video node uses to find peers on the LAN without configuration. The node starts a discovery listener on startup; controllers use discovered peer tables to locate nodes before connecting.
See also: [`query_cli.md`](query_cli.md) for a combined discovery + protocol query.