Skip to main content

tuna-cli 0.39 — terminal UI for every command

· 9 min

In tuna-cli 0.36, tunnels got a full-screen terminal UI. In 0.39, it is available for almost every command: tuna start and tuna run show a summary screen of all tunnels, tuna trigger shows a feed of invocations, and tuna domain, tuna monitor, and other management commands show a table where you can create, view, and delete resources. The inspector can now be toggled with a key, without restarting the tunnel.

General rules​

  • The UI activates automatically when a command runs in a terminal. Without a terminal, with --log=stdout, in CI, and with AI agents, the output is plain text as before, so scripts are not affected. To disable the UI manually, set TUNA_TUI=0.
  • Exit only with Ctrl+C. q and Esc go back from details and cards.
  • Hints at the bottom of the screen show only keys that work on the current screen and for the current row.
  • Management commands — tuna domain, endpoint, tunnel, api-key, monitor, and ssh-session — without a subcommand open a table in the terminal, and without a terminal print the help. Subcommands like tuna domain list work as before and now output a table to stdout that is convenient for piping.

Tunnels​

HTTP: inspector by key​

The request feed and metrics — rpm, p50 and p90, 4xx and 5xx response counts — remain in place. Enter opens request details, r replays it, / filters the feed. New — the I key: it toggles the inspector, like the --inspect flag, but without restarting the tunnel. When the inspector is off, the web inspector stops, request history is cleared, and the main screen becomes the log.

TCP: connections and traffic​

tuna tcp has no inspector, so the main screen is the tunnel log. Above it is a line with counters: active and total connections, incoming and outgoing traffic.

Postgres and Redis​

Sessions are on the left, queries and responses of the selected session on the right, including errors. Tab switches panels, Esc returns to the session list, y copies the query. l switches between sessions and the log. The inspector for Postgres and Redis is always on: parsing queries is what these tunnels are for, and without it there is tuna tcp. tuna redis works the same way.

SSH: session recording by key​

tuna ssh shows the connection instructions and a session feed. Enter on an active session opens live playback, Ctrl+C returns to the feed. R toggles recording of new sessions, like the --record-session flag. k copies the known_hosts line, c copies the ssh command.

Protected App​

tuna app connects a local service to a protected app. The screen shows the account, address, and the service receiving requests, with the log below. c copies the address, o opens it in the browser, Q shows a QR code.

Triggers​

tuna trigger runs a command on an incoming webhook or email. Now every invocation is visible in the feed: time, source, exit code, and duration. Enter opens details with the command's stdout and stderr — you can immediately see why the deploy failed.

For tuna trigger smtp, the source in the feed is from → to · subject of the email.

Multiple tunnels: start and run​

tuna start​

tuna start launches tunnels from the config and shows them on a summary screen: type, status, address, and inspector. Below is the request feed of the selected tunnel; for Postgres and Redis — its log. I toggles the HTTP tunnel inspector right from the summary screen. Enter opens the full tunnel UI with all its keys, Ctrl+C returns to the list. If tuna has something to say, for example on an error, L opens its own log. A crashed tunnel restarts automatically, as before.

tuna run​

tuna run launches an application and automatically opens a tunnel for every port it starts listening on. The application is the first row of the table, its output is below. Enter opens a live terminal with input: hot keys for Vite and other dev servers work. R restarts the application without affecting tunnels. Below the tunnel is its request feed. L shows tuna's own log: it shows which ports were found and which tunnels were opened.

The --http and --tcp flags for tuna run have been removed: the tunnel type is detected automatically. A port that does not respond over HTTP within 10 seconds gets a TCP tunnel.

Resource management​

Domains​

tuna domain opens a domain table. n reserves a subdomain or adds a custom domain: for a subdomain, a random name is pre-filled; after reserving, the card opens with a hint on what to do next — a DNS record for a custom domain and the tunnel command. Enter opens the domain card with status and validation history, t starts a tunnel on the selected domain right from the table.

For scripts, new subcommands tuna domain get, revalidate, and redirect are available, and tuna domain reserve example.com adds a custom domain.

TCP ports​

tuna endpoint works the same way: n reserves a port, the card shows the tunnel command, c copies host:port, t starts a tunnel on the port. The local port in the command is inferred from the port name: postgres → 5432, redis → 6379, mysql → 3306.

Active tunnels​

tuna tunnel shows all running tunnels for the team, the list updates every 5 seconds. Enter opens the tunnel card, d stops it.

API keys​

tuna api-key shows the team's keys. e edits the key description, d deletes the key. If the key being deleted is the one the CLI itself uses, the client will warn about it. New keys are still created in the dashboard.

Monitors​

tuna monitor shows monitors with their statuses, updated every 10 seconds. Enter opens the card with recent events, p pauses and resumes the monitor. For scripts, new subcommands get, events, pause, resume, and delete are available.

Recorded SSH sessions​

tuna ssh-session shows recorded sessions. Enter plays back a recording, x exports it to GIF.

Background services​

tuna service shows tunnels installed as background services. n creates a service, e edits its command, s, x, and R start, stop, and restart it, d deletes the service and revokes its key, Enter opens the logs.

The tuna service command itself has also been reworked. On Linux without sudo, it installs a user service via systemd --user and enables linger so the tunnel survives SSH logout and reboots. In addition to systemd, OpenRC (Alpine, Gentoo) is supported. For scripts, tuna service list, tuna service logs -f, and tuna service edit are available: the latter changes tunnel arguments without reinstalling. Each service gets its own key, tied to the tunnel address if one is specified, and uninstall revokes that key.

What to check when updating​

  • The --location flag is deprecated. New subdomains and ports live in a shared zone, and the server finds them without location. If the flag is set, the CLI will warn. For names reserved in the ru and nl zones, the flag is still needed.
  • Lists output to stdout. tuna domain list, endpoint list, tunnel list, api-key list, and monitor status print a table to stdout, not log lines to stderr. If a script parsed the old format, switch it to the --json flag: with it, list for domain, endpoint, tunnel, api-key, session, ssh-session, and bastion ls prints a JSON array, and an empty list prints [].
  • tuna service install starts the service immediately and disables the inspector. A separate tuna service start after installation is no longer needed. The inspector in a service is disabled (--inspect=false) unless explicitly enabled. tuna start cannot be installed as a service — create a separate service for each tunnel.
  • On Linux without sudo, the service is installed as a user service. Previously, install required root and created a system unit. If you need a system service, run install with sudo.
  • Token replaced by sessions and API keys. tuna login now signs in via browser, and servers and CI use an API key: TUNA_API_KEY and --api-key instead of TUNA_TOKEN and --token. The old token still works, but the CLI warns about the replacement. What changed and what to do — in a separate post.
  • tuna run without --http and --tcp. Remove these flags from your scripts.
  • tuna postgres and tuna redis have no --inspect flag. The inspector is always on for them, and the TUNA_INSPECT variable does not affect them. If a script ran them with --inspect=false, switch it to tuna tcp.

Along with the CLI, Tuna Desktop 0.3 was released with session-based sign-in and a "Domain" field in the tunnel form — see the separate post.

More about the keys for each screen — in the Terminal UI section; the full changelog — in the changelog.

Leave feedback​

If you enjoy using Tuna, or on the contrary you are not happy with something, please leave feedback.

News​

We announce new features and posts on our Telegram channel. Subscribe so you don't miss anything.

Help​

We value our users and carefully review every request. If you have any problems with tuna, please contact us in one of the following ways: