From 0fd7ba074a94391c517b8d4e7a2a438beb73fa03 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 11:10:35 +0000 Subject: [PATCH] docs(cli): add missing documentation for meshguard connect command Co-authored-by: igorls <4753812+igorls@users.noreply.github.com> --- .jules/scribe.md | 5 +++++ docs/reference/cli.md | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.jules/scribe.md b/.jules/scribe.md index 48b090c..a68a429 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 Commands Documentation +**Gap:** The `meshguard connect` command (and several others) implemented in `src/main.zig` were missing from the CLI reference documentation (`docs/reference/cli.md`). +**Learning:** Manual argument parsing in `src/main.zig` combined with manual documentation updates leads to new commands being added to code but forgotten in documentation. +**Prevention:** Audit `src/main.zig` for `std.mem.eql(u8, command, ...)` statements and cross-reference them with the headings in `docs/reference/cli.md`. diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 750324c..87bdb74 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -95,6 +95,24 @@ meshguard up [options] --- +## `meshguard connect` + +Direct peer connection via token exchange (bypasses seed nodes). + +```bash +meshguard connect --generate [--in ] +meshguard connect --join +``` + +**Flow**: + +1. Initiator runs `--generate`, shares `mg://` token with peer +2. Peer runs `--join `, shares response token back +3. Initiator pastes response token +4. Both sides punch simultaneously (NTP-synced) + +--- + ## `meshguard down` Stop the daemon and remove the `mg0` interface.