Skip to content

📖 Scribe: Document meshguard connect command in CLI reference#69

Closed
igorls wants to merge 1 commit intomainfrom
scribe/document-connect-command-15735611632967095827
Closed

📖 Scribe: Document meshguard connect command in CLI reference#69
igorls wants to merge 1 commit intomainfrom
scribe/document-connect-command-15735611632967095827

Conversation

@igorls
Copy link
Owner

@igorls igorls commented Mar 8, 2026

What: The meshguard connect command was missing from the CLI reference documentation (docs/reference/cli.md).
Source: src/main.zig usage string and command parser block.
Fix: Added the meshguard connect command documentation, including its specific flags (--generate, --join, --in), to docs/reference/cli.md. Also appended a learning entry in .jules/scribe.md regarding manual CLI argument parsing causing drift.


PR created automatically by Jules for task 15735611632967095827 started by @igorls

This commit adds the `meshguard connect` command and its flags
(`--generate`, `--join`, `--in`) to the `docs/reference/cli.md` file. This
command was implemented in `src/main.zig` but was missing from the documentation.

Co-authored-by: igorls <4753812+igorls@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings March 8, 2026 11:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds missing CLI reference documentation for meshguard connect, based on the src/main.zig usage/help text, and records the doc-drift learning in .jules/scribe.md.

Changes:

  • Documented meshguard connect in docs/reference/cli.md, including --generate, --join, and --in.
  • Added a new “learning” entry to .jules/scribe.md about manual CLI parsing causing documentation drift.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
docs/reference/cli.md Adds a new section describing the meshguard connect command, examples, and flags.
.jules/scribe.md Adds a scribe entry capturing the documentation gap and a prevention note.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## `meshguard connect`

Direct peer connection via token exchange (bypassing seed nodes) and performs a coordinated UDP hole punch.
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The one-line description is grammatically awkward (“... and performs ...”) and reads like two predicates with different subjects. Consider rephrasing to something like “... and perform a coordinated UDP hole punch” or “... performing a coordinated UDP hole punch” for clarity in the CLI reference.

Suggested change
Direct peer connection via token exchange (bypassing seed nodes) and performs a coordinated UDP hole punch.
Establish a direct peer connection via token exchange (bypassing seed nodes) and perform a coordinated UDP hole punch.

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +117
```bash
meshguard connect --generate [--in <minutes>]
meshguard connect --join <mg://token>
```
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The reference currently omits an important part of the connect flow: in initiator mode (--generate) the command is interactive and prompts the user to paste the peer’s response token back into the initiator terminal. Adding a short “Flow”/“Notes” section (matching the help text in src/main.zig) would make the documented usage complete.

Copilot uses AI. Check for mistakes.
Comment on lines +110 to +113
## `meshguard connect`

Direct peer connection via token exchange (bypassing seed nodes) and performs a coordinated UDP hole punch.

Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

meshguard connect has security/behavioral side effects that aren’t mentioned here: after a successful punch it auto-trusts the peer (adds it to authorized keys) and saves the punched endpoint as a seed in the config directory. The CLI reference should call these out explicitly so users aren’t surprised by persistent config changes.

Copilot uses AI. Check for mistakes.
Comment on lines +119 to +123
| 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) |
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The --in flag is documented generically, but in the implementation the joiner uses the punch time embedded in the initiator’s token; changing --in on the joiner side doesn’t affect the scheduled punch time. Consider documenting that --in only applies to the initiator/--generate mode (or clarify how it behaves in --join).

Suggested change
| 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) |
| Flag | Description |
| ------------ | ---------------------------------------------------------------------------------------------------- |
| `--generate` | Generate a connection token as the initiator |
| `--join` | Join a connection using the peer's token |
| `--in` | Initiator-only: delay before punching in minutes (default: 1); joiner uses the time embedded in the token |

Copilot uses AI. Check for mistakes.
@igorls
Copy link
Owner Author

igorls commented Mar 9, 2026

Closing: superseded by docs audit fixes and direct commits to main. See PR #67 (merged) for codec bounds check, and direct commit for timing-safe fix in noise.zig.

@igorls igorls closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants