Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .jules/scribe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
18 changes: 18 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ meshguard up [options]

---

## `meshguard connect`

Direct peer connection via token exchange (bypasses seed nodes).

```bash
meshguard connect --generate [--in <minutes>]
meshguard connect --join <mg://token>
```
Comment on lines +102 to +105
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation defaults to generate mode when no sub-flag is provided (mode starts as .generate). The docs currently imply --generate is required; consider documenting that meshguard connect alone is equivalent to meshguard connect --generate, or update the usage synopsis to reflect that --generate is optional/default.

Copilot uses AI. Check for mistakes.

**Flow**:

1. Initiator runs `--generate`, shares `mg://` token with peer
2. Peer runs `--join <token>`, shares response token back
3. Initiator pastes response token
4. Both sides punch simultaneously (NTP-synced)

Comment on lines +107 to +113
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--in <minutes> is listed in the synopsis but its meaning and default value aren’t documented here (the CLI help says it’s a punch delay with a default of 1 minute). Adding a short options table or a one-liner describing --in (and its default) would prevent ambiguity.

Copilot uses AI. Check for mistakes.
---

## `meshguard down`

Stop the daemon and remove the `mg0` interface.
Expand Down