Skip to content

[Feature]: orca ports CLI command to list a workspace's detected ports #32632

Closed

Description

@manuelmeurer

Problem or use case

Orca already finds the listening ports for each workspace and shows them on the workspace card, in the status-bar popover and in the Ports panel. Scripts can't get at this list, because the CLI has no command for it.

The use case is a quick command or agent step that opens "the dev site of this workspace". Many dev servers (Puma with port 0, Vite when its default port is taken) pick a random port and don't write it anywhere. To find it today, a script has to repeat Orca's own scan with lsof -iTCP -sTCP:LISTEN, then lsof -d cwd for each PID, then compare the paths. That's slow, fragile, and breaks on SSH and remote workspaces, which Orca already handles.

Proposed solution

A read-only command built on the host-scoped scan from #27188 (workspacePorts.scanHost):

orca ports [--worktree <selector>] [--json]
  • Default worktree is the current one, as worktree current already resolves it.
  • Each row shows the port, PID, process name, connect host, protocol, how the owner was matched (cwd / command), and the URL the dev server printed, if Orca saw one.
  • --json returns the same rows as WorkspacePortScanResult.
  • Optionally, --all would list ports for every workspace, like the status-bar popover.

With this, "open my dev site" becomes:

open "$(orca ports --json | jq -r '.ports[0].advertisedUrl // "http://localhost:\(.ports[0].port)"')"

Alternatives or additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions