Add ports command for instances and nodes - #441
Open
callen-bot wants to merge 1 commit into
Open
Conversation
callen-bot
marked this pull request as ready for review
August 10, 2026 21:33
This was referenced Aug 12, 2026
callen-bot
force-pushed
the
agent/list-instance-ports
branch
from
August 14, 2026 20:20
4035dbd to
14be7cd
Compare
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
brev ports <instance-or-node>for Skybridge-managed environments and registered nodes--jsoncontract for automationWhy
Skybridge port mappings available in the Brev console were not exposed through the CLI, making endpoint and access details harder to inspect from scripts and terminal workflows.
Impact
Users can now inspect each mapping's real
port_id, endpoint, authorization or IP restrictions, public port, destination port, protocol, and type without leaving the CLI. The JSON output can be passed to later port-management commands without parsing the human tables.Compatibility
For managed instances, this command reads the Skybridge network member returned by
GetNetworkInfo. It intentionally does not synthesize the console's legacy secure-link or firewall fallback rows: those rows use UI-only IDs and cannot be targeted by the CLI's update or delete APIs.If no Skybridge network member is available, the command returns an actionable error explaining that the instance may still be provisioning or may use legacy network access, and directs the user to the console. A connected or disconnected Skybridge member with zero mappings remains a valid empty result (
[]with--json).Validation
go test -race ./pkg/cmd/ports ./pkg/cmd/util ./pkg/cmdgo test ./pkg/... -run '^$'make fmtcheck vet lintgo build -o /tmp/brev-port-stack .ports,ports close, andports updateon the fully stacked branchgo test -race ./...was also attempted. All package tests completed except existing environment-dependent failures on macOS ine2etest/setup,pkg/ssh, andpkg/store(hard-coded Linux workspace path, missing JetBrains Gateway installation, and Windows/WSL assumptions).