Skip to main content

Terminal interface

Starting with version 0.36.0, tuna http, tuna tcp, tuna ssh, tuna postgres, tuna redis and tuna kubernetes show a full-screen interface (TUI) instead of a text log. It turns on automatically when output goes to a terminal.

What's on the screen​

The header always shows:

  • the account;
  • the tunnel address (Forwarding) and the local address it points to;
  • the inspector address;
  • connection status: online or reconnecting;
  • messages from the server.

The main area depends on the tunnel type:

TunnelWhat it shows
HTTPA request feed (newest on top) and metrics: total requests, rpm, p50, p90, number of 4xx and 5xx responses. Enter opens request details: headers and a formatted JSON body
Postgres, RedisSessions on the left: ● — active, ○ — closed, • — has unseen events. Events of the selected session on the right, highlighted: queries, number of rows returned, errors
SSHdConnection instructions and a session feed, including denied attempts. Enter on an active session opens a live view, on a finished one — its recording
KubernetesThe header shows the service account, namespace, restrictions and access expiry, below is the feed of guest requests
TCPThe tunnel log

Hotkeys​

Common to all tunnels:

KeyAction
Ctrl+CStop the tunnel and exit. This is the only way to exit, q only goes back. On the QR code screen and in the SSH session viewer Ctrl+C only closes them
cCopy the tunnel address
iOpen the inspector in a browser
lShow or hide the log (except TCP, where the log is the main screen)
QShow a QR code for the tunnel address, Enter or Ctrl+C goes back, the tunnel keeps running
↑ ↓Select an entry
g / GJump to newest / oldest entries
Esc, qBack from details and the log

g, or ↑ on the first entry, turns on follow mode: the selection moves to new entries as they arrive.

HTTP:

KeyAction
EnterRequest details
rReplay the request
/Filter by method, path or status, Esc clears the filter
oOpen the tunnel address in a browser

Postgres and Redis:

KeyAction
TabSwitch between the session list and events
yCopy the query

SSHd:

KeyAction
EnterWatch an active session or replay a finished one. Ctrl+C closes only the viewer, the tunnel keeps running

With the interface on, the --qr flag shows the QR code screen once after connecting, Enter or Ctrl+C returns to the main screen.

With --inspect=false requests and sessions are not recorded, so the HTTP, Postgres and Redis feeds stay empty.

Turning it off​

To get the text log back, start the tunnel with one of these flags:

tuna http 8080 --log=stdout
tuna http 8080 --log=stderr
tuna http 8080 --log-format=json

Or set the environment variable TUNA_TUI=0.

With --log=/path/to/file.log the interface stays on and the log is also written to the file.

The interface does not turn on automatically when:

  • output is redirected to a file or a pipe, or the tunnel runs as a service or under systemd;
  • CI or NONINTERACTIVE is set;
  • TERM=dumb;
  • tuna is run by an AI agent (AI_AGENT, CLAUDECODE or CURSOR_AGENT is set). In this case you can turn it on with TUNA_TUI=1.

The tuna start command keeps its text output.