feat: Add CLI agent and tunnel commands - #176
Draft
mattdjenkinson wants to merge 3 commits into
Draft
Conversation
Headless tools need a public URL they can create and tear down without the desktop GUI. The agent holds the ListenNode; the CLI talks to it over loopback HTTP and prints JSON on stdout.
Keep both the public_url tests from this branch and the quota tests that landed on main.
Two ListenNodes with the same listen_key fight over the connector and drop tunnels. The desktop app now starts or attaches to the detached agent and talks to it over the control API, so quitting the window no longer takes Portless URLs down.
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.
Summary
Portless and similar CLIs need a public HTTPS URL they can create from a script and delete when the child process exits. The desktop app already does that work, but it is a GUI, so nothing on PATH can ask it for a tunnel.
The new CLI uses the same on-disk repo as the app: session, selected project, and connector key. A long-lived agent process holds the ListenNode.
tunnel createcalls that agent over loopback HTTP, or starts it in the background if it is not running.JSON goes to stdout (
id,url). Logs go to stderr. The default log filter is info, matching the GUI.--wait-hostnameand--jsonselected_context.ymlon tunnel calls, so a latercontext setis picked up without a restartTest plan
cargo test -p lib--jsontunnel create --wait-hostname --jsonagainst a local HTTP server, then curl the url--jsonprints only JSON on stdout; logs stay on stderrtunnel getafter delete exits 1agent stop;tunnel listfails; the next create auto-starts the agentallowedHosts, the HMR websocket works