UPTERM(1)

πŸ“¦
version 0.41.0 Β· 2 versions
, in arch rolling

✨ 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 for current
  • --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=false shows them there too.
  • -o, --output="" β€” Output format: json or go-template='...'

🧚 OPTIONS INHERITED FROM PARENT COMMANDS 🧚

  • --debug[=false] β€” Enable debug logging (log file: /build/.upterm/upterm.log). A non-empty DEBUG turns 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 🌈

πŸ“œ 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