diff --git a/.jules/scribe.md b/.jules/scribe.md index 48b090c..29dee29 100644 --- a/.jules/scribe.md +++ b/.jules/scribe.md @@ -12,3 +12,8 @@ **Gap:** The documentation stated the SWIM protocol period was 1000ms (1s), but the implementation uses 5000ms (5s) in both `src/config.zig` and `src/discovery/swim.zig`. **Learning:** The documentation likely reflected an early design decision or standard SWIM defaults, but the implementation settled on a more conservative 5s interval for WAN stability, and docs were not updated. **Prevention:** Add a CI check that grep's `docs/guide/configuration.md` for values that match constants exported in `src/config.zig`. + +## 2024-05-24 - Missing CLI Command Documentation +**Gap:** The `meshguard connect` command was implemented in `src/main.zig` but missing from the CLI reference in `docs/reference/cli.md`. +**Learning:** The CLI reference document is highly prone to drift because command parsing and help messages are implemented manually in `src/main.zig` rather than using a generator framework. +**Prevention:** Ensure that whenever a new command is added to the `usage` string in `main.zig`, a corresponding section is added to `docs/reference/cli.md`. diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 750324c..51e4277 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -107,6 +107,23 @@ Uses `RTM_DELLINK` via RTNETLINK to remove the interface. --- +## `meshguard connect` + +Direct peer connection via token exchange (bypassing seed nodes) and performs a coordinated UDP hole punch. + +```bash +meshguard connect --generate [--in ] +meshguard connect --join +``` + +| Flag | Description | +| ------------ | ----------------------------------------------- | +| `--generate` | Generate a connection token as the initiator | +| `--join` | Join a connection using the peer's token | +| `--in` | Delay before punching in minutes (default: 1) | + +--- + ## `meshguard status` Display the current mesh state.