You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e506d8c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(tui): add port forwarding support to Gator (#80)
Extract forward PID management, resolve_ssh_gateway, and shell_escape from
navigator-cli into navigator-core::forward as a shared module. Add a Ports
field to the TUI create sandbox modal, a NOTES column to the sandbox table,
and a Forwards row to the sandbox detail view. On creation with ports, Gator
polls for Ready state then spawns background SSH tunnels. Forward cleanup
runs automatically on sandbox delete.
Closes#80
Status colors tell you the sandbox state at a glance:
73
75
@@ -124,11 +126,23 @@ Gator uses a dark terminal theme based on the NVIDIA brand palette:
124
126
125
127
The title bar uses white text on an Everglade background to visually anchor the top of the screen.
126
128
129
+
## Port Forwarding
130
+
131
+
Gator supports creating sandboxes with port forwarding directly from the create modal. When creating a sandbox, you can specify ports to forward in the **Ports** field (comma-separated, e.g., `8080,3000`). After the sandbox reaches `Ready` state, Gator automatically spawns background SSH tunnels (`ssh -N -f -L <port>:127.0.0.1:<port>`) for each specified port.
132
+
133
+
Forwarded ports are displayed in the **NOTES** column of the sandbox table as `fwd:8080,3000` and in the **Forwards** row of the sandbox detail view.
134
+
135
+
Port forwarding lifecycle:
136
+
-**On create**: Gator polls for sandbox readiness (up to 30 attempts at 2-second intervals), then spawns SSH tunnels.
137
+
-**On delete**: Any active forwards for the sandbox are automatically stopped before deletion.
138
+
-**PID tracking**: Forward PIDs are stored in `~/.config/nemoclaw/forwards/<name>-<port>.pid`, shared with the CLI.
139
+
140
+
The forwarding implementation lives in `navigator-core::forward`, shared between the CLI and TUI.
141
+
127
142
## What is Not Yet Available
128
143
129
144
Gator is in its initial phase. The following features are planned but not yet implemented:
130
145
131
-
-**Sandbox operations** — creating, connecting to (SSH), deleting, and viewing logs for sandboxes.
132
146
-**Inference and provider views** — browsing inference routes and provider configurations.
133
147
-**Help overlay** — the `?` key is shown in the nav bar but does not open a help screen yet.
134
148
-**Command bar autocomplete** — the command bar accepts text but does not offer suggestions.
@@ -140,4 +154,4 @@ See the [Gator design plan](plans/gator-tui.md) for the full roadmap, including
140
154
141
155
The TUI lives in `crates/navigator-tui/`, a separate workspace crate. The CLI crate (`crates/navigator-cli/`) depends on it and launches it via the `Gator` command variant in the `Commands` enum. This keeps TUI-specific dependencies (ratatui, crossterm) out of the CLI when not in use.
142
156
143
-
The `navigator-tui` crate depends on `navigator-core` for protobuf types and the gRPC client — it communicates with the gateway over the same gRPC channel the CLI uses.
157
+
The `navigator-tui` crate depends on `navigator-core` for protobuf types, the gRPC client, and shared utilities (e.g., `navigator_core::forward` for port forwarding PID management) — it communicates with the gateway over the same gRPC channel the CLI uses.
When the gateway returns a loopback address (`127.0.0.1`, `0.0.0.0`, `localhost`, or `::1`), the CLI overrides it with the host from the cluster endpoint URL. This handles the common case where the gateway defaults to `127.0.0.1` but the cluster is running on a remote machine.
508
+
When the gateway returns a loopback address (`127.0.0.1`, `0.0.0.0`, `localhost`, or `::1`), the client overrides it with the host from the cluster endpoint URL. This handles the common case where the gateway defaults to `127.0.0.1` but the cluster is running on a remote machine.
479
509
480
510
The override only applies if the cluster endpoint itself is not also a loopback address. If both are loopback, the original address is kept.
481
511
512
+
This function is shared between the CLI and TUI via the `navigator-core::forward` module.
0 commit comments