Skip to Content

hty info

Show resolved filesystem paths and whether the server is running. Useful for locating the Unix socket when setting up SSH tunnels for remote observation, and for scripts that need to know where session logs live on disk.

Reference

hty info [--json]

Show resolved paths and server status. Useful for finding the socket
path when setting up SSH tunnels for remote observation.

Output includes:
  socket    Path to the Unix domain socket
  logs      Directory where session logs are stored
  server    Whether the server is currently running

Flags:
  --json    Emit a structured JSON object instead of the text block.

Environment variables that affect paths ($HTY_SOCKET, $XDG_RUNTIME_DIR,
$XDG_STATE_HOME) are shown (text mode only) if set.

Default output

hty v0.5.0 socket: /run/user/1000/hty/sock logs: /home/me/.local/state/hty/logs server: running

If any of $HTY_SOCKET, $XDG_RUNTIME_DIR, or $XDG_STATE_HOME are set, they are listed below the main block so you can see why the paths resolved the way they did.

JSON output

Use --json for machine-readable output:

hty info --json
{ "version": "0.5.0", "socket_path": "/run/user/1000/hty/sock", "state_dir": "/home/me/.local/state/hty", "log_dir": "/home/me/.local/state/hty/logs", "server": { "running": true, "pid": 12345, "uptime_ms": 28340 }, "build": { "commit": "abc1234", "dirty": false } }

server.pid and server.uptime_ms are only present when the server is actually running. build reports the commit info embedded at compile time.

Examples

# Find the socket path to forward over SSH REMOTE_SOCK=$(ssh user@remote hty info --json | jq -r .socket_path) ssh -L "/tmp/hty-remote.sock:${REMOTE_SOCK}" user@remote # Check whether the server is up from a script hty info --json | jq -e '.server.running' >/dev/null

See environment variables for the full list of knobs that affect the paths hty info reports.

Last updated on