UPTERM(1)
β¨ NAME β¨
okay so hi bestie!! welcome to the Upterm Manual for UPTERM(1) π this whole page is about upterm-session-current β Show the session this terminal is in. literally its whole job. slay.
πΈ SYNOPSIS πΈ
upterm session current [flags]
π¦ DESCRIPTION π¦
okay so upterm-session-current shows the session this terminal is in, straight from $UPTERM_ADMIN_SOCKET. periodt.
upterm host sets $UPTERM_ADMIN_SOCKET for the commands it runs, so a shell that's inside a session can show it, and a prompt can mark it. and if you want another session's admin socket instead? that's what --admin-socket is for, bestie.
Output formats are giving choose-your-own-adventure:
-o json JSON
-o go-template='{{.ClientCount}}' a Go template
Template variables, in order: SessionID, ClientCount (this session's terminals and guests), GuestCount, CountsKnown, Host, Command, ForceCommand, LoginCommand, Access, ConnectedClients, LaunchID, Open, JoinStateSource, JoinTimeout, JoinDeadline, FirstGuestJoinedAt, Name, Status, Reconnect, TunnelReason, TunnelLostAt, NextAttemptAt, StartConfirmed, ReadOnly, FileTransfer, FileTransferApprovalRequired, LocalForwarding, GuestShell, Execution, TCPForwarding, ApprovalMethod, KnownHosts, RelayKeyTrust, SSHCommand, JoinCommand and SSHConfig.
important lore: from LaunchID on, a variable the session's upterm doesn't report is empty, false, nil or a zero time (0001-01-01 ...), so test it first: {{with .Name}}{{.}}{{end}}, or {{if not .TunnelLostAt.IsZero}}...{{end}}. no cap, check before you use it.
Exit tea β: it exits 4 when not in a session ($UPTERM_ADMIN_SOCKET is unset, or no session answers at it), and 1 for any other failure. With -o, not being in a session prints nothing. so your prompt stays cute and quiet, iykyk.
π OPTIONS π
--admin-socket="$UPTERM_ADMIN_SOCKET"β Admin socket of the session to show.-h,--help[=false]β help forcurrent--hide-client-ip[=false]β Hide guests' IP addresses from upterm's output. When it isn't set (by flag, environment or config file), they are hidden in CI only;--hide-client-ip=falseshows them there too.-o,--output=""β Output format:jsonorgo-template='...'
π§ OPTIONS INHERITED FROM PARENT COMMANDS π§
--debug[=false]β Enable debug logging (log file:/build/.upterm/upterm.log). A non-emptyDEBUGturns it on too.
π₯ EXAMPLE π₯
okay some copy-paste-ready moments:
# Show the session this terminal is in:
upterm session current
# As JSON:
upterm session current -o json
# For a shell prompt (prints nothing outside a session):
upterm session current -o go-template='π {{.ClientCount}} '
# For a terminal title, with the session's name when its upterm reports it:
upterm session current -o go-template='upterm{{with .Name}} {{.}}{{end}}: {{.ClientCount}} clients'
π SEE ALSO π
upterm-session(1)β go give it a read, bestie π«Ά
π HISTORY π
2-Nov-2026 β Auto generated by spf13/cobra.
mwah π β brought to you by Upterm 0.0.0+dev, dated Nov 2026; stay slay, bestie π«Ά
π¦ where this page comes from
- arch rolling: upterm 0.41.0-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms