Files
lanspread/crates/lanspread-peer-cli/README.md
T
ddidderr 72fa61da65 feat(peer-cli): add just recipe for scenario matrix
Add a peer-cli-tests just recipe as the public entry point for the existing
extended scenario runner. The recipe depends on peer-cli-image, so Docker
uses its normal layer cache to decide whether the image needs rebuilding
before the Python harness runs.

This gives contributors one memorable command for the full S1-S47 matrix
while still allowing selected scenarios as positional arguments. The
underlying runner continues to own container topology and JSONL command/event
handling.

Test Plan:
- just --list
- just --dry-run peer-cli-tests S39 S40
- git diff --check

Refs: PEER_CLI_SCENARIOS.md
2026-06-20 20:45:31 +02:00

50 lines
1.7 KiB
Markdown

# lanspread-peer-cli
Scriptable peer harness for automated LAN-spread tests. The binary starts the
core peer runtime without the Tauri GUI, reads one JSON command per stdin line,
and writes JSONL events, results, and errors to stdout.
## Running
```bash
just peer-cli-build
just peer-cli-image
just peer-cli-tests
just peer-cli-run alpha
```
Useful flags:
- `--games-dir PATH` stores local archives and installs.
- `--state-dir PATH` stores the generated peer identity.
- `--fixture GAME_ID` seeds a tiny archive that the fixture unpacker can install.
## Fixture Game Directories
`fixtures/fixture-alpha`, `fixtures/fixture-bravo`, and
`fixtures/fixture-charlie` are ready-to-use game directories for local CLI
smoke tests. Point `--games-dir` at one of them to start a peer with several
catalog-backed fake games. Each game includes `version.ini` and a real RAR
archive renamed to `.eti`; `fixture-alpha` and `fixture-bravo` share `ggoo`,
while `fixture-bravo` and `fixture-charlie` share `cnc4`.
## Commands
Every command is a JSON object with `cmd` or `command`; `id` is optional and is
echoed back on the result or error line.
```json
{"id":"s1","cmd":"status"}
{"id":"p1","cmd":"wait-peers","count":1,"timeout_ms":5000}
{"id":"c1","cmd":"connect","addr":"127.0.0.1:34567"}
{"id":"g1","cmd":"list-games"}
{"id":"d1","cmd":"download","game_id":"fixture-one","install":true}
{"id":"i1","cmd":"install","game_id":"fixture-one"}
{"id":"u1","cmd":"uninstall","game_id":"fixture-one"}
{"id":"q1","cmd":"shutdown"}
```
The `status` result includes receiver-side `active_operations` and
sender-side `active_outbound_transfers` counts by game ID, which the scenario
runner uses to verify transfer lifecycle cleanup.