Repository navigation
feat(cli): show how machines connect - #65347
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Looks good. I ran machine add against the PR's server with the machines flag on: it shows the new access sentence and the iroh entry under Addresses. machine list behaves as before when no worker is connected. The new CLI and server tests pass (the WebSocket and Iroh connection cases are covered there), and cli, server, client and protocol typecheck cleanly.
Public API (experimental machine routes, machines flag), all additions:
GET /api/experimental/machine: each item gains an optionalconnection: { kind: "websocket" | "iroh", path?: "direct" | "relayed", rtt?: number }.POST /api/experimental/machine: the response gains a requiredreacharray of{ type: "url", url }or{ type: "iroh" }. The OpenAPI spec and the generated client types are updated to match, andMachineReachis now exported from the promise client types.machine listoutput gets a connection column, andmachine addgets a sentence saying who can use the join string.
This is backwards compatible for existing callers. The new CLI falls back to the addresses it sent when an older server returns no reach.
No blocking concerns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
machine listshows how each machine is connected, andmachine addsays who can use the join string.Until now you had to read the worker's log to learn whether a link was direct or relayed, and
machine addlisted addresses without the Iroh entry the server adds.🚦 Flag:
machines. Nothing new is read or started with the flag off.🐛 Before → after
irohentryiroh, an address that isn't loopback🔧 How
No history, events or metrics. Output that isn't a terminal is still the bare join string.
📊 Proof
packages/cli/test/machine.test.ts)reach👀 Read:
packages/core/src/machine/iroh.ts(describe), thenpackages/cli/src/commands/handlers/machine/common.ts.Follows #65341
Added by the opencode bot (AI-generated).
Public API: adds optional
connectionto experimental machine list items andreachto the machine add response (backwards compatible)