TTL (Self-Destruct)

The --ttl flag arms a self-destruct timer. When the duration elapses, goshs shuts down gracefully — exactly as if you had pressed Ctrl+C.

# Shut down automatically after 2 hours
goshs --ttl 2h

# Combined with other flags
goshs -s -ss -b admin:secret --catcher --ttl 4h

Duration syntax

The flag accepts any Go duration string:

Example Meaning
30m 30 minutes
2h 2 hours
90s 90 seconds
1h30m 1 hour 30 minutes

A value of 0 (the default) disables the timer entirely.

TUI integration

When --tui is also active, the countdown is shown in the TUI status bar and the dashboard exits automatically when the timer fires before handing off to the graceful shutdown.

CLI flag

--ttl    Self-destruct after a duration, e.g. 30m, 2h  (default: disabled)

Config file

{
  "ttl": 7200
}

In the config file ttl is specified in seconds (7200 = 2 hours). On the command line the standard Go duration syntax applies.